United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 7106774 JSR 292: nightly test inlineMHTarget fails with wrong result
7106774 : JSR 292: nightly test inlineMHTarget fails with wrong result

Details
Type:
Bug
Submit Date:
2011-10-31
Status:
Resolved
Updated Date:
2012-03-22
Project Name:
JDK
Resolved Date:
2011-11-30
Component:
hotspot
OS:
generic
Sub-Component:
compiler
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
hs23
Fixed Versions:
hs23

Related Reports
Backport:
Backport:
Relates:

Sub Tasks

Description
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

                                    

Comments
EVALUATION

http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/e342a5110bed
                                     
2012-03-22
EVALUATION

See main CR
                                     
2011-11-30
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-emb/hotspot/rev/e342a5110bed
                                     
2011-11-29
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/e342a5110bed
                                     
2011-11-15
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/e342a5110bed
                                     
2011-11-03
SUGGESTED FIX

Use Bytecode_invoke::is_invokevirtual() and is_invokedynamic() which use Bytecode::java_code().
                                     
2011-11-02
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
                                     
2011-11-02
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
                                     
2011-10-31



Hardware and Software, Engineered to Work Together