< prev index next >

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

Print this page




2255         return intf.func1(a, b);
2256     }
2257 
2258     static Intf test106_intfs[] = {
2259         new MyImplVal2(),
2260         new MyImplVal1(),
2261     };
2262 
2263     @DontCompile
2264     public void test106_verifier(boolean warmup) {
2265         int count = warmup ? 1 : 20;
2266         for (int i=0; i<count; i++) {
2267             Intf intf = test106_intfs[i % test106_intfs.length];
2268             int result = test106(intf, 123, 456) + i;
2269             Asserts.assertEQ(result, intf.func1(123, 456) + i);
2270         }
2271     }
2272 
2273     /*** FIXME: disabled due to occassional timeout in mach5 testing. See JDK-8230408
2274 
2275 
2276     // C2->C1 invokeinterface -- C2 calls call Unverified Entry of MyImplVal2X.func1 (compiled by
2277     //                           C1, with VVEP_RO==VVEP)
2278     // This test is developed to validate JDK-8230325.
2279     @Test() @Warmup(0) @OSRCompileOnly
2280     public int test115(Intf intf, int a, int b) {
2281         return intf.func1(a, b);
2282     }
2283 
2284     @ForceCompile
2285     public void test115_verifier(boolean warmup) {
2286         Intf intf1 = new MyImplVal1X();
2287         Intf intf2 = new MyImplVal2X();
2288 
2289         for (int i=0; i<1000; i++) {
2290             test115(intf1, 123, 456);
2291         }
2292         for (int i=0; i<500000; i++) {
2293             // Run enough loops so that test115 will be compiled by C2.
2294             if (i % 30 == 0) {
2295                 // This will indirectly call MyImplVal2X.func1, but the call frequency is low, so
2296                 // test115 will be compiled by C2, but MyImplVal2X.func1 will compiled by C1 only.
2297                 int result = test115(intf2, 123, 456) + i;
2298                 Asserts.assertEQ(result, intf2.func1(123, 456) + i);
2299             } else {
2300                 // Call test115 with a mix of intf1 and intf2, so C2 will use a virtual call (not an optimized call)
2301                 // for the invokeinterface bytecode in test115.
2302                 test115(intf1, 123, 456);
2303             }
2304         }
2305     }
2306 
2307     // Same as test115, except we call MyImplVal2X.func2 (compiled by C1, VVEP_RO != VVEP)
2308     @Test() @Warmup(0) @OSRCompileOnly
2309     public int test116(Intf intf, int a, int b) {
2310         return intf.func2(a, b, pointField);
2311     }
2312 
2313     @ForceCompile
2314     public void test116_verifier(boolean warmup) {
2315         Intf intf1 = new MyImplVal1X();
2316         Intf intf2 = new MyImplVal2X();
2317 
2318         for (int i=0; i<1000; i++) {
2319             test116(intf1, 123, 456);
2320         }
2321         for (int i=0; i<500000; i++) {
2322             // Run enough loops so that test116 will be compiled by C2.
2323             if (i % 30 == 0) {
2324                 // This will indirectly call MyImplVal2X.func2, but the call frequency is low, so
2325                 // test116 will be compiled by C2, but MyImplVal2X.func2 will compiled by C1 only.
2326                 int result = test116(intf2, 123, 456) + i;
2327                 Asserts.assertEQ(result, intf2.func2(123, 456, pointField) + i);
2328             } else {
2329                 // Call test116 with a mix of intf1 and intf2, so C2 will use a virtual call (not an optimized call)
2330                 // for the invokeinterface bytecode in test116.
2331                 test116(intf1, 123, 456);
2332             }
2333         }
2334     }
2335 
2336     // Same as test115, except we call MyImplPojo3.func2 (compiled by C1, VVEP_RO == VEP)
2337     @Test() @Warmup(0) @OSRCompileOnly
2338     public int test117(Intf intf, int a, int b) {
2339         return intf.func2(a, b, pointField);
2340     }
2341 
2342     @ForceCompile
2343     public void test117_verifier(boolean warmup) {
2344         Intf intf1 = new MyImplPojo0();
2345         Intf intf2 = new MyImplPojo3();
2346 
2347         for (int i=0; i<1000; i++) {
2348             test117(intf1, 123, 456);
2349         }
2350         for (int i=0; i<500000; i++) {
2351             // Run enough loops so that test117 will be compiled by C2.
2352             if (i % 30 == 0) {
2353                 // This will indirectly call MyImplPojo3.func2, but the call frequency is low, so
2354                 // test117 will be compiled by C2, but MyImplPojo3.func2 will compiled by C1 only.
2355                 int result = test117(intf2, 123, 456) + i;
2356                 Asserts.assertEQ(result, intf2.func2(123, 456, pointField) + i);
2357             } else {
2358                 // Call test117 with a mix of intf1 and intf2, so C2 will use a virtual call (not an optimized call)
2359                 // for the invokeinterface bytecode in test117.
2360                 test117(intf1, 123, 456);
2361             }
2362         }
2363     }
2364     ---*/
2365 }


