[lworld+vector] RFR: 8304310: Initial compilers and runtime handling for multifield backed vectors. [v3]
Xiaohong Gong
xgong at openjdk.org
Tue Apr 4 08:28:38 UTC 2023
On Tue, 4 Apr 2023 07:28:59 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:
>> src/hotspot/share/runtime/deoptimization.cpp line 1395:
>>
>>> 1393: while (ik != NULL) {
>>> 1394: for (AllFieldStream fs(ik); !fs.done(); fs.next()) {
>>> 1395: if (!fs.access_flags().is_static() && !fs.is_multifield() && (!skip_internal || !fs.access_flags().is_internal())) {
>>
>> Does it need special handling for the vectorized multifield base?
>
> I think it needs the special handling for vectorized multifield. I ran a simple case with `-XX:+DeoptimizeALot`, and it shows the crash:
>
> #
> # A fatal error has been detected by the Java Runtime Environment:
> #
> # Internal Error (/mnt/local/code/valhalla/src/hotspot/share/runtime/stackValue.cpp:194), pid=373245, tid=373246
> # Error: ShouldNotReachHere()
> #
> # JRE version: OpenJDK Runtime Environment (21.0) (fastdebug build 21-internal-git-3cf3c3d81)
> # Java VM: OpenJDK 64-Bit Server VM (fastdebug 21-internal-git-3cf3c3d81, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
> # Problematic frame:
> # V [libjvm.so+0x1937848] StackValue* StackValue::create_stack_value<RegisterMap>(frame const*, RegisterMap const*, ScopeValue*) [clone .localalias]+0x2c8
> #
> # Core dump will be written. Default location: /tmp/core.373245
> #
> # If you would like to submit a bug report, please visit:
> # https://bugreport.java.com/bugreport/crash.jsp
> #
>
> --------------- S U M M A R Y ------------
>
> Command Line: -XX:CompileCommand=print,Test.func -XX:+UnlockDiagnosticVMOptions -XX:-DebugNonSafepoints -XX:-TieredCompilation -XX:+UnlockExperimentalVMOptions -XX:-EnableVectorSupport -XX:+DeoptimizeALot --add-modules=jdk.incubator.vector Test
>
> Host: xiagon01-01-arm-vm, AArch64, 160 cores, 190G, Ubuntu 22.04.1 LTS
> Time: Tue Apr 4 07:14:11 2023 UTC elapsed time: 1.133206 seconds (0d 0h 0m 1s)
>
> --------------- T H R E A D ---------------
>
> Current thread (0x0000fffdfc02b200): JavaThread "main" [_thread_in_vm, id=373246, stack(0x0000fffe03820000,0x0000fffe03a20000)]
>
> Stack: [0x0000fffe03820000,0x0000fffe03a20000], sp=0x0000fffe03a1c850, free space=2034k
> Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
> V [libjvm.so+0x1937848] StackValue* StackValue::create_stack_value<RegisterMap>(frame const*, RegisterMap const*, ScopeValue*) [clone .localalias]+0x2c8 (stackValue.cpp:194)
> V [libjvm.so+0xb31b58] reassign_fields_by_klass(InstanceKlass*, frame*, RegisterMap*, ObjectValue*, int, oop, bool, int, JavaThread*)+0x418 (deoptimization.cpp:1425)
> V [libjvm.so+0xb34398] Deoptimization::reassign_fields(frame*, RegisterMap*, GrowableArray<ScopeValue*>*, bool, bool, JavaThread*)+0x3b4 (deoptimization.cpp:1568)
> V [libjvm.so+0xb3709c] rematerialize_objects(JavaThread*, int, CompiledMethod*, frame&, RegisterMap&, GrowableArray<compiledVFrame*>*, bool&)+0x74c (deoptimization.cpp:283)
> V [libjvm.so+0xb39324] Deoptimization::fetch_unroll_info_helper(JavaThread*, int)+0x404 (deoptimization.cpp:438)
> V [libjvm.so+0xb3a740] Deoptimization::fetch_unroll_info(JavaThread*, int)+0xc0 (deoptimization.cpp:176)
> v ~DeoptimizationBlob 0x0000fffe0087d900
> Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
> v ~DeoptimizationBlob 0x0000fffe0087d900
> J 176 c2 jdk.incubator.vector.IntVector$$Lambda$38+0x0000000801064bc0.load(Ljava/lang/Object;JLjdk/internal/vm/vector/VectorSupport$VectorSpecies;)Ljdk/internal/vm/vector/VectorSupport$VectorPayload; jdk.incubator.vector at 21-internal (17 bytes) @ 0x0000fffe008e9cec [0x0000fffe008e9980+0x000000000000036c]
> J 204 c2 Test.func(Z)V (145 bytes) @ 0x0000fffe00900ef0 [0x0000fffe00900cc0+0x0000000000000230]
> j Test.main([Ljava/lang/String;)V+22
> v ~StubRoutines::call_stub 0x0000fffe0079017c
>
> Fixing is not urgent. We can fix this part after the basic support is merged. Thanks!
I created a prototype fix based on my local changes. Please see: https://github.com/XiaohongGong/valhalla/pull/2/commits/a17ed7d4364bb6408c29655996794640694e0ea5
Hope this could help. Thanks!
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/833#discussion_r1156905128
More information about the valhalla-dev
mailing list