7200001 (original) (raw)

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.