@@ -271,7 +271,7 @@ private void addBaseTests() {
271
271
BaseTest baseTest = new BaseTest (test , shouldExcludeTest (m .getName ()));
272
272
allTests .add (baseTest );
273
273
if (PRINT_VALID_IR_RULES ) {
274
- irMatchRulePrinter .emitRuleEncoding (m , baseTest .isSkipped ());
274
+ irMatchRulePrinter .emitRuleEncoding (m , baseTest .isSkipped ());
275
275
}
276
276
} catch (TestFormatException e ) {
277
277
// Failure logged. Continue and report later.
@@ -452,19 +452,20 @@ private void dontCompileWithCompiler(Executable ex, Compiler compiler) {
452
452
private void applyForceCompileCommand (Executable ex ) {
453
453
ForceCompile forceCompileAnno = getAnnotation (ex , ForceCompile .class );
454
454
if (forceCompileAnno != null ) {
455
- CompLevel complevel = forceCompileAnno .value ();
456
- TestFormat .check (complevel != CompLevel .SKIP && complevel != CompLevel .WAIT_FOR_COMPILATION ,
455
+ CompLevel compLevel = forceCompileAnno .value ();
456
+ TestFormat .check (compLevel != CompLevel .SKIP && compLevel != CompLevel .WAIT_FOR_COMPILATION ,
457
457
"Cannot define compilation level SKIP or WAIT_FOR_COMPILATION in @ForceCompile at " + ex );
458
- complevel = restrictCompLevel (forceCompileAnno .value ());
458
+ compLevel = restrictCompLevel (forceCompileAnno .value ());
459
459
if (FLIP_C1_C2 ) {
460
- complevel = complevel .flipCompLevel ();
460
+ compLevel = compLevel .flipCompLevel ();
461
+ compLevel = restrictCompLevel (compLevel .flipCompLevel ());
461
462
}
462
463
if (EXCLUDE_RANDOM ) {
463
- complevel = complevel .excludeCompilationRandomly (ex );
464
+ compLevel = compLevel .excludeCompilationRandomly (ex );
464
465
}
465
- if (complevel != CompLevel .SKIP ) {
466
- enqueueForCompilation (ex , complevel );
467
- forceCompileMap .put (ex , complevel );
466
+ if (compLevel != CompLevel .SKIP ) {
467
+ enqueueForCompilation (ex , compLevel );
468
+ forceCompileMap .put (ex , compLevel );
468
469
}
469
470
}
470
471
}
@@ -494,7 +495,7 @@ private void setupDeclaredTests() {
494
495
} else {
495
496
TestFormat .checkNoThrow (!m .isAnnotationPresent (IR .class ), "Found @IR annotation on non-@Test method " + m );
496
497
TestFormat .checkNoThrow (!m .isAnnotationPresent (Warmup .class ) || getAnnotation (m , Run .class ) != null ,
497
- "Found @Warmup annotation on non-@Test or non-@Run method " + m );
498
+ "Found @Warmup annotation on non-@Test or non-@Run method " + m );
498
499
}
499
500
} catch (TestFormatException e ) {
500
501
// Failure logged. Continue and report later.
@@ -520,6 +521,7 @@ private void addDeclaredTest(Method m) {
520
521
CompLevel compLevel = restrictCompLevel (testAnno .compLevel ());
521
522
if (FLIP_C1_C2 ) {
522
523
compLevel = compLevel .flipCompLevel ();
524
+ compLevel = restrictCompLevel (compLevel .flipCompLevel ());
523
525
}
524
526
if (EXCLUDE_RANDOM ) {
525
527
compLevel = compLevel .excludeCompilationRandomly (m );
@@ -711,8 +713,8 @@ private void checkCustomRunTest(Method m, String testName, Method testMethod, De
711
713
"Cannot use @Arguments at test method " + testMethod + " in combination with @Run method " + m );
712
714
Warmup warmupAnno = getAnnotation (testMethod , Warmup .class );
713
715
TestFormat .checkNoThrow (warmupAnno == null ,
714
- "Cannot set @Warmup at @Test method " + testMethod + " when used with its @Run method "
715
- + m + ". Use @Warmup at @Run method instead." );
716
+ "Cannot set @Warmup at @Test method " + testMethod + " when used with its @Run method "
717
+ + m + ". Use @Warmup at @Run method instead." );
716
718
Test testAnno = getAnnotation (testMethod , Test .class );
717
719
TestFormat .checkNoThrow (runMode != RunMode .STANDALONE || testAnno .compLevel () == CompLevel .ANY ,
718
720
"Setting explicit compilation level for @Test method " + testMethod + " has no effect "
@@ -848,7 +850,7 @@ enum TriState {
848
850
849
851
public static void compile (Method m , CompLevel compLevel ) {
850
852
TestRun .check (compLevel != CompLevel .SKIP && compLevel != CompLevel .WAIT_FOR_COMPILATION ,
851
- "Invalid compilation request with level " + compLevel );
853
+ "Invalid compilation request with level " + compLevel );
852
854
enqueueForCompilation (m , compLevel );
853
855
}
854
856
@@ -891,7 +893,7 @@ public static void assertDeoptimizedByC2(Method m) {
891
893
*/
892
894
private static boolean notUnstableDeoptAssertion (Method m , CompLevel level ) {
893
895
return (USE_COMPILER && !XCOMP && !IGNORE_COMPILER_CONTROLS && !TEST_C1 &&
894
- (!EXCLUDE_RANDOM || WHITE_BOX .isMethodCompilable (m , level .getValue (), false )));
896
+ (!EXCLUDE_RANDOM || WHITE_BOX .isMethodCompilable (m , level .getValue (), false )));
895
897
}
896
898
897
899
public static void assertCompiledByC1 (Method m ) {
@@ -946,7 +948,7 @@ private static TriState compiledAtLevel(Method m, CompLevel level) {
946
948
default -> throw new TestRunException ("compiledAtLevel() should not be called with " + level );
947
949
}
948
950
}
949
- if (!USE_COMPILER || XCOMP || TEST_C1 || IGNORE_COMPILER_CONTROLS ||
951
+ if (!USE_COMPILER || XCOMP || TEST_C1 || IGNORE_COMPILER_CONTROLS || FLIP_C1_C2 ||
950
952
(EXCLUDE_RANDOM && !WHITE_BOX .isMethodCompilable (m , level .getValue (), false ))) {
951
953
return TriState .Maybe ;
952
954
}
0 commit comments