Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 630368c2bfac
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 89c20fb00107
Choose a head ref
  • 2 commits
  • 39 files changed
  • 1 contributor

Commits on Jan 30, 2015

  1. Copy the full SHA
    3df5d12 View commit details
  2. Copy the full SHA
    89c20fb View commit details
Showing with 32 additions and 99 deletions.
  1. +0 −1 spec/truffle/tags/core/enumerable/chunk_tags.txt
  2. +0 −1 spec/truffle/tags/core/enumerable/collect_tags.txt
  3. +0 −2 spec/truffle/tags/core/enumerable/detect_tags.txt
  4. +0 −1 spec/truffle/tags/core/enumerable/drop_tags.txt
  5. +0 −2 spec/truffle/tags/core/enumerable/drop_while_tags.txt
  6. +0 −3 spec/truffle/tags/core/enumerable/each_cons_tags.txt
  7. +0 −2 spec/truffle/tags/core/enumerable/each_entry_tags.txt
  8. +0 −3 spec/truffle/tags/core/enumerable/each_slice_tags.txt
  9. +0 −1 spec/truffle/tags/core/enumerable/each_with_index_tags.txt
  10. +0 −1 spec/truffle/tags/core/enumerable/each_with_object_tags.txt
  11. +0 −2 spec/truffle/tags/core/enumerable/entries_tags.txt
  12. +0 −2 spec/truffle/tags/core/enumerable/find_tags.txt
  13. +0 −5 spec/truffle/tags/core/enumerable/group_by_tags.txt
  14. +0 −1 spec/truffle/tags/core/enumerable/inject_tags.txt
  15. +0 −1 spec/truffle/tags/core/enumerable/lazy_tags.txt
  16. +0 −1 spec/truffle/tags/core/enumerable/map_tags.txt
  17. +0 −1 spec/truffle/tags/core/enumerable/reduce_tags.txt
  18. +0 −1 spec/truffle/tags/core/enumerable/sort_by_tags.txt
  19. +0 −2 spec/truffle/tags/core/enumerable/sort_tags.txt
  20. +0 −2 spec/truffle/tags/core/enumerable/take_while_tags.txt
  21. +0 −2 spec/truffle/tags/core/enumerable/to_a_tags.txt
  22. +0 −4 spec/truffle/tags/core/enumerator/lazy/collect_concat_tags.txt
  23. +0 −3 spec/truffle/tags/core/enumerator/lazy/collect_tags.txt
  24. +0 −3 spec/truffle/tags/core/enumerator/lazy/drop_tags.txt
  25. +0 −4 spec/truffle/tags/core/enumerator/lazy/drop_while_tags.txt
  26. +0 −3 spec/truffle/tags/core/enumerator/lazy/enum_for_tags.txt
  27. +0 −4 spec/truffle/tags/core/enumerator/lazy/find_all_tags.txt
  28. +0 −4 spec/truffle/tags/core/enumerator/lazy/flat_map_tags.txt
  29. +0 −3 spec/truffle/tags/core/enumerator/lazy/grep_tags.txt
  30. +0 −7 spec/truffle/tags/core/enumerator/lazy/initialize_tags.txt
  31. +0 −1 spec/truffle/tags/core/enumerator/lazy/lazy_tags.txt
  32. +0 −3 spec/truffle/tags/core/enumerator/lazy/map_tags.txt
  33. +0 −4 spec/truffle/tags/core/enumerator/lazy/reject_tags.txt
  34. +0 −4 spec/truffle/tags/core/enumerator/lazy/select_tags.txt
  35. +0 −3 spec/truffle/tags/core/enumerator/lazy/take_tags.txt
  36. +0 −4 spec/truffle/tags/core/enumerator/lazy/take_while_tags.txt
  37. +0 −3 spec/truffle/tags/core/enumerator/lazy/to_enum_tags.txt
  38. +0 −5 spec/truffle/tags/core/enumerator/lazy/zip_tags.txt
  39. +32 −0 truffle/src/main/java/org/jruby/truffle/translator/BodyTranslator.java
