RFR: 8305668: PPC: Non-Top Interpreted frames should be independent of ABI_ELFv2
Richard Reingruber
rrich at openjdk.org
Thu Apr 13 17:10:20 UTC 2023
On Thu, 6 Apr 2023 13:22:49 GMT, Richard Reingruber <rrich at openjdk.org> wrote:
> This PR makes parent interpreted Java frames independent of `ABI_ELFv2`.
> With the changes `test/jdk/jdk/internal/vm/Continuation/BasicExt.java#COMP_ALL` succeeds on PPC64 Big Endian Linux.
>
> Before:
>
> * `parent_ijava_frame_abi` was derived from `abi_minframe` which depends on `ABI_ELFv2`
> * jit_abi is independent of `abi_minframe`
> * `frame::metadata_words` is wrong for `parent_ijava_frame_abi` if `ABI_ELFv2` is not defined (big endian)
>
> After changes:
>
> * prefixed structs that depend on `ABI_ELFv2` with `native_`
> * introduced `java_abi` which is independent of `ABI_ELFv2`
> * `frame::metadata_words` is the size in words of `java_abi`
>
> This is still a little imprecise since `top_ijava_frame_abi` is larger than `java_abi` but the top frame is never frozen as it is always `vmIntrinsics::_Continuation_doYield`
>
> Testing:
>
> PPC64le: most JCK and JTREG tiers 1-4, also in Xcomp mode.
> PPC64be Linux: hotspot tier1 tests
Top of stack when `SharedRuntime::exception_handler_for_return_address` is called. Calling C++ code kills 14 words in the caller. This kills the `method` field of the interpreted frame. On little endian only 12 words are killed which is just enough. At least in this test. If there is no dead space then it can crash too.
[0.832s][trace][continuations] 0x00000fffb562da40: 0x00000fffb562db50 #0 method BasicExt$Continuation3Frames.ord103_testMethod_dontinline(JJJLjava/lang/String;)Ljava/lang/String; @ 7
[0.832s][trace][continuations] - 8 locals 9 max stack
[0.832s][trace][continuations] - codelet: return entry points
[0.832s][trace][continuations] sp for #1
[0.832s][trace][continuations] 0x00000fffb562da38: 0x00000fff9b629690 fresult
[0.832s][trace][continuations] 0x00000fffb562da30: 0x00000000ffb72cd8 lresult
[0.832s][trace][continuations] 0x00000fffb562da28: 0x0000000000000000 oop_tmp
[0.832s][trace][continuations] 0x00000fffb562da20: 0x00000fffb562daa0 sender_sp
[0.832s][trace][continuations] 0x00000fffb562da18: 0x00000fffb562d920 top_frame_sp
[0.832s][trace][continuations] 0x00000fffb562da10: 0x00000fffb562d730 mdx
[0.832s][trace][continuations] 0x00000fffb562da08: 0x00000fffb562d990 esp
[0.832s][trace][continuations] 0x00000fffb562da00: 0x00000fff9b614f87 bcp
[0.832s][trace][continuations] 0x00000fffb562d9f8: 0x00000fff9b612000 cpoolCache
[0.832s][trace][continuations] 0x00000fffb562d9f0: 0x00000fffb562d9d8 monitors
[0.832s][trace][continuations] 0x00000fffb562d9e8: 0x000000000000000b locals
[0.832s][trace][continuations] 0x00000fffb562d9e0: 0x00000000ffcc02b0 mirror
[0.832s][trace][continuations] oop for #0
[0.832s][trace][continuations] 0x00000fffb562d9d8: 0x00000fff9b614fd8 method
[0.832s][trace][continuations] 0x00000fffb562d9d0: 0x00000000ffcc1bf8
[0.832s][trace][continuations] 0x00000fffb562d9c8: 0x0000000000000000
[0.832s][trace][continuations] 0x00000fffb562d9c0: 0x0000000000000001
[0.832s][trace][continuations] 0x00000fffb562d9b8: 0x0000000000000000
[0.832s][trace][continuations] 0x00000fffb562d9b0: 0x0000000000000002
[0.832s][trace][continuations] 0x00000fffb562d9a8: 0x0000000000000000
[0.832s][trace][continuations] 0x00000fffb562d9a0: 0x0000000000000003 DEAD SPACE
[0.832s][trace][continuations] 0x00000fffb562d998: 0x00000000ffb72cd8
[0.832s][trace][continuations] 0x00000fffb562d990: 0x00000fffa9de84dc <- esp
[0.832s][trace][continuations] 0x00000fffb562d988: 0x0000000000000006
[0.832s][trace][continuations] 0x00000fffb562d980: 0x00000fffa9de81a8 return address
[0.832s][trace][continuations] 0x00000fffb562d978: 0x00000000bbaaddf9
[0.832s][trace][continuations] 0x00000fffb562d970: 0x00000fffb562da40 unextended_sp for #0 Range [0x00000fffb562d970, 0x00000fffb562d9d8] has 14 words !!!
-------------
PR Comment: https://git.openjdk.org/jdk/pull/13372#issuecomment-1507312475
More information about the hotspot-compiler-dev
mailing list