35 * @run driver ClassFileInstaller sun.hotspot.WhiteBox jdk.test.lib.Platform 36 * @run main/othervm/timeout=300 -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions 37 * -XX:+UnlockExperimentalVMOptions -XX:+WhiteBoxAPI 38 * compiler.valhalla.valuetypes.ValueTypeTest 39 * compiler.valhalla.valuetypes.TestCallingConventionC1 40 */ 41 public class TestCallingConventionC1 extends ValueTypeTest { 42 public static final int C1 = COMP_LEVEL_SIMPLE; 43 public static final int C2 = COMP_LEVEL_FULL_OPTIMIZATION; 44 45 @Override 46 public int getNumScenarios() { 47 return 5; 48 } 49 50 @Override 51 public String[] getVMParameters(int scenario) { 52 switch (scenario) { 53 case 0: return new String[] { 54 // Default: both C1 and C2 are enabled, tiered compilation enabled 55 "-XX:+EnableValhallaC1", 56 "-XX:CICompilerCount=2" 57 }; 58 case 1: return new String[] { 59 // Default: both C1 and C2 are enabled, tiered compilation enabled 60 "-XX:+EnableValhallaC1", 61 "-XX:CICompilerCount=2", 62 "-XX:+StressValueTypeReturnedAsFields" 63 }; 64 case 2: return new String[] { 65 // Same as above, but flip all the compLevel=C1 and compLevel=C2, so we test 66 // the compliment of the above scenario. 67 "-XX:+EnableValhallaC1", 68 "-XX:CICompilerCount=2", 69 "-DFlipC1C2=true" 70 }; 71 case 3: return new String[] { 72 // Only C1. Tiered compilation disabled. 73 "-XX:+EnableValhallaC1", 74 "-XX:TieredStopAtLevel=1", 75 }; 76 case 4: return new String[] { 77 // Only C2. 78 "-XX:-EnableValhallaC1", 79 "-XX:TieredStopAtLevel=4", 80 }; 81 } 82 return null; 83 } 84 85 public static void main(String[] args) throws Throwable { 86 System.gc(); // Resolve this call, to avoid C1 code patching in the test cases. 87 TestCallingConventionC1 test = new TestCallingConventionC1(); 88 test.run(args, 89 Point.class, 90 Functor.class, 91 Functor1.class, 92 Functor2.class, 93 Functor3.class, 94 Functor4.class, 95 MyImplPojo0.class, 96 MyImplPojo1.class, 97 MyImplPojo2.class, 98 MyImplPojo3.class, 99 MyImplVal1.class, | 35 * @run driver ClassFileInstaller sun.hotspot.WhiteBox jdk.test.lib.Platform 36 * @run main/othervm/timeout=300 -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions 37 * -XX:+UnlockExperimentalVMOptions -XX:+WhiteBoxAPI 38 * compiler.valhalla.valuetypes.ValueTypeTest 39 * compiler.valhalla.valuetypes.TestCallingConventionC1 40 */ 41 public class TestCallingConventionC1 extends ValueTypeTest { 42 public static final int C1 = COMP_LEVEL_SIMPLE; 43 public static final int C2 = COMP_LEVEL_FULL_OPTIMIZATION; 44 45 @Override 46 public int getNumScenarios() { 47 return 5; 48 } 49 50 @Override 51 public String[] getVMParameters(int scenario) { 52 switch (scenario) { 53 case 0: return new String[] { 54 // Default: both C1 and C2 are enabled, tiered compilation enabled 55 "-XX:CICompilerCount=2", 56 "-XX:TieredStopAtLevel=4", 57 "-XX:+TieredCompilation", 58 }; 59 case 1: return new String[] { 60 // Default: both C1 and C2 are enabled, tiered compilation enabled 61 "-XX:CICompilerCount=2", 62 "-XX:TieredStopAtLevel=4", 63 "-XX:+TieredCompilation", 64 "-XX:+StressValueTypeReturnedAsFields" 65 }; 66 case 2: return new String[] { 67 // Same as above, but flip all the compLevel=C1 and compLevel=C2, so we test 68 // the compliment of the above scenario. 69 "-XX:CICompilerCount=2", 70 "-XX:TieredStopAtLevel=4", 71 "-XX:+TieredCompilation", 72 "-DFlipC1C2=true" 73 }; 74 case 3: return new String[] { 75 // Only C1. Tiered compilation disabled. 76 "-XX:TieredStopAtLevel=1", 77 "-XX:+TieredCompilation", 78 }; 79 case 4: return new String[] { 80 // Only C2. 81 "-XX:TieredStopAtLevel=4", 82 "-XX:-TieredCompilation", 83 }; 84 } 85 return null; 86 } 87 88 public static void main(String[] args) throws Throwable { 89 System.gc(); // Resolve this call, to avoid C1 code patching in the test cases. 90 TestCallingConventionC1 test = new TestCallingConventionC1(); 91 test.run(args, 92 Point.class, 93 Functor.class, 94 Functor1.class, 95 Functor2.class, 96 Functor3.class, 97 Functor4.class, 98 MyImplPojo0.class, 99 MyImplPojo1.class, 100 MyImplPojo2.class, 101 MyImplPojo3.class, 102 MyImplVal1.class, |