< prev index next >

test/hotspot/jtreg/compiler/valhalla/valuetypes/TestCallingConvention.java

Print this page




  27 
  28 import java.lang.reflect.Method;
  29 
  30 /*
  31  * @test
  32  * @summary Test value type calling convention optimizations
  33  * @library /testlibrary /test/lib /compiler/whitebox /
  34  * @requires os.simpleArch == "x64"
  35  * @compile -XDenableValueTypes -XDallowWithFieldOperator -XDallowFlattenabilityModifiers TestCallingConvention.java
  36  * @run driver ClassFileInstaller sun.hotspot.WhiteBox jdk.test.lib.Platform
  37  * @run main/othervm/timeout=120 -Xbootclasspath/a:. -ea -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
  38  *                               -XX:+UnlockExperimentalVMOptions -XX:+WhiteBoxAPI -XX:+EnableValhalla
  39  *                               compiler.valhalla.valuetypes.ValueTypeTest
  40  *                               compiler.valhalla.valuetypes.TestCallingConvention
  41  */
  42 public class TestCallingConvention extends ValueTypeTest {
  43     // Extra VM parameters for some test scenarios. See ValueTypeTest.getVMParameters()
  44     @Override
  45     public String[] getExtraVMParameters(int scenario) {
  46         switch (scenario) {
  47         case 1: return new String[] {"-XX:ValueTypesBufferMaxMemory=0"};
  48         case 3: return new String[] {"-XX:-ValueArrayFlatten"};
  49         }
  50         return null;
  51     }
  52 
  53    public static void main(String[] args) throws Throwable {
  54        TestCallingConvention test = new TestCallingConvention();
  55        test.run(args, MyValue1.class, MyValue2.class, MyValue2Inline.class, MyValue4.class);
  56    }
  57 
  58    // Test interpreter to compiled code with various signatures
  59    @Test(failOn = ALLOC + STORE + TRAP)
  60    public long test1(MyValue2 v) {
  61        return v.hash();
  62    }
  63 
  64    @DontCompile
  65    public void test1_verifier(boolean warmup) {
  66        MyValue2 v = MyValue2.createWithFieldsInline(rI, true);
  67        long result = test1(v);




  27 
  28 import java.lang.reflect.Method;
  29 
  30 /*
  31  * @test
  32  * @summary Test value type calling convention optimizations
  33  * @library /testlibrary /test/lib /compiler/whitebox /
  34  * @requires os.simpleArch == "x64"
  35  * @compile -XDenableValueTypes -XDallowWithFieldOperator -XDallowFlattenabilityModifiers TestCallingConvention.java
  36  * @run driver ClassFileInstaller sun.hotspot.WhiteBox jdk.test.lib.Platform
  37  * @run main/othervm/timeout=120 -Xbootclasspath/a:. -ea -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
  38  *                               -XX:+UnlockExperimentalVMOptions -XX:+WhiteBoxAPI -XX:+EnableValhalla
  39  *                               compiler.valhalla.valuetypes.ValueTypeTest
  40  *                               compiler.valhalla.valuetypes.TestCallingConvention
  41  */
  42 public class TestCallingConvention extends ValueTypeTest {
  43     // Extra VM parameters for some test scenarios. See ValueTypeTest.getVMParameters()
  44     @Override
  45     public String[] getExtraVMParameters(int scenario) {
  46         switch (scenario) {

  47         case 3: return new String[] {"-XX:-ValueArrayFlatten"};
  48         }
  49         return null;
  50     }
  51 
  52    public static void main(String[] args) throws Throwable {
  53        TestCallingConvention test = new TestCallingConvention();
  54        test.run(args, MyValue1.class, MyValue2.class, MyValue2Inline.class, MyValue4.class);
  55    }
  56 
  57    // Test interpreter to compiled code with various signatures
  58    @Test(failOn = ALLOC + STORE + TRAP)
  59    public long test1(MyValue2 v) {
  60        return v.hash();
  61    }
  62 
  63    @DontCompile
  64    public void test1_verifier(boolean warmup) {
  65        MyValue2 v = MyValue2.createWithFieldsInline(rI, true);
  66        long result = test1(v);


< prev index next >