[lworld] RFR: 8354068: [lworld] Fold strict final fields more aggressively

Tobias Hartmann thartmann at openjdk.org
Wed Apr 9 13:20:39 UTC 2025


On Wed, 9 Apr 2025 06:35:15 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> Hi,
>> 
>> When we do incremental inlining, we need to be more aggressive to ensure that value objects are not unexpectedly materialized. This is done by trying to fold loads from strict final fields in an aggressive manner.
>> 
>> Please take a look and leave your reviews, thanks a lot.
>
> Note that the objects are still not scalarized due to a bug. When we try to decide if the return will unnecessarily keep the oop of an `InlineTypeNode` alive, we fail to consider the case that some outputs of the oop are memory barriers.

Thanks for working on this @merykitty. I haven't looked at the changes in detail yet but I see some failures in testing.


compiler/valhalla/inlinetypes/TestArrays.java
-Xcomp -XX:-TieredCompilation -DIgnoreCompilerControls=true

#  Internal Error (/workspace/open/src/hotspot/share/opto/node.hpp:913), pid=1752475, tid=1752491
#  assert(is_CallJava()) failed: invalid node class: Unlock
#
# JRE version: Java(TM) SE Runtime Environment (25.0) (fastdebug build 25-lworld5ea-LTS-2025-04-09-0511154.tobias.hartmann.valhalla2)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 25-lworld5ea-LTS-2025-04-09-0511154.tobias.hartmann.valhalla2, compiled mode, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x15613fc]  optimize_strict_final_load_memory_from_local_object(ciField*, ProjNode*)+0x43c


compiler/valhalla/inlinetypes/TestFieldNullMarkers.java
-XX:-UseTLAB -DVerifyIR=false

java.lang.RuntimeException: assertEquals expected: null but was: x = -79
	at jdk.test.lib.Asserts.fail(Asserts.java:715)
	at jdk.test.lib.Asserts.assertEquals(Asserts.java:208)
	at jdk.test.lib.Asserts.assertEquals(Asserts.java:195)
	at jdk.test.lib.Asserts.assertEQ(Asserts.java:172)
	at compiler.valhalla.inlinetypes.TestFieldNullMarkers.main(TestFieldNullMarkers.java:799)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
	at java.base/java.lang.Thread.run(Thread.java:1447)

-------------

PR Comment: https://git.openjdk.org/valhalla/pull/1424#issuecomment-2789673996


More information about the valhalla-dev mailing list