RFR (M): 7200001: failed C1 OSR compile doesn't get recompiled with C2

Christian Thalinger christian.thalinger at oracle.com
Fri Sep 21 15:06:12 PDT 2012


http://cr.openjdk.java.net/~twisti/7200001

7200001: failed C1 OSR compile doesn't get recompiled with C2
Reviewed-by:

When a C1 OSR compile bails out we don't recompile the method in C2 which 
it should:

   3661    3 %     3       com.oracle.nashorn.scripts.Script$mult::bench @ 21 (143 bytes)   COMPILE SKIPPED: unlinked call site (FIXME needs patching or recompile support) (retry at different tier)

The problem is that we only have one flag that indicates a method is not OSR
compilable:

  JVM_ACC_NOT_OSR_COMPILABLE      = 0x08000000,

Unlike for normal compiles where we have a flag for each compiler:

  JVM_ACC_NOT_C2_COMPILABLE       = 0x02000000,
  JVM_ACC_NOT_C1_COMPILABLE       = 0x04000000,

The fix is to set not-OSR-compilable for the current compile level and not 
any level.  

Since this problem occurs very rarely as C1 usually can compile all methods
we set a method not-C1-compilable when it's not-C1-OSR-compilable:

  void set_not_c1_osr_compilable() { set_not_c1_compilable(); }

and wait for C2 to compile it.

If this shows a problem in the future we can sacrifice another bit in the 
flags.

src/share/vm/compiler/compileBroker.cpp
src/share/vm/compiler/compileBroker.hpp
src/share/vm/compiler/compileLog.cpp
src/share/vm/oops/method.cpp
src/share/vm/oops/method.hpp
src/share/vm/runtime/advancedThresholdPolicy.cpp
src/share/vm/runtime/compilationPolicy.cpp
src/share/vm/runtime/simpleThresholdPolicy.cpp
src/share/vm/runtime/vmStructs.cpp
src/share/vm/utilities/accessFlags.hpp



More information about the hotspot-compiler-dev mailing list