--- old/test/hotspot/jtreg/compiler/valhalla/valuetypes/MyValue1.java 2019-02-20 18:12:40.000000000 +0100 +++ new/test/hotspot/jtreg/compiler/valhalla/valuetypes/MyValue1.java 2019-02-20 18:12:35.000000000 +0100 @@ -72,9 +72,9 @@ v = setO(v, new Integer(x)); int[] oa = {x}; v = setOA(v, oa); - v = setV1(v, MyValue2.createWithFieldsInline(x, true)); - v = setV2(v, MyValue2.createWithFieldsInline(x, false)); - v = setC(v, ValueTypeTest.rI); + v = setV1(v, MyValue2.createWithFieldsInline(x, y, true)); + v = setV2(v, MyValue2.createWithFieldsInline(x, y, false)); + v = setC(v, (int)(x+y)); return v; } --- old/test/hotspot/jtreg/compiler/valhalla/valuetypes/MyValue2.java 2019-02-20 18:12:45.000000000 +0100 +++ new/test/hotspot/jtreg/compiler/valhalla/valuetypes/MyValue2.java 2019-02-20 18:12:40.000000000 +0100 @@ -75,6 +75,15 @@ } @ForceInline + public static MyValue2 createWithFieldsInline(int x, long y, boolean b) { + MyValue2 v = createDefaultInline(); + v = setX(v, x); + v = setY(v, (byte)x); + v = setV1(v, MyValue2Inline.createWithFieldsInline(b, y)); + return v; + } + + @ForceInline public static MyValue2 createWithFieldsInline(int x, boolean b) { MyValue2 v = createDefaultInline(); v = setX(v, x); @@ -82,7 +91,7 @@ v = setV1(v, MyValue2Inline.createWithFieldsInline(b, ValueTypeTest.rL)); return v; } - + @DontInline public static MyValue2 createWithFieldsDontInline(int x, boolean b) { MyValue2 v = createDefaultInline(); --- old/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestBasicFunctionality.java 2019-02-20 18:12:51.000000000 +0100 +++ new/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestBasicFunctionality.java 2019-02-20 18:12:46.000000000 +0100 @@ -185,12 +185,15 @@ // Merge value types created from two branches @Test(valid = ValueTypePassFieldsAsArgsOn, match = {LOAD}, matchCount = {12}, failOn = TRAP + ALLOC + STORE) - @Test(valid = ValueTypePassFieldsAsArgsOff, match = {ALLOC, STORE}, matchCount = {1, 5}, failOn = LOAD + TRAP) - public MyValue1 test9(boolean b) { + @Test(valid = ValueTypePassFieldsAsArgsOff, match = {ALLOC, STORE}, matchCount = {1, 12}, failOn = LOAD + TRAP) + public MyValue1 test9(boolean b, int localrI, long localrL) { MyValue1 v; if (b) { // Value type is not allocated - v = MyValue1.createWithFieldsInline(rI, rL); + // Do not use rI/rL directly here as null values may cause + // some redundant null initializations to be optimized out + // and matching to fail. + v = MyValue1.createWithFieldsInline(localrI, localrL); } else { // Value type is allocated by the callee v = MyValue1.createWithFieldsDontInline(rI + 1, rL + 1); @@ -208,10 +211,10 @@ @DontCompile public void test9_verifier(boolean warmup) { - MyValue1 v = test9(true); + MyValue1 v = test9(true, rI, rL); Asserts.assertEQ(v.x, rI); Asserts.assertEQ(v.y, hash()); - v = test9(false); + v = test9(false, rI, rL); Asserts.assertEQ(v.x, rI); Asserts.assertEQ(v.y, hash(rI + 1, rL + 1) + 1); }