RFR: 8228622: [lworld] Ineffective codegeneration for flattened arrays checks causes large performance regression on List iteration
Tobias Hartmann
tobias.hartmann at oracle.com
Tue Sep 24 05:20:06 UTC 2019
Hi Roland,
all tests passed!
Thanks,
Tobias
On 23.09.19 14:57, Roland Westrelin wrote:
>
>> Now fails with -XX:TieredStopAtLevel=1:
>> 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:2298)
>> ... 6 more
>
> Thanks for running tests. Another try, see below...
>
> Roland.
>
> diff -r 8bc0adf95445 -r e989f1bfd6a4 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 e989f1bfd6a4 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(!USE_COMPILER || XCOMP || TEST_C1 || compiled || (j != extra-1));
> if (!compiled) {
> enqueueMethodForCompilation(m, COMP_LEVEL_FULL_OPTIMIZATION);
> }
>
More information about the valhalla-dev
mailing list