1 change: 0 additions & 1 deletion spec/truffle/tags/core/enumerable/chunk_tags.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
fails:Enumerable#chunk returns an Enumerator if given a block
fails:Enumerable#chunk yields the current element and the current chunk to the block
fails:Enumerable#chunk returns elements of the Enumerable in an Array of Arrays, [v, ary], where 'ary' contains the consecutive elements for which the block returned the value 'v'
fails:Enumerable#chunk returns elements for which the block returns :_alone in separate Arrays
1 change: 0 additions & 1 deletion spec/truffle/tags/core/enumerable/collect_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
fails:Enumerable#collect passes through the values yielded by #each_with_index
fails:Enumerable#collect returns an enumerator when no block given
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/enumerable/detect_tags.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
fails:Enumerable#detect passes through the values yielded by #each_with_index
fails:Enumerable#detect returns an enumerator when no block given
fails:Enumerable#detect passes the ifnone proc to the enumerator
1 change: 0 additions & 1 deletion spec/truffle/tags/core/enumerable/drop_tags.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
fails:Enumerable#drop passed a number n as an argument tries to convert n to an Integer using #to_int
fails:Enumerable#drop passed a number n as an argument returns [] for empty enumerables
fails:Enumerable#drop passed a number n as an argument returns [] if dropping all
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/enumerable/drop_while_tags.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
fails:Enumerable#drop_while returns no/all elements for {true/false} block
fails:Enumerable#drop_while accepts returns other than true/false
fails:Enumerable#drop_while will only go through what's needed
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/enumerable/each_cons_tags.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
fails:Enumerable#each_cons tries to convert n to an Integer using #to_int
fails:Enumerable#each_cons works when n is >= full length
fails:Enumerable#each_cons yields only as much as needed
fails:Enumerable#each_cons returns an enumerator if no block
fails:Enumerable#each_cons gathers whole arrays as elements when each yields multiple
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/enumerable/each_entry_tags.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
fails:Enumerable#each_entry returns an enumerator if no block
fails:Enumerable#each_entry passes through the values yielded by #each_with_index
fails:Enumerable#each_entry passes extra arguments to #each
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/enumerable/each_slice_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/enumerable/each_with_index_tags.txt

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/core/enumerable/entries_tags.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
fails:Enumerable#entries returns an array containing the elements
fails:Enumerable#entries passes through the values yielded by #each_with_index
fails:Enumerable#entries passes arguments to each
fails:Enumerable#entries returns a tainted array if self is tainted
fails:Enumerable#entries returns an untrusted array if self is untrusted
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/enumerable/find_tags.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
fails:Enumerable#find calls the ifnone proc when there are no elements
fails:Enumerable#find passes through the values yielded by #each_with_index
fails:Enumerable#find returns an enumerator when no block given
fails:Enumerable#find passes the ifnone proc to the enumerator
5 changes: 0 additions & 5 deletions spec/truffle/tags/core/enumerable/group_by_tags.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
fails:Enumerable#group_by returns a hash with values grouped according to the block
fails:Enumerable#group_by returns an empty hash for empty enumerables
fails:Enumerable#group_by returns a hash without default_proc
fails:Enumerable#group_by returns an Enumerator if called without a block
fails:Enumerable#group_by gathers whole arrays as elements when each yields multiple
fails:Enumerable#group_by returns a tainted hash if self is tainted
fails:Enumerable#group_by returns an untrusted hash if self is untrusted
1 change: 0 additions & 1 deletion spec/truffle/tags/core/enumerable/inject_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/enumerable/lazy_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/enumerable/map_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
fails:Enumerable#map passes through the values yielded by #each_with_index
fails:Enumerable#map returns an enumerator when no block given
1 change: 0 additions & 1 deletion spec/truffle/tags/core/enumerable/reduce_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/enumerable/sort_by_tags.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/core/enumerable/sort_tags.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
fails:Enumerable#sort sorts by the natural order as defined by <=>
fails:Enumerable#sort yields elements to the provided block
fails:Enumerable#sort raises a NoMethodError if elements do not define <=>
fails:Enumerable#sort sorts enumerables that contain nils
fails:Enumerable#sort compare values returned by block with 0
fails:Enumerable#sort raises an error if objects can't be compared
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/enumerable/take_while_tags.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
fails:Enumerable#take_while returns no/all elements for {true/false} block
fails:Enumerable#take_while accepts returns other than true/false
fails:Enumerable#take_while will only go through what's needed
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/enumerable/to_a_tags.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
fails:Enumerable#to_a returns an array containing the elements
fails:Enumerable#to_a passes arguments to each
fails:Enumerable#to_a returns a tainted array if self is tainted
fails:Enumerable#to_a returns an untrusted array if self is untrusted
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
fails:Enumerator::Lazy#collect_concat returns a new instance of Enumerator::Lazy
fails:Enumerator::Lazy#collect_concat sets nil to size
fails:Enumerator::Lazy#collect_concat calls the block with initial values when yield with multiple arguments
fails:Enumerator::Lazy#collect_concat raises an ArgumentError when not given a block
fails:Enumerator::Lazy#collect_concat when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times
fails:Enumerator::Lazy#collect_concat when the returned lazy enumerator is evaluated by Enumerable#first flattens elements when the given block returned an array or responding to .each and .force
fails:Enumerator::Lazy#collect_concat on a nested Lazy sets nil to size
fails:Enumerator::Lazy#collect_concat on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times
fails:Enumerator::Lazy#collect_concat on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first flattens elements when the given block returned an array or responding to .each and .force
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/enumerator/lazy/collect_tags.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
fails:Enumerator::Lazy#collect returns a new instance of Enumerator::Lazy
fails:Enumerator::Lazy#collect keeps size
fails:Enumerator::Lazy#collect calls the block with initial values when yield with multiple arguments
fails:Enumerator::Lazy#collect when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times
fails:Enumerator::Lazy#collect on a nested Lazy keeps size
fails:Enumerator::Lazy#collect on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/enumerator/lazy/drop_tags.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
fails:Enumerator::Lazy#drop returns a new instance of Enumerator::Lazy
fails:Enumerator::Lazy#drop sets difference of given count with old size to new size
fails:Enumerator::Lazy#drop when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times
fails:Enumerator::Lazy#drop on a nested Lazy sets difference of given count with old size to new size
fails:Enumerator::Lazy#drop on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times
4 changes: 0 additions & 4 deletions spec/truffle/tags/core/enumerator/lazy/drop_while_tags.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
fails:Enumerator::Lazy#drop_while returns a new instance of Enumerator::Lazy
fails:Enumerator::Lazy#drop_while sets nil to size
fails:Enumerator::Lazy#drop_while calls the block with initial values when yield with multiple arguments
fails:Enumerator::Lazy#drop_while raises an ArgumentError when not given a block
fails:Enumerator::Lazy#drop_while when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times
fails:Enumerator::Lazy#drop_while on a nested Lazy sets nil to size
fails:Enumerator::Lazy#drop_while on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/enumerator/lazy/enum_for_tags.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
fails:Enumerator::Lazy#enum_for requires multiple arguments
fails:Enumerator::Lazy#enum_for returns a new instance of Enumerator::Lazy
fails:Enumerator::Lazy#enum_for sets nil to size when not given a block
fails:Enumerator::Lazy#enum_for sets given block to size when given a block
fails:Enumerator::Lazy#enum_for generates a lazy enumerator from the given name
fails:Enumerator::Lazy#enum_for passes given arguments to wrapped method
fails:Enumerator::Lazy#enum_for used by some parent's methods though returning Lazy
4 changes: 0 additions & 4 deletions spec/truffle/tags/core/enumerator/lazy/find_all_tags.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
fails:Enumerator::Lazy#find_all returns a new instance of Enumerator::Lazy
fails:Enumerator::Lazy#find_all sets nil to size
fails:Enumerator::Lazy#find_all calls the block with a gathered array when yield with multiple arguments
fails:Enumerator::Lazy#find_all raises an ArgumentError when not given a block
fails:Enumerator::Lazy#find_all when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times
fails:Enumerator::Lazy#find_all on a nested Lazy sets nil to size
fails:Enumerator::Lazy#find_all on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times
4 changes: 0 additions & 4 deletions spec/truffle/tags/core/enumerator/lazy/flat_map_tags.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
fails:Enumerator::Lazy#flat_map returns a new instance of Enumerator::Lazy
fails:Enumerator::Lazy#flat_map sets nil to size
fails:Enumerator::Lazy#flat_map calls the block with initial values when yield with multiple arguments
fails:Enumerator::Lazy#flat_map raises an ArgumentError when not given a block
fails:Enumerator::Lazy#flat_map when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times
fails:Enumerator::Lazy#flat_map when the returned lazy enumerator is evaluated by Enumerable#first flattens elements when the given block returned an array or responding to .each and .force
fails:Enumerator::Lazy#flat_map on a nested Lazy sets nil to size
fails:Enumerator::Lazy#flat_map on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times
fails:Enumerator::Lazy#flat_map on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first flattens elements when the given block returned an array or responding to .each and .force
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/enumerator/lazy/grep_tags.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
fails:Enumerator::Lazy#grep requires an argument
fails:Enumerator::Lazy#grep returns a new instance of Enumerator::Lazy
fails:Enumerator::Lazy#grep sets nil to size
fails:Enumerator::Lazy#grep calls the block with a gathered array when yield with multiple arguments
fails:Enumerator::Lazy#grep when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times when not given a block
fails:Enumerator::Lazy#grep when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times when given a block
fails:Enumerator::Lazy#grep on a nested Lazy sets nil to size
fails:Enumerator::Lazy#grep on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times when not given a block
fails:Enumerator::Lazy#grep on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times when given a block
7 changes: 0 additions & 7 deletions spec/truffle/tags/core/enumerator/lazy/initialize_tags.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
fails:Enumerator::Lazy#initialize returns self
fails:Enumerator::Lazy#initialize sets nil to size if not given a size
fails:Enumerator::Lazy#initialize sets nil to size if given size is nil
fails:Enumerator::Lazy#initialize sets given size to own size if the given size is Float::INFINITY
fails:Enumerator::Lazy#initialize sets given size to own size if the given size is a Fixnum
fails:Enumerator::Lazy#initialize sets given size to own size if the given size is a Proc
fails:Enumerator::Lazy#initialize when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times
fails:Enumerator::Lazy#initialize on frozen instance raises a RuntimeError
1 change: 0 additions & 1 deletion spec/truffle/tags/core/enumerator/lazy/lazy_tags.txt

