RFR: 8228622: [lworld] Ineffective codegeneration for flattened arrays checks causes large performance regression on List iteration

Roland Westrelin rwestrel at redhat.com
Mon Sep 23 08:54:27 UTC 2019


Hi Tobias,

> However, the latest webrev requires merging due to JDK-8225653:

Thanks.

> And unfortunately, TestLWorld.test93 fails:
> Caused by: java.lang.RuntimeException: assertTrue: expected true, was false
> 	at jdk.test.lib.Asserts.fail(Asserts.java:594)
> 	at jdk.test.lib.Asserts.assertTrue(Asserts.java:486)
> 	at jdk.test.lib.Asserts.assertTrue(Asserts.java:472)
> 	at compiler.valhalla.valuetypes.TestLWorld.test93_verifier(TestLWorld.java:2300)
> 	... 6 more
>
> Flags are: -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server
> -XX:-TieredCompilation

What about patch below?

Roland.

diff -r 8bc0adf95445 -r ed19694c3145 src/hotspot/share/opto/callnode.cpp
--- a/src/hotspot/share/opto/callnode.cpp	Fri Sep 20 17:19:14 2019 +0200
+++ b/src/hotspot/share/opto/callnode.cpp	Mon Sep 23 10:48:18 2019 +0200
@@ -1237,7 +1237,7 @@
   igvn->register_new_node_with_optimizer(unc);
   
   Node* ctrl = phase->transform(new ProjNode(unc, TypeFunc::Control));
-  Node* halt = phase->transform(new HaltNode(ctrl, alloc->in(TypeFunc::FramePtr)));
+  Node* halt = phase->transform(new HaltNode(ctrl, alloc->in(TypeFunc::FramePtr), "uncommon trap returned which should never happen"));
   phase->C->root()->add_req(halt);
 
   return true;
diff -r 8bc0adf95445 -r ed19694c3145 test/hotspot/jtreg/compiler/valhalla/valuetypes/TestLWorld.java
--- a/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestLWorld.java	Fri Sep 20 17:19:14 2019 +0200
+++ b/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestLWorld.java	Mon Sep 23 10:48:18 2019 +0200
@@ -2250,10 +2250,7 @@
             }
         }
         
-        Object v = array[0];
-        if (v instanceof Integer) {
-        }
-        return v;
+        return (Integer)array[0];
     }
 
     @DontCompile
@@ -2275,9 +2272,7 @@
             }
         }
         
-        Object v = array[0];
-        if (v instanceof Integer) {
-        }
+        Object v = (Integer)array[0];
         return v;
     }
 
@@ -2291,13 +2286,16 @@
         } else {
             Object[] array = new Test92Value[1];
             Method m = tests.get("TestLWorld::test93");
-            int extra = 2;
+            int extra = 3;
             for (int j = 0; j < extra; j++) {
                 for (int i = 0; i < 10; i++) {
-                    test93(array);
+                    try {
+                        test93(array);
+                    } catch (ClassCastException cce) {
+                    }
                 }
                 boolean compiled = isCompiledByC2(m);
-                Asserts.assertTrue(!USE_COMPILER || XCOMP || TEST_C1 || compiled == (j == extra-1));
+                Asserts.assertTrue(compiled || (j != extra-1));
                 if (!compiled) {
                     enqueueMethodForCompilation(m, COMP_LEVEL_FULL_OPTIMIZATION);
                 }



More information about the valhalla-dev mailing list