1446 int result = test76(rp1, rp2); 1447 int n = rp1.final_func(rp2); 1448 Asserts.assertEQ(result, n); 1449 } 1450 } 1451 1452 // C2->C1 invokevirtual, force GC for every allocation when entering a C1 VEP (RefPoint) 1453 // Same as test56, except we call the VVEP(RO) instead of VEP. 1454 @Test(compLevel = C2) 1455 public int test77(RefPoint rp1, RefPoint rp2) { 1456 return rp1.final_func(rp2); 1457 } 1458 1459 @DontCompile 1460 public void test77_verifier(boolean warmup) { 1461 int count = warmup ? 1 : 5; 1462 for (int i=0; i<count; i++) { // need a loop to test inline cache 1463 RefPoint rp1 = new RefPoint(1, 2); 1464 RefPoint rp2 = new RefPoint(22, 33); 1465 int result; 1466 if (!warmup) { 1467 System.out.println("Hello: " + i); 1468 } 1469 try (ForceGCMarker m = ForceGCMarker.mark(warmup)) { 1470 result = test77(rp1, rp2); 1471 } 1472 int n = rp1.final_func(rp2); 1473 Asserts.assertEQ(result, n); 1474 } 1475 } 1476 1477 //------------------------------------------------------------------------------- 1478 // Tests for how C1 handles ValueTypeReturnedAsFields in both calls and returns 1479 //------------------------------------------------------------------------------- 1480 // C2->C1 invokestatic with ValueTypeReturnedAsFields (Point) 1481 @Test(compLevel = C2) 1482 public int test78(Point p) { 1483 Point np = test78_helper(p); 1484 return np.x + np.y; 1485 } 1486 1487 @DontInline 1488 @ForceCompile(compLevel = C1) | 1446 int result = test76(rp1, rp2); 1447 int n = rp1.final_func(rp2); 1448 Asserts.assertEQ(result, n); 1449 } 1450 } 1451 1452 // C2->C1 invokevirtual, force GC for every allocation when entering a C1 VEP (RefPoint) 1453 // Same as test56, except we call the VVEP(RO) instead of VEP. 1454 @Test(compLevel = C2) 1455 public int test77(RefPoint rp1, RefPoint rp2) { 1456 return rp1.final_func(rp2); 1457 } 1458 1459 @DontCompile 1460 public void test77_verifier(boolean warmup) { 1461 int count = warmup ? 1 : 5; 1462 for (int i=0; i<count; i++) { // need a loop to test inline cache 1463 RefPoint rp1 = new RefPoint(1, 2); 1464 RefPoint rp2 = new RefPoint(22, 33); 1465 int result; 1466 try (ForceGCMarker m = ForceGCMarker.mark(warmup)) { 1467 result = test77(rp1, rp2); 1468 } 1469 int n = rp1.final_func(rp2); 1470 Asserts.assertEQ(result, n); 1471 } 1472 } 1473 1474 //------------------------------------------------------------------------------- 1475 // Tests for how C1 handles ValueTypeReturnedAsFields in both calls and returns 1476 //------------------------------------------------------------------------------- 1477 // C2->C1 invokestatic with ValueTypeReturnedAsFields (Point) 1478 @Test(compLevel = C2) 1479 public int test78(Point p) { 1480 Point np = test78_helper(p); 1481 return np.x + np.y; 1482 } 1483 1484 @DontInline 1485 @ForceCompile(compLevel = C1) |