This file was deleted.

3 changes: 0 additions & 3 deletions spec/truffle/tags/core/enumerator/lazy/map_tags.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
fails:Enumerator::Lazy#map returns a new instance of Enumerator::Lazy
fails:Enumerator::Lazy#map keeps size
fails:Enumerator::Lazy#map calls the block with initial values when yield with multiple arguments
fails:Enumerator::Lazy#map when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times
fails:Enumerator::Lazy#map on a nested Lazy keeps size
fails:Enumerator::Lazy#map on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times
4 changes: 0 additions & 4 deletions spec/truffle/tags/core/enumerator/lazy/reject_tags.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
fails:Enumerator::Lazy#reject returns a new instance of Enumerator::Lazy
fails:Enumerator::Lazy#reject sets nil to size
fails:Enumerator::Lazy#reject calls the block with a gathered array when yield with multiple arguments
fails:Enumerator::Lazy#reject raises an ArgumentError when not given a block
fails:Enumerator::Lazy#reject when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times
fails:Enumerator::Lazy#reject on a nested Lazy sets nil to size
fails:Enumerator::Lazy#reject on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times
4 changes: 0 additions & 4 deletions spec/truffle/tags/core/enumerator/lazy/select_tags.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
fails:Enumerator::Lazy#select returns a new instance of Enumerator::Lazy
fails:Enumerator::Lazy#select sets nil to size
fails:Enumerator::Lazy#select calls the block with a gathered array when yield with multiple arguments
fails:Enumerator::Lazy#select raises an ArgumentError when not given a block
fails:Enumerator::Lazy#select when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times
fails:Enumerator::Lazy#select on a nested Lazy sets nil to size
fails:Enumerator::Lazy#select on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/enumerator/lazy/take_tags.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
fails:Enumerator::Lazy#take returns a new instance of Enumerator::Lazy
fails:Enumerator::Lazy#take sets given count to size if the given count is less than old size
fails:Enumerator::Lazy#take when the returned lazy enumerator is evaluated by .force stops after specified times
fails:Enumerator::Lazy#take on a nested Lazy sets given count to size if the given count is less than old size
fails:Enumerator::Lazy#take on a nested Lazy when the returned lazy enumerator is evaluated by .force stops after specified times
4 changes: 0 additions & 4 deletions spec/truffle/tags/core/enumerator/lazy/take_while_tags.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
fails:Enumerator::Lazy#take_while returns a new instance of Enumerator::Lazy
fails:Enumerator::Lazy#take_while sets nil to size
fails:Enumerator::Lazy#take_while calls the block with initial values when yield with multiple arguments
fails:Enumerator::Lazy#take_while raises an ArgumentError when not given a block
fails:Enumerator::Lazy#take_while when the returned lazy enumerator is evaluated by .force stops after specified times
fails:Enumerator::Lazy#take_while on a nested Lazy sets nil to size
fails:Enumerator::Lazy#take_while on a nested Lazy when the returned lazy enumerator is evaluated by .force stops after specified times
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/enumerator/lazy/to_enum_tags.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
fails:Enumerator::Lazy#to_enum requires multiple arguments
fails:Enumerator::Lazy#to_enum returns a new instance of Enumerator::Lazy
fails:Enumerator::Lazy#to_enum sets nil to size when not given a block
fails:Enumerator::Lazy#to_enum sets given block to size when given a block
fails:Enumerator::Lazy#to_enum generates a lazy enumerator from the given name
fails:Enumerator::Lazy#to_enum passes given arguments to wrapped method
fails:Enumerator::Lazy#to_enum used by some parent's methods though returning Lazy
5 changes: 0 additions & 5 deletions spec/truffle/tags/core/enumerator/lazy/zip_tags.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
fails:Enumerator::Lazy#zip returns a new instance of Enumerator::Lazy
fails:Enumerator::Lazy#zip keeps size
fails:Enumerator::Lazy#zip calls the block with a gathered array when yield with multiple arguments
fails:Enumerator::Lazy#zip returns a Lazy when no arguments given
fails:Enumerator::Lazy#zip raises a TypeError if arguments contain non-list object
fails:Enumerator::Lazy#zip when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times
fails:Enumerator::Lazy#zip on a nested Lazy keeps size
fails:Enumerator::Lazy#zip on a nested Lazy behaves as Enumerable#zip when given a block
fails:Enumerator::Lazy#zip on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@
import org.jruby.truffle.nodes.control.ReturnNode;
import org.jruby.truffle.nodes.control.WhileNode;
import org.jruby.truffle.nodes.core.*;
import org.jruby.truffle.nodes.dispatch.DispatchHeadNodeFactory;
import org.jruby.truffle.nodes.globals.*;
import org.jruby.truffle.nodes.literal.*;
import org.jruby.truffle.nodes.methods.*;
@@ -55,6 +56,7 @@
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.core.*;
import org.jruby.truffle.runtime.methods.SharedMethodInfo;
import org.jruby.util.ByteList;
import org.jruby.util.KeyValuePair;
import org.jruby.util.cli.Options;

