[lworld] RFR: 8372113: [lworld] Fix various issues with TypeAryPtr and TypeAryKlassPtr
Tobias Hartmann
thartmann at openjdk.org
Fri Nov 21 14:51:14 UTC 2025
On Fri, 21 Nov 2025 10:18:12 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:
> Hi,
>
> This PR fixes various issues with `TypeAryPtr` and `TypeAryKlassPtr`. It starts with me trying to tighten the properties (`flat`, `null_free`, etc) of these classes, then fixing all the revealed issues until there are no crashes or wrong results left.
>
> Please take a look and leave your reviews, thanks a lot.
Thanks for working on this!
Unfortunately, it triggers a lot of failures in testing. Here's a few, I can provide more details next week.
compiler/c2/TestMergeStores.java#id0
-ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:+TieredCompilation
# Error: assert(klass_is_exact()) failed
Current CompileTask:
C2:6719 1466 b 4 compiler.c2.TestMergeStores::test600a (165 bytes)
Stack: [0x00007f992c11b000,0x00007f992c21b000], sp=0x00007f992c216b40, free space=1006k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0xbc272a] Compile::flatten_alias_type(TypePtr const*) const+0xeba (type.hpp:1467)
V [libjvm.so+0xbc2f5c] Compile::find_alias_type(TypePtr const*, bool, ciField*, bool) [clone .part.0]+0x8c (compile.cpp:1677)
V [libjvm.so+0x1590623] LibraryCallKit::inline_unsafe_access(bool, BasicType, LibraryCallKit::AccessKind, bool, bool)+0x9e3 (compile.hpp:1005)
V [libjvm.so+0x15c211a] LibraryIntrinsic::generate(JVMState*)+0x22a (library_call.cpp:130)
V [libjvm.so+0xdc5f4f] Parse::do_call()+0xebf (doCall.cpp:771)
V [libjvm.so+0x190ded8] Parse::do_one_bytecode()+0x458 (parse2.cpp:3526)
V [libjvm.so+0x18f4f9c] Parse::do_one_block()+0x24c (parse1.cpp:1713)
V [libjvm.so+0x18f63a0] Parse::do_all_blocks()+0x130 (parse1.cpp:770)
V [libjvm.so+0x18f9f01] Parse::Parse(JVMState*, ciMethod*, float)+0xea1 (parse1.cpp:674)
V [libjvm.so+0x9e1205] ParseGenerator::generate(JVMState*)+0x135 (callGenerator.cpp:99)
V [libjvm.so+0xbe7ee3] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x15e3 (compile.cpp:824)
V [libjvm.so+0x9ddd30] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x4c0 (c2compiler.cpp:149)
V [libjvm.so+0xbf7f40] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x780 (compileBroker.cpp:2345)
V [libjvm.so+0xbf97a0] CompileBroker::compiler_thread_loop()+0x530 (compileBroker.cpp:1989)
V [libjvm.so+0x119c49b] JavaThread::thread_main_inner()+0x13b (javaThread.cpp:777)
V [libjvm.so+0x1c7c0b6] Thread::call_run()+0xb6 (thread.cpp:242)
V [libjvm.so+0x18a2a78] thread_native_entry(Thread*)+0x118 (os_linux.cpp:879)
compiler/codegen/TestRedundantLea.java#StoreNParallel
-XX:UseAVX=0 -XX:UseSSE=3
Multiple IR failures
compiler/valhalla/inlinetypes/TestArrays.java
-Xcomp -XX:-TieredCompilation -DIgnoreCompilerControls=true
# assert(_base >= KlassPtr && _base <= AryKlassPtr) failed: Not a klass pointer
#
# JRE version: Java(TM) SE Runtime Environment (26.0) (fastdebug build 26-jep401ea2-2025-11-21-1039511.tobias.hartmann.valhalla2)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 26-jep401ea2-2025-11-21-1039511.tobias.hartmann.valhalla2, compiled mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x15a40b7] LibraryCallKit::inline_arraycopy()+0x1337
compiler/valhalla/inlinetypes/TestIntrinsics.java#id2
-XX:Tier0BackedgeNotifyFreqLog=0 -XX:Tier2BackedgeNotifyFreqLog=0 -XX:Tier3BackedgeNotifyFreqLog=0 -XX:Tier2BackEdgeThreshold=1 -XX:Tier3BackEdgeThreshold=1 -XX:Tier4BackEdgeThreshold=1 -XX:CompileCommand=MemLimit,*.*,0 -Xbatch
# assert(UseArrayFlattening && is_reference_type(bt) && element_ptr->can_be_inline_type() && (!element_ptr->is_inlinetypeptr() || element_ptr->inline_klass()->maybe_flat_in_array())) failed: array can't be flat
#
# JRE version: Java(TM) SE Runtime Environment (26.0) (fastdebug build 26-jep401ea2-2025-11-21-1039511.tobias.hartmann.valhalla2)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 26-jep401ea2-2025-11-21-1039511.tobias.hartmann.valhalla2, mixed mode, tiered, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x18fe2ba] Parse::array_load(BasicType)+0x14a
-------------
PR Comment: https://git.openjdk.org/valhalla/pull/1755#issuecomment-3563330918
More information about the valhalla-dev
mailing list