changeset 54404:688009646429 lworld

8218979: [lworld] TestBasicFunctionality fails due to unexpected number of StoreNodes Reviewed-by: thartmann
author roland
date Wed, 20 Feb 2019 17:14:08 +0100
parents e3f58e81d47f
children 71a79d96adf5
files test/hotspot/jtreg/compiler/valhalla/valuetypes/MyValue1.java test/hotspot/jtreg/compiler/valhalla/valuetypes/MyValue2.java test/hotspot/jtreg/compiler/valhalla/valuetypes/TestBasicFunctionality.java
diffstat 3 files changed, 20 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/test/hotspot/jtreg/compiler/valhalla/valuetypes/MyValue1.java	Fri Feb 22 11:34:38 2019 +0100
+++ b/test/hotspot/jtreg/compiler/valhalla/valuetypes/MyValue1.java	Wed Feb 20 17:14:08 2019 +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;
     }
 
--- a/test/hotspot/jtreg/compiler/valhalla/valuetypes/MyValue2.java	Fri Feb 22 11:34:38 2019 +0100
+++ b/test/hotspot/jtreg/compiler/valhalla/valuetypes/MyValue2.java	Wed Feb 20 17:14:08 2019 +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);
--- a/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestBasicFunctionality.java	Fri Feb 22 11:34:38 2019 +0100
+++ b/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestBasicFunctionality.java	Wed Feb 20 17:14:08 2019 +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);
     }