United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7200949 JSR 292: rubybench/bench/time/bench_base64.rb fails with jruby.jar not on boot class path
JDK-7200949 : JSR 292: rubybench/bench/time/bench_base64.rb fails with jruby.jar not on boot class path

Details
Type:
Bug
Submit Date:
2012-09-25
Status:
Resolved
Updated Date:
2013-09-04
Project Name:
JDK
Resolved Date:
2012-10-01
Component:
hotspot
OS:
generic
Sub-Component:
compiler
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
hs23
Fixed Versions:
hs25 (b04)

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:
Relates:

Sub Tasks

Description
The problem is in the declared signature returned by ciBytecodeStream::get_method which was added with 7192406.

We create a ciSignature object with the constant pool holder as accessing class.  ciEnv::get_klass_by_name_impl doesn't delegate to its parent class loaders and we can't call SystemDictionary::resolve_or_null because we are in the compiler thread.  Thus all lookups happen in the class loader of the accessing class.

This leads to supposedly unloaded classes like org/jruby/RubyString or even java/lang/Object.

                                    

Comments
EVALUATION

The fix is to store the MethodType in the constant pool cache and using that type information instead of the declared method signature to create a ciSignature.
                                     
2012-09-25
http://cr.openjdk.java.net/~twisti/7200949
                                     
2012-09-27
URL:   http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/f6b0eb4e44cf
User:  twisti
Date:  2012-10-01 23:43:26 +0000

                                     
2012-10-01
URL:   http://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/f6b0eb4e44cf
User:  amurillo
Date:  2012-10-05 22:35:18 +0000

                                     
2012-10-05
Running JRuby's bench_base64.rb results in a lot of deoptimizations:

$ export JAVA_HOME=/java/re/jdk/8/promoted/all/b52/binaries/solaris-x64
$ jruby -J-XX:-TieredCompilation -J-XX:+PrintCompilation ../rubybench/bench/time/bench_base64.rb 10
...
   6949  970             rubyjit.Base64$$decode64_856A11D3C68BA144BEA1408BDA78DA91A5C77E4217792713::__file__ (26 bytes)
   6951  969             rubyjit.Base64$$decode64_856A11D3C68BA144BEA1408BDA78DA91A5C77E4217792713::__file__ (10 bytes)   made not entrant
   6951   92 %           org.jruby.RubyFixnum::times @ 68 (110 bytes)
   6951  970             rubyjit.Base64$$decode64_856A11D3C68BA144BEA1408BDA78DA91A5C77E4217792713::__file__ (26 bytes)   made not entrant
   6984   92 %           org.jruby.RubyFixnum::times @ -2 (110 bytes)   made not entrant
...
                                     
2012-11-03



Hardware and Software, Engineered to Work Together