8206953: compiler/profiling/TestTypeProfiling.java fails when JVMCI build disabled

Restore original behavior when C2 is used

Reviewed-by: thartmann, mdoerr, dnsimon, gdub
This commit is contained in:
Vladimir Kozlov 2018-07-12 11:57:06 -07:00
parent 0df02a4cb8
commit dbb21a2a92
2 changed files with 5 additions and 12 deletions

View file

@ -2044,7 +2044,7 @@ Deoptimization::update_method_data_from_interpreter(MethodData* trap_mdo, int tr
bool ignore_maybe_prior_recompile; bool ignore_maybe_prior_recompile;
assert(!reason_is_speculate(reason), "reason speculate only used by compiler"); assert(!reason_is_speculate(reason), "reason speculate only used by compiler");
// JVMCI uses the total counts to determine if deoptimizations are happening too frequently -> do not adjust total counts // JVMCI uses the total counts to determine if deoptimizations are happening too frequently -> do not adjust total counts
bool update_total_counts = JVMCI_ONLY(false) NOT_JVMCI(true); bool update_total_counts = true JVMCI_ONLY( && !UseJVMCICompiler);
query_update_method_data(trap_mdo, trap_bci, query_update_method_data(trap_mdo, trap_bci,
(DeoptReason)reason, (DeoptReason)reason,
update_total_counts, update_total_counts,

View file

@ -117,22 +117,15 @@ public class TestTypeProfiling {
} }
// should deoptimize for speculative type check // should deoptimize for speculative type check
// Intepreter will also add actual type check trap information into MDO
// when it throw ClassCastException
if (!deoptimize(method, src_obj)) { if (!deoptimize(method, src_obj)) {
throw new RuntimeException(method.getName() + " is not deoptimized"); throw new RuntimeException(method.getName() + " is not deoptimized");
} }
// compile again // compile again
WHITE_BOX.enqueueMethodForCompilation(method, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); // c2 will generate throw instead of uncommon trap because
if (!WHITE_BOX.isMethodCompiled(method)) { // actual type check trap information is present in MDO
throw new RuntimeException(method.getName() + " is not recompiled");
}
// should deoptimize for actual type check
if (!deoptimize(method, src_obj)) {
throw new RuntimeException(method.getName() + " is not deoptimized (should deoptimize for actual type check)");
}
// compile once again
WHITE_BOX.enqueueMethodForCompilation(method, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); WHITE_BOX.enqueueMethodForCompilation(method, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION);
if (!WHITE_BOX.isMethodCompiled(method)) { if (!WHITE_BOX.isMethodCompiled(method)) {
throw new RuntimeException(method.getName() + " is not recompiled"); throw new RuntimeException(method.getName() + " is not recompiled");