[lworld] RFR: 8349110: [lworld] Intrinsics for Unsafe.get/putFlatValue

Tobias Hartmann thartmann at openjdk.org
Thu Jun 12 11:17:46 UTC 2025


On Fri, 6 Jun 2025 11:46:23 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

> Hi,
> 
> This PR implements intrinsics for `Unsafe::get/putFlatValue` and enables the corresponding tests in `TestIntrinsics`.
> 
> Please kindly review, thanks very much.

Thanks for working on this Quan-Anh! I executed some quick testing and noticed that `TestIntrinsics` fails:


 359  InlineType  === _ 13 15 16 24 25 31 37 43 52 65 74 110 111  [[ 394 360 360 384 374 ]]  #compiler/valhalla/inlinetypes/MyValue1 (compiler/valhalla/inlinetypes/MyInterface):NotNull:exact *  Oop:compiler/valhalla/inlinetypes/MyValue1 (compiler/valhalla/inlinetypes/MyInterface):NotNull:exact * !orig=14 !jvms: TestIntrinsics::test72 @ bci:-1 (line 1456)
 394  AddP  === _ 359 360 87  [[ 399 ]]   Oop:compiler/valhalla/inlinetypes/MyValue1 (compiler/valhalla/inlinetypes/MyInterface):NotNull:exact+bot * [narrow] !jvms: TestIntrinsics::test72 @ bci:21 (line 1458)

# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/workspace/open/src/hotspot/share/opto/compile.cpp:2073), pid=1806857, tid=1806873
#  assert(false) failed: Should have been buffered
#
# JRE version: Java(TM) SE Runtime Environment (25.0) (fastdebug build 25-lworld5ea-LTS-2025-06-11-1437268.tobias.hartmann.valhalla2)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 25-lworld5ea-LTS-2025-06-11-1437268.tobias.hartmann.valhalla2, mixed mode, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0xb384b1]  Compile::process_inline_types(PhaseIterGVN&, bool)+0xa11

Current CompileTask:
C2:3962  662    b        compiler.valhalla.inlinetypes.TestIntrinsics::test72 (78 bytes)

Stack: [0x00007f84bb8fa000,0x00007f84bb9fa000],  sp=0x00007f84bb9f5080,  free space=1004k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0xb384b1]  Compile::process_inline_types(PhaseIterGVN&, bool)+0xa11  (compile.cpp:2073)
V  [libjvm.so+0xb55115]  Compile::Optimize()+0x1365  (compile.cpp:3033)
V  [libjvm.so+0xb57cff]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1fef  (compile.cpp:874)
V  [libjvm.so+0x96de34]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x484  (c2compiler.cpp:143)
V  [libjvm.so+0xb659b8]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xb58  (compileBroker.cpp:2307)
V  [libjvm.so+0xb66b78]  CompileBroker::compiler_thread_loop()+0x568  (compileBroker.cpp:1951)
V  [libjvm.so+0x10e113b]  JavaThread::thread_main_inner()+0x13b  (javaThread.cpp:774)
V  [libjvm.so+0x1b5c406]  Thread::call_run()+0xb6  (thread.cpp:231)
V  [libjvm.so+0x17c7fb8]  thread_native_entry(Thread*)+0x128  (os_linux.cpp:875)


It mostly seems to fail on linux-aarch64-debug in various configurations for some reason but also once on x64 with `-XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -XX:+StressArrayCopyMacroNode -XX:+StressCallingConvention -XX:+StressLCM -XX:+StressGCM -XX:+StressCCP -XX:+StressIGVN -XX:+StressReflectiveCode -XX:+StressMethodHandleLinkerInlining -XX:+StressCompiledExceptionHandlers -XX:MaxNodeLimit=100000`.

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

PR Comment: https://git.openjdk.org/valhalla/pull/1482#issuecomment-2966212919


More information about the valhalla-dev mailing list