# HG changeset patch # User kvn # Date 1531421826 25200 # Node ID 34696f3aa22b807af4011336f8ece26377d2a179 # Parent 6a037fd949e473dfcfb4f7a41db879d92ba34443 8206953: compiler/profiling/TestTypeProfiling.java fails when JVMCI build disabled Summary: restore original behavior when C2 is used Reviewed-by: thartmann, mdoerr, dnsimon, gdub diff -r 6a037fd949e4 -r 34696f3aa22b src/hotspot/share/runtime/deoptimization.cpp --- a/src/hotspot/share/runtime/deoptimization.cpp Thu Jul 12 11:24:10 2018 -0700 +++ b/src/hotspot/share/runtime/deoptimization.cpp Thu Jul 12 11:57:06 2018 -0700 @@ -2044,7 +2044,7 @@ bool ignore_maybe_prior_recompile; 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 - 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, (DeoptReason)reason, update_total_counts, diff -r 6a037fd949e4 -r 34696f3aa22b test/hotspot/jtreg/compiler/profiling/TestTypeProfiling.java --- a/test/hotspot/jtreg/compiler/profiling/TestTypeProfiling.java Thu Jul 12 11:24:10 2018 -0700 +++ b/test/hotspot/jtreg/compiler/profiling/TestTypeProfiling.java Thu Jul 12 11:57:06 2018 -0700 @@ -117,22 +117,15 @@ } // 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)) { throw new RuntimeException(method.getName() + " is not deoptimized"); } // compile again - WHITE_BOX.enqueueMethodForCompilation(method, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); - if (!WHITE_BOX.isMethodCompiled(method)) { - 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 + // c2 will generate throw instead of uncommon trap because + // actual type check trap information is present in MDO WHITE_BOX.enqueueMethodForCompilation(method, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); if (!WHITE_BOX.isMethodCompiled(method)) { throw new RuntimeException(method.getName() + " is not recompiled");