Skip to content

Instantly share code, notes, and snippets.

enumerator = ArraySpecs.frozen_array.send(:collect!)
lambda { enumerator.each {|x| x } }.should raise_error(RuntimeError)
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project jruby-truffle: Compilation failure: Compilation failure:
[ERROR] /Users/brandonfish/Documents/jruby-mine/truffle/target/generated-sources/org/jruby/truffle/nodes/core/ArrayNodesFactory.java:[12397,68] cannot find symbol
[ERROR] symbol: variable frameValue
[ERROR] location: class org.jruby.truffle.nodes.core.ArrayNodesFactory.PopNodeFactory.PopUninitializedNode
[ERROR] /Users/brandonfish/Documents/jruby-mine/truffle/target/generated-sources/org/jruby/truffle/nodes/core/ArrayNodesFactory.java:[12472,85] cannot find symbol
[ERROR] symbol: variable frameValue
[ERROR] location: class org.jruby.truffle.nodes.core.ArrayNodesFactory.PopNodeFactory.PopObjectUndefinedPlaceholder0Node
[ERROR] /Users/brandonfish/Documents/jruby-mine/truffle/target/generated-sources/org/jruby/truffle/nodes/core/ArrayNodesFactory.java:[12559,85] cannot find symbol
[ERROR] symbol: variable frameValue
[ERROR] location:
diff --git a/truffle/src/main/java/org/jruby/truffle/nodes/core/ArrayNodes.java b/truffle/src/main/java/org/jruby/truffle/nodes/core/ArrayNodes.java
index d731818..1bb9e27 100644
--- a/truffle/src/main/java/org/jruby/truffle/nodes/core/ArrayNodes.java
+++ b/truffle/src/main/java/org/jruby/truffle/nodes/core/ArrayNodes.java
@@ -2427,7 +2427,7 @@ public abstract class ArrayNodes {
}
- @CoreMethod(names = "pop", raiseIfFrozenSelf = true)
+ @CoreMethod(names = "pop", needsSelf = true, raiseIfFrozenSelf = true, optional = 1)
@bjfish
bjfish / gist:454bee203e25491c8377
Created March 27, 2015 23:13
Array#pack error
[truffle] opt fail go:rx.rb:1192 |Reason com.oracle.graal.nodes.util.GraphUtil$2: Frame escapes at: 83305|MethodCallTarget#HotSpotMethod<ArrayNodes$PackNode.pack(VirtualFrame, RubyArray, RubyString)>
properties:{invokeKind=Special, targetMethod=HotSpotMethod<ArrayNodes$PackNode.pack(VirtualFrame, RubyArray, RubyString)>, stamp=void, returnType=HotSpotType<Lorg/jruby/truffle/runtime/core/RubyString;, resolved>}
arguments: [83299|Const(ArrayNodesFactory.PackNodeFactory.PackRubyArrayRubyString2Node@367287701), 83256|NewFrame, 83348|Pi, 83361|Pi]
com.oracle.graal.nodes.util.GraphUtil$2: Frame escapes at: 83305|MethodCallTarget#HotSpotMethod<ArrayNodes$PackNode.pack(VirtualFrame, RubyArray, RubyString)>
properties:{invokeKind=Special, targetMethod=HotSpotMethod<ArrayNodes$PackNode.pack(VirtualFrame, RubyArray, RubyString)>, stamp=void, returnType=HotSpotType<Lorg/jruby/truffle/runtime/core/RubyString;, resolved>}
arguments: [83299|Const(ArrayNodesFactory.PackN
# Running tests:
[1590/6445] TestCoverage#test_result_with_nothing/Users/brandonfish/Documents/jruby/test/mri/coverage/test_coverage.rb:10: warning: tracing (e.g. set_trace_func) will not capture all events without --debug flag
[2150/6445] TestException#test_thread_signal_locationjruby: unknown option --disable-gems -d
[2941/6445] TestIO#test_close_readErrno::EPIPE: Broken pipe - <STDOUT>
write at org/jruby/RubyIO.java:1440
write at org/jruby/RubyIO.java:1411
<top> at -e:1
[3515/6445] TestIterator#test_return_trace_func/Users/brandonfish/Documents/jruby/test/mri/ruby/test_iterator.rb:450: warning: tracing (e.g. set_trace_func) will not capture all events without --debug flag
[3771/6445] TestM17NComb#test_str_include? = 1.31 s
@bjfish
bjfish / gist:ce29048912e55a6f5e86
Created April 2, 2015 14:24
require 'complex'
$ ruby -e 'puts require "complex"'
true
$ bin/jruby -X+T -e 'puts require "complex"'
-e:1:in `require': cannot load such file -- complex (LoadError)
from -e:1:in `<main>'
$ bin/jruby -e 'puts require "complex"'
false
$ rvm rbx do ruby -e 'puts require "complex"'
true
1)
Encoding.default_external with command line options is not changed by the -U option FAILED
Expected "UTF-8"
to equal "US-ASCII"
/Users/brandonfish/Documents/jruby/spec/mspec/lib/mspec/expectations/expectations.rb:15:in `initialize': Expected "UTF-8"
to equal "US-ASCII"
(SpecExpectationNotMetError)
from /Users/brandonfish/Documents/jruby/spec/mspec/lib/mspec/expectations/expectations.rb:15:in `raise'
from /Users/brandonfish/Documents/jruby/spec/mspec/lib/mspec/expectations/expectations.rb:15:in `fail_with'
@bjfish
bjfish / result.patch
Created April 13, 2015 18:44
Workarounds + Fixes to Run MRI test - `./bin/jruby -X+T test/mri/runner.rb -v --color=never --tty=no -q -- test_set.rb`
diff --git a/lib/ruby/stdlib/optparse.rb b/lib/ruby/stdlib/optparse.rb
index 4ec891e..3348145 100644
--- a/lib/ruby/stdlib/optparse.rb
+++ b/lib/ruby/stdlib/optparse.rb
@@ -264,9 +264,17 @@ class OptionParser
end
def self.candidate(key, icase = false, pat = nil, &block)
+ puts "key #{key}"
+ return [[:never, [:never], "never"]] if key == "never"
@bjfish
bjfish / test_workarounds.patch
Created April 14, 2015 13:45
Cleaned up Fixes and Workarounds to run `jt test mri test_set.rb`
diff --git a/lib/ruby/stdlib/optparse.rb b/lib/ruby/stdlib/optparse.rb
index 4ec891e..5a27f8e 100644
--- a/lib/ruby/stdlib/optparse.rb
+++ b/lib/ruby/stdlib/optparse.rb
@@ -264,6 +264,8 @@ class OptionParser
end
def self.candidate(key, icase = false, pat = nil, &block)
+ return [[:never, [:never], "never"]] if key == "never"
+ return [[:no, [:no], "no"]] if key == "no"
echo 'jt test mri ruby/test_alias.rb' && jt test mri ruby/test_alias.rb || echo 'jt test mri ruby/test_array.rb' && jt test mri ruby/test_array.rb || echo 'jt test mri ruby/test_assignment.rb' && jt test mri ruby/test_assignment.rb || echo 'jt test mri ruby/test_autoload.rb' && jt test mri ruby/test_autoload.rb || echo 'jt test mri ruby/test_basicinstructions.rb' && jt test mri ruby/test_basicinstructions.rb || echo 'jt test mri ruby/test_beginendblock.rb' && jt test mri ruby/test_beginendblock.rb || echo 'jt test mri ruby/test_bignum.rb' && jt test mri ruby/test_bignum.rb || echo 'jt test mri ruby/test_call.rb' && jt test mri ruby/test_call.rb || echo 'jt test mri ruby/test_case.rb' && jt test mri ruby/test_case.rb || echo 'jt test mri ruby/test_class.rb' && jt test mri ruby/test_class.rb || echo 'jt test mri ruby/test_clone.rb' && jt test mri ruby/test_clone.rb || echo 'jt test mri ruby/test_comparable.rb' && jt test mri ruby/test_comparable.rb || echo 'jt test mri ruby/test_complex.rb' && jt test mri ruby/