On Wed, 4 Nov 2026 08:59:08 GMT, Gui Cao <[email protected]> wrote:

>> Hi, please condiser.
>> SA currently computes continuation entry frame pointers using the raw 
>> sizeof(ContinuationEntry), whereas HotSpot uses that size rounded up to two 
>> machine words.
>> With the current 64-bit layout, the raw size is 56 bytes and the aligned 
>> size is 64 bytes. Consequently, SA computes frame pointers eight bytes too 
>> low on x86-64, AArch64, and RISC-V64.
>> 
>> This change:
>> - Aligns the size in the shared SA implementation, matching 
>> ContinuationEntry::size().
>> - Preserves RISC-V’s additional two-word FP adjustment.
>> - Adds a cross-platform jtreg test that checks FP offsets using the attached 
>> JVM’s type metadata and a synthetic entry address, without depending on 
>> stack-walking behavior or virtual-thread timing.
>> 
>> Testing: github ci
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Gui Cao has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   Code format

Looks good!
I leave small one comment to jtreg test, but it  might just be a matter of 
personal preference. I'm ok if you go ahead with current change.

test/hotspot/jtreg/serviceability/sa/TestContinuationEntry.java line 64:

> 62:             // See ContinuationEntry::entry_fp() in 
> continuationEntry_riscv.inline.hpp and
> 63:             // RISCV64ContinuationEntry.getEntryFP() in SA.
> 64:             long expectedOffset = alignedSize + (cpu.equals("riscv64") ? 
> 2 * wordSize : 0);

We can use `jdk.test.lib.Platform::isRISCV64()` here.

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

Marked as reviewed by ysuenaga (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/33695#pullrequestreview-5777758408
PR Review Comment: https://git.openjdk.org/jdk/pull/33695#discussion_r4474910191

Reply via email to