45 * compiler.valhalla.valuetypes.TestWithfieldC1 46 */ 47 public class TestWithfieldC1 extends ValueTypeTest { 48 public static final int C1 = COMP_LEVEL_SIMPLE; 49 public static final int C2 = COMP_LEVEL_FULL_OPTIMIZATION; 50 51 public static void main(String[] args) throws Throwable { 52 TestWithfieldC1 test = new TestWithfieldC1(); 53 test.run(args, FooValue.class); 54 } 55 56 @Override 57 public int getNumScenarios() { 58 return 5; 59 } 60 61 @Override 62 public String[] getVMParameters(int scenario) { 63 switch (scenario) { 64 case 0: return new String[] { // C1 only 65 "-XX:+EnableValhallaC1", 66 "-XX:TieredStopAtLevel=1", 67 }; 68 case 1: return new String[] { // C2 only. (Make sure the tests are correctly written) 69 "-XX:-EnableValhallaC1", 70 "-XX:TieredStopAtLevel=4", 71 }; 72 case 2: return new String[] { // interpreter only 73 "-Xint", 74 }; 75 case 3: return new String[] { 76 // Xcomp Only C1. 77 "-XX:+EnableValhallaC1", 78 "-XX:TieredStopAtLevel=1", 79 "-Xcomp", 80 }; 81 case 4: return new String[] { 82 // Xcomp Only C2. 83 "-XX:-EnableValhallaC1", 84 "-XX:TieredStopAtLevel=4", 85 "-Xcomp", 86 }; 87 } 88 return null; 89 } 90 91 static FooValue? foo_static; 92 static FooValue? foo_static_arr[] = new FooValue?[1]; 93 FooValue? foo_instance; 94 95 @DontInline 96 static void set_foo_static_if_null(FooValue v) { 97 if (foo_static == null) { 98 foo_static = v; 99 } 100 } 101 102 static inline class FooValue { 103 public int x = 0, y = 0; 104 | 45 * compiler.valhalla.valuetypes.TestWithfieldC1 46 */ 47 public class TestWithfieldC1 extends ValueTypeTest { 48 public static final int C1 = COMP_LEVEL_SIMPLE; 49 public static final int C2 = COMP_LEVEL_FULL_OPTIMIZATION; 50 51 public static void main(String[] args) throws Throwable { 52 TestWithfieldC1 test = new TestWithfieldC1(); 53 test.run(args, FooValue.class); 54 } 55 56 @Override 57 public int getNumScenarios() { 58 return 5; 59 } 60 61 @Override 62 public String[] getVMParameters(int scenario) { 63 switch (scenario) { 64 case 0: return new String[] { // C1 only 65 "-XX:TieredStopAtLevel=1", 66 "-XX:+TieredCompilation", 67 }; 68 case 1: return new String[] { // C2 only. (Make sure the tests are correctly written) 69 "-XX:TieredStopAtLevel=4", 70 "-XX:-TieredCompilation", 71 }; 72 case 2: return new String[] { // interpreter only 73 "-Xint", 74 }; 75 case 3: return new String[] { 76 // Xcomp Only C1. 77 "-XX:TieredStopAtLevel=1", 78 "-XX:+TieredCompilation", 79 "-Xcomp", 80 }; 81 case 4: return new String[] { 82 // Xcomp Only C2. 83 "-XX:TieredStopAtLevel=4", 84 "-XX:-TieredCompilation", 85 "-Xcomp", 86 }; 87 } 88 return null; 89 } 90 91 static FooValue? foo_static; 92 static FooValue? foo_static_arr[] = new FooValue?[1]; 93 FooValue? foo_instance; 94 95 @DontInline 96 static void set_foo_static_if_null(FooValue v) { 97 if (foo_static == null) { 98 foo_static = v; 99 } 100 } 101 102 static inline class FooValue { 103 public int x = 0, y = 0; 104 |