< prev index next >

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

Print this page




 573         Test27Value3 val3 = new Test27Value3(rI);
 574         Test27Value2 val2 = new Test27Value2(val3);
 575         Test27Value1 val1 = new Test27Value1(val2);
 576         int result = test27(val1);
 577         Asserts.assertEQ(result, 8*rI);
 578     }
 579 
 580     static final MyValue1? test28Val = MyValue1.createWithFieldsDontInline(rI, rL);
 581 
 582     @Test
 583     @Warmup(0)
 584     public String test28() {
 585         return test28Val.toString();
 586     }
 587 
 588     @DontCompile
 589     public void test28_verifier(boolean warmup) {
 590         String result = test28();
 591     }
 592 
 593 // TODO enable once JDK-8224110 and JDK-8224211 are fixed
 594 /*
 595     // Test calling a method returning a value type as fields via reflection
 596     MyValue3 test29_vt = MyValue3.create();
 597 
 598     @Test
 599     public MyValue3 test29() {
 600         return test29_vt;
 601     }
 602 
 603     @DontCompile
 604     public void test29_verifier(boolean warmup) throws Exception {
 605         MyValue3 vt = (MyValue3)TestCallingConvention.class.getDeclaredMethod("test29").invoke(this);
 606         test29_vt.verify(vt);
 607     }
 608 
 609     @Test
 610     public MyValue3 test30(MyValue3[] array) {
 611         MyValue3 result = MyValue3.create();
 612         array[0] = result;
 613         return result;
 614     }
 615 
 616     @DontCompile
 617     public void test30_verifier(boolean warmup) throws Exception {
 618         MyValue3[] array = new MyValue3[1];
 619         MyValue3 vt = (MyValue3)TestCallingConvention.class.getDeclaredMethod("test30", MyValue3[].class).invoke(this, array);
 620         array[0].verify(vt);
 621     }
 622 
 623     MyValue3 test31_vt;
 624 
 625     @Test
 626     public MyValue3 test31() {
 627         MyValue3 result = MyValue3.create();
 628         test31_vt = result;
 629         return result;
 630     }
 631 
 632     @DontCompile
 633     public void test31_verifier(boolean warmup) throws Exception {
 634         MyValue3 vt = (MyValue3)TestCallingConvention.class.getDeclaredMethod("test31").invoke(this);
 635         test31_vt.verify(vt);
 636     }
 637 */
 638 
 639     // Test deoptimization at call return with return value in registers. Same as test14, except the interpreted method
 640     // is called via a MethodHandle.
 641     static MethodHandle test32_mh;
 642 
 643     @DontCompile
 644     public MyValue2 test32_interp(boolean deopt) {
 645         if (deopt) {
 646             // uncommon trap
 647             WHITE_BOX.deoptimizeMethod(tests.get(getClass().getSimpleName() + "::test32"));
 648         }
 649         return MyValue2.createWithFieldsInline(rI+32, true);
 650     }
 651 
 652     @Test()
 653     public MyValue2 test32(boolean flag) throws Throwable {
 654         return (MyValue2)test32_mh.invokeExact(this, flag);
 655     }
 656 
 657     @DontCompile




 573         Test27Value3 val3 = new Test27Value3(rI);
 574         Test27Value2 val2 = new Test27Value2(val3);
 575         Test27Value1 val1 = new Test27Value1(val2);
 576         int result = test27(val1);
 577         Asserts.assertEQ(result, 8*rI);
 578     }
 579 
 580     static final MyValue1? test28Val = MyValue1.createWithFieldsDontInline(rI, rL);
 581 
 582     @Test
 583     @Warmup(0)
 584     public String test28() {
 585         return test28Val.toString();
 586     }
 587 
 588     @DontCompile
 589     public void test28_verifier(boolean warmup) {
 590         String result = test28();
 591     }
 592 


 593     // Test calling a method returning a value type as fields via reflection
 594     MyValue3 test29_vt = MyValue3.create();
 595 
 596     @Test
 597     public MyValue3 test29() {
 598         return test29_vt;
 599     }
 600 
 601     @DontCompile
 602     public void test29_verifier(boolean warmup) throws Exception {
 603         MyValue3 vt = (MyValue3)TestCallingConvention.class.getDeclaredMethod("test29").invoke(this);
 604         test29_vt.verify(vt);
 605     }
 606 
 607     @Test
 608     public MyValue3 test30(MyValue3[] array) {
 609         MyValue3 result = MyValue3.create();
 610         array[0] = result;
 611         return result;
 612     }
 613 
 614     @DontCompile
 615     public void test30_verifier(boolean warmup) throws Exception {
 616         MyValue3[] array = new MyValue3[1];
 617         MyValue3 vt = (MyValue3)TestCallingConvention.class.getDeclaredMethod("test30", MyValue3[].class).invoke(this, (Object)array);
 618         array[0].verify(vt);
 619     }
 620 
 621     MyValue3 test31_vt;
 622 
 623     @Test
 624     public MyValue3 test31() {
 625         MyValue3 result = MyValue3.create();
 626         test31_vt = result;
 627         return result;
 628     }
 629 
 630     @DontCompile
 631     public void test31_verifier(boolean warmup) throws Exception {
 632         MyValue3 vt = (MyValue3)TestCallingConvention.class.getDeclaredMethod("test31").invoke(this);
 633         test31_vt.verify(vt);
 634     }

 635 
 636     // Test deoptimization at call return with return value in registers. Same as test14, except the interpreted method
 637     // is called via a MethodHandle.
 638     static MethodHandle test32_mh;
 639 
 640     @DontCompile
 641     public MyValue2 test32_interp(boolean deopt) {
 642         if (deopt) {
 643             // uncommon trap
 644             WHITE_BOX.deoptimizeMethod(tests.get(getClass().getSimpleName() + "::test32"));
 645         }
 646         return MyValue2.createWithFieldsInline(rI+32, true);
 647     }
 648 
 649     @Test()
 650     public MyValue2 test32(boolean flag) throws Throwable {
 651         return (MyValue2)test32_mh.invokeExact(this, flag);
 652     }
 653 
 654     @DontCompile


< prev index next >