JDK-7106774 : JSR 292: nightly test inlineMHTarget fails with wrong result
Type:Bug
Component:hotspot
Sub-Component:compiler
Affected Version:hs23
Priority:P3
Status:Resolved
Resolution:Fixed
OS:generic
CPU:generic
Submitted:2011-10-31
Updated:2012-03-22
Resolved:2011-11-30
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
The test fails with an error message something like:
# ERROR: Sum computed using MH 1=805306368; Sum computed using MH 2=357472624; using direct calls=805306368
TEST FAILED
EVALUATION
The problem is in code which was added with 7090904 that checks if the call site is a method handle invoke. The new code uses Bytecode::code() and compares the result to Bytecodes values:
if (cur.code() == Bytecodes::_invokedynamic ||
(cur.code() == Bytecodes::_invokevirtual &&
But an invokevirtual can be quickened so that the resulting Bytecode is a different one:
(dbx) n
t@2 (l@2) stopped in Deoptimization::fetch_unroll_info_helper at line 393 in file "deoptimization.cpp"
393 if (cur.code() == Bytecodes::_invokedynamic ||
(dbx) p cur.code()
cur.code() = _fast_invokevfinal
02-11-2011
SUGGESTED FIX
Use Bytecode_invoke::is_invokevirtual() and is_invokedynamic() which use Bytecode::java_code().
02-11-2011
EVALUATION
Limiting compilation to mh_iplusk also triggers the bug:
$ java -server -Xcomp -XX:CompileCommand=compileonly,vm.mlvm.meth.stress.compiler.inlineMHTarget.Test::mh_iplusk -XX:+PrintCompilation -XX:+PrintInlining vm.mlvm.meth.stress.compiler.inlineMHTarget.Test
VM option 'CompileCommand=compileonly,vm.mlvm.meth.stress.compiler.inlineMHTarget.Test::mh_iplusk'
VM option '+PrintCompilation'
VM option '+PrintInlining'
CompilerOracle: compileonly vm/mlvm/meth/stress/compiler/inlineMHTarget/Test.mh_iplusk
678 1 b vm.mlvm.meth.stress.compiler.inlineMHTarget.Test::mh_iplusk (17 bytes)
693 1 size: 180 time: 0 inlined: 14 bytes
694 1 vm.mlvm.meth.stress.compiler.inlineMHTarget.Test::mh_iplusk (17 bytes) made not entrant
713 2 b vm.mlvm.meth.stress.compiler.inlineMHTarget.Test::mh_iplusk (17 bytes)
716 2 size: 932 time: 0 inlined: 2 bytes
# ERROR: Sum computed using MH 1=805306368; Sum computed using MH 2=357472624; using direct calls=805306368
TEST FAILED