The problem here seems to be that when a block is jitted, it's not framing itself or rooting the eval properly. I have not investigated further than that, but obviously the eval'ed def initialize is going into the surrounding class X rather than into the Class.new that launched the block.
This breaks TestMarshal because of test_marshal.rb:263-266.
This initialize becomes TestMarshal's initialize, As a result, the name of the test passed into TestMarshal.new (as part of test suite initialization) never reaches the TestCase superclass, and the __name__ remains nil. That's the source of the errors we see in the test run:
[1/1] TestMarshal#test_symbol2 = 0.17 s
1) Error:
TestMarshal#:
TypeError: no implicit conversion of nil into String
/Users/headius/projects/jruby/test/mri/lib/test/unit/testcase.rb:17:in `run'
org/jruby/RubyArray.java:2300:in `map'
/Users/headius/projects/jruby/test/mri/lib/test/unit.rb:682:in `block in _run_suites'
org/jruby/RubyArray.java:1560:in `each'
/Users/headius/projects/jruby/test/mri/lib/test/unit.rb:680:in `_run_suites'
org/jruby/RubyArray.java:1560:in `each'
/Users/headius/projects/jruby/test/mri/lib/test/unit.rb:31:in `run'
/Users/headius/projects/jruby/test/mri/lib/test/unit.rb:799:in `run'
/Users/headius/projects/jruby/test/mri/lib/test/unit.rb:859:in `run'
/Users/headius/projects/jruby/test/mri/lib/test/unit.rb:863:in `run'
test/mri/runner.rb:41:in `<top>'
Note that the method name in the error report is missing.
The problem was that the evalType threadlocal in *IRBlockBody was getting out of sync, due to having MixedModeIRBlockBody wrap a CompiledIRBlockBody. As a result, when CompiledIRBlockBody ran, it did not see that e.g. Class.new had set MixedModeIRBlockBody as an eval'ed block, and as a result the search for method target failed to stop at the Class.new block.
The fix in e9d5c94 shares a single evalType threadlocal between both the container MixedModeIRBlockBody and the contained CompiledIRBlockBody.
There's remaining work needed to clean up all this shared state and do a better job of unifying the different container objects for interpreted and jitted blocks and methods.
This is the cause of the current TestMarshal failures.
Reduced case follows.
blah.rb:
Command line and bug (:there should be :here):
The problem here seems to be that when a block is jitted, it's not framing itself or rooting the eval properly. I have not investigated further than that, but obviously the eval'ed
def initialize
is going into the surroundingclass X
rather than into theClass.new
that launched the block.This breaks TestMarshal because of test_marshal.rb:263-266.
This initialize becomes TestMarshal's initialize, As a result, the name of the test passed into TestMarshal.new (as part of test suite initialization) never reaches the TestCase superclass, and the
__name__
remains nil. That's the source of the errors we see in the test run:Note that the method name in the error report is missing.
cc @enebo
The text was updated successfully, but these errors were encountered: