From cd6caedd0a3c9ebd4c8c57e64f62b60161c5cd7c Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 1 Jul 2025 07:58:12 +0000 Subject: [PATCH] 8360783: CTW: Skip deoptimization between tiers Reviewed-by: thartmann, mhaessig, dfenacci --- .../ctw/src/sun/hotspot/tools/ctw/Compiler.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java b/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java index b8f2919e594..487d2e304d9 100644 --- a/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java +++ b/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java @@ -170,17 +170,22 @@ public class Compiler { @Override public final void run() { + // Make sure method is not compiled at any level before starting + // progressive compilations. No deopt in-between tiers is needed, + // as long as we increase the compilation levels one by one. + WHITE_BOX.deoptimizeMethod(method); + int compLevel = Utils.INITIAL_COMP_LEVEL; if (Utils.TIERED_COMPILATION) { for (int i = compLevel; i <= Utils.TIERED_STOP_AT_LEVEL; ++i) { - WHITE_BOX.deoptimizeMethod(method); compileAtLevel(i); } } else { compileAtLevel(compLevel); } - // Make the method eligible for sweeping sooner + // Ditch all the compiled versions of the code, make the method + // eligible for sweeping sooner. WHITE_BOX.deoptimizeMethod(method); }