@@ -375,6 +377,8 @@ public RubyNode visitCallNode(CallNode node) {
return translateRubiniusPrivately(sourceSection, node);
} else if (node.getName().equals("single_block_arg")) {
return translateRubiniusSingleBlockArg(sourceSection, node);
} else if (node.getName().equals("check_frozen")) {
return translateRubiniusCheckFrozen(sourceSection);
}
}

@@ -507,6 +511,34 @@ public RubyNode translateRubiniusSingleBlockArg(SourceSection sourceSection, Cal
return new RubiniusSingleBlockArgNode(context, sourceSection);
}

private RubyNode translateRubiniusCheckFrozen(SourceSection sourceSection) {
/*
* Translate
*
* Rubinius.check_frozen
*
* into
*
* raise RuntimeError.new("can't modify frozen ClassName") if frozen?
*
* TODO(CS, 30-Jan-15) usual questions about monkey patching of the methods we're using
*/

final RubyNode frozen = new RubyCallNode(context, sourceSection, "frozen?", new SelfNode(context, sourceSection), null, false);

final RubyNode constructException = new RubyCallNode(context, sourceSection, "new",
new ObjectLiteralNode(context, sourceSection, context.getCoreLibrary().getRuntimeErrorClass()),
null, false,
new StringLiteralNode(context, sourceSection, ByteList.create("can't modify frozen TODO")));

final RubyNode raise = new RubyCallNode(context, sourceSection, "raise", new SelfNode(context, sourceSection), null, false, constructException);

return new IfNode(context, sourceSection,
frozen,
raise,
new NilLiteralNode(context, sourceSection));
}

/**
* See translateDummyAssignment to understand what this is for.
*/