< prev index next >

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

Print this page


1950         }
1951     }
1952 
1953     // C1->C2  - same as test97, except the callee is a static method.
1954     @Test(compLevel = C1)
1955     public static int test99(Point p1, Point p2) {
1956         return test99_helper(p1, p2);
1957     }
1958 
1959     @DontInline @DontCompile
1960     public static int test99_helper(Point p1, Point p2) {
1961         return p1.x + p1.y + p2.x + p2.y;
1962     }
1963 
1964     @ForceCompile(compLevel = C1)
1965     public void test99_verifier(boolean warmup) {
1966         int count = warmup ? 1 : 20;
1967         for (int i=0; i<count; i++) {
1968             int result = test99(pointField1, pointField2);
1969             int n = test99_helper(pointField1, pointField2);


















































1970             Asserts.assertEQ(result, n);
1971         }
1972     }
1973 }


1950         }
1951     }
1952 
1953     // C1->C2  - same as test97, except the callee is a static method.
1954     @Test(compLevel = C1)
1955     public static int test99(Point p1, Point p2) {
1956         return test99_helper(p1, p2);
1957     }
1958 
1959     @DontInline @DontCompile
1960     public static int test99_helper(Point p1, Point p2) {
1961         return p1.x + p1.y + p2.x + p2.y;
1962     }
1963 
1964     @ForceCompile(compLevel = C1)
1965     public void test99_verifier(boolean warmup) {
1966         int count = warmup ? 1 : 20;
1967         for (int i=0; i<count; i++) {
1968             int result = test99(pointField1, pointField2);
1969             int n = test99_helper(pointField1, pointField2);
1970             Asserts.assertEQ(result, n);
1971         }
1972     }
1973 
1974 
1975     // C2->C1 invokestatic, packing causes stack growth (1 extra stack word).
1976     // Make sure stack frame is set up properly for GC.
1977     @Test(compLevel = C2)
1978     public float test100(FloatPoint fp1, FloatPoint fp2, RefPoint rp, int a1, int a2, int a3, int a4) {
1979         return test100_helper(fp1, fp2, rp, a1, a2, a3, a4);
1980     }
1981 
1982     @DontInline
1983     @ForceCompile(compLevel = C1)
1984     private static float test100_helper(FloatPoint fp1, FloatPoint fp2, RefPoint rp, int a1, int a2, int a3, int a4) {
1985         // On x64:
1986         //    Scalarized entry -- all parameters are passed in registers
1987         //          xmm0 = fp1.x
1988         //          xmm1 = fp1.y
1989         //          xmm2 = fp2.x
1990         //          xmm3 = fp2.y
1991         //          rsi  = rp.x  (oop)
1992         //          rdx  = rp.y  (oop)
1993         //          cx   = a1
1994         //          r8   = a2
1995         //          r9   = a3
1996         //          di   = a4
1997         //    Non-scalarized entry -- a6 is passed on stack[0]
1998         //          rsi  = fp1
1999         //          rdx  = fp2
2000         //          rcx  = rp
2001         //          r8   = a1
2002         //          r9   = a2
2003         //          di   = a3
2004         //    [sp + ??]  = a4
2005         return fp1.x + fp1.y + fp2.x + fp2.y + rp.x.n + rp.y.n + a1 + a2 + a3 + a4;
2006     }
2007 
2008     @DontCompile
2009     public void test100_verifier(boolean warmup) {
2010         int count = warmup ? 1 : 4;
2011         for (int i=0; i<count; i++) {
2012             FloatPoint fp1 = new FloatPoint(i+0,  i+11);
2013             FloatPoint fp2 = new FloatPoint(i+222, i+3333);
2014             RefPoint rp = new RefPoint(i+44444, i+555555);
2015             float result;
2016             try (ForceGCMarker m = ForceGCMarker.mark(warmup)) {
2017                 result = test100(fp1, fp2, rp, 1, 2, 3, 4);
2018             }
2019             float n = test100_helper(fp1, fp2, rp, 1, 2, 3, 4);
2020             Asserts.assertEQ(result, n);
2021         }
2022     }
2023 }
< prev index next >