2255         return intf.func1(a, b);
2256     }
2257 
2258     static Intf test106_intfs[] = {
2259         new MyImplVal2(),
2260         new MyImplVal1(),
2261     };
2262 
2263     @DontCompile
2264     public void test106_verifier(boolean warmup) {
2265         int count = warmup ? 1 : 20;
2266         for (int i=0; i<count; i++) {
2267             Intf intf = test106_intfs[i % test106_intfs.length];
2268             int result = test106(intf, 123, 456) + i;
2269             Asserts.assertEQ(result, intf.func1(123, 456) + i);
2270         }
2271     }
2272 
2273     /*** FIXME: disabled due to occassional timeout in mach5 testing. See JDK-8230408
2274 

2275     // C2->C1 invokeinterface -- C2 calls call Unverified Entry of MyImplVal2X.func1 (compiled by
2276     //                           C1, with VVEP_RO==VVEP)
2277     // This test is developed to validate JDK-8230325.
2278     @Test() @Warmup(0) @OSRCompileOnly
2279     public int test107(Intf intf, int a, int b) {
2280         return intf.func1(a, b);
2281     }
2282 
2283     @ForceCompile
2284     public void test107_verifier(boolean warmup) {
2285         Intf intf1 = new MyImplVal1X();
2286         Intf intf2 = new MyImplVal2X();
2287 
2288         for (int i=0; i<1000; i++) {
2289             test107(intf1, 123, 456);
2290         }
2291         for (int i=0; i<500000; i++) {
2292             // Run enough loops so that test107 will be compiled by C2.
2293             if (i % 30 == 0) {
2294                 // This will indirectly call MyImplVal2X.func1, but the call frequency is low, so
2295                 // test107 will be compiled by C2, but MyImplVal2X.func1 will compiled by C1 only.
2296                 int result = test107(intf2, 123, 456) + i;
2297                 Asserts.assertEQ(result, intf2.func1(123, 456) + i);
2298             } else {
2299                 // Call test107 with a mix of intf1 and intf2, so C2 will use a virtual call (not an optimized call)
2300                 // for the invokeinterface bytecode in test107.
2301                 test107(intf1, 123, 456);
2302             }
2303         }
2304     }
2305 
2306     // Same as test107, except we call MyImplVal2X.func2 (compiled by C1, VVEP_RO != VVEP)
2307     @Test() @Warmup(0) @OSRCompileOnly
2308     public int test108(Intf intf, int a, int b) {
2309         return intf.func2(a, b, pointField);
2310     }
2311 
2312     @ForceCompile
2313     public void test108_verifier(boolean warmup) {
2314         Intf intf1 = new MyImplVal1X();
2315         Intf intf2 = new MyImplVal2X();
2316 
2317         for (int i=0; i<1000; i++) {
2318             test108(intf1, 123, 456);
2319         }
2320         for (int i=0; i<500000; i++) {
2321             // Run enough loops so that test108 will be compiled by C2.
2322             if (i % 30 == 0) {
2323                 // This will indirectly call MyImplVal2X.func2, but the call frequency is low, so
2324                 // test108 will be compiled by C2, but MyImplVal2X.func2 will compiled by C1 only.
2325                 int result = test108(intf2, 123, 456) + i;
2326                 Asserts.assertEQ(result, intf2.func2(123, 456, pointField) + i);
2327             } else {
2328                 // Call test108 with a mix of intf1 and intf2, so C2 will use a virtual call (not an optimized call)
2329                 // for the invokeinterface bytecode in test108.
2330                 test108(intf1, 123, 456);
2331             }
2332         }
2333     }
2334 
2335     // Same as test115, except we call MyImplPojo3.func2 (compiled by C1, VVEP_RO == VEP)
2336     @Test() @Warmup(0) @OSRCompileOnly
2337     public int test109(Intf intf, int a, int b) {
2338         return intf.func2(a, b, pointField);
2339     }
2340 
2341     @ForceCompile
2342     public void test109_verifier(boolean warmup) {
2343         Intf intf1 = new MyImplPojo0();
2344         Intf intf2 = new MyImplPojo3();
2345 
2346         for (int i=0; i<1000; i++) {
2347             test109(intf1, 123, 456);
2348         }
2349         for (int i=0; i<500000; i++) {
2350             // Run enough loops so that test109 will be compiled by C2.
2351             if (i % 30 == 0) {
2352                 // This will indirectly call MyImplPojo3.func2, but the call frequency is low, so
2353                 // test109 will be compiled by C2, but MyImplPojo3.func2 will compiled by C1 only.
2354                 int result = test109(intf2, 123, 456) + i;
2355                 Asserts.assertEQ(result, intf2.func2(123, 456, pointField) + i);
2356             } else {
2357                 // Call test109 with a mix of intf1 and intf2, so C2 will use a virtual call (not an optimized call)
2358                 // for the invokeinterface bytecode in test109.
2359                 test109(intf1, 123, 456);
2360             }
2361         }
2362     }
2363     ---*/
2364 }
< prev index next >