On Fri, 13 Mar 2026 09:00:19 GMT, Anton Artemov <[email protected]> wrote:

>> Hi, please consider the following changes:
>> 
>> This is a fix for `sp > unextended_sp` state, which can happen when 
>> interpreted -> interpreted calls go through a method handle linker method.
>> 
>> On x86 the issue is addressed by incrementing `r13` register value when the 
>> `memberName `appendix arg is being popped out. Additionally, some changes in 
>> JVMTI - related method `_remove_activation_preserving_args_entry` have to be 
>> done to reflect the changes.
>> 
>> On aarch64 the issue is addressed by keeping a 16-bytes aligned snapshot of 
>> the expression stack pointer (eps) in `r19` instead of the regular stack 
>> pointer, and an increment of that register value when the `MemberName 
>> `appendix arg is being popped out. Although due to the 16-bytes alignment 
>> the result of this increment is wiped out immediately, I think it is good to 
>> be consistent with x86 and have instructions in place.
>> 
>> Tested in tiers 1 - 7.
>
> Anton Artemov has updated the pull request with a new target base due to a 
> merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains four additional 
> commits since the last revision:
> 
>  - Merge remote-tracking branch 'origin/master' into 
> JDK-8302745-unextended-sp-less-than-sp
>  - 8302745: Don't touch ARM code.
>  - 8302745: Addressed reviewer's comments.
>  - 8302745: Fix for sp > unextended_sp for x86 and aarch64.

src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp line 1558:

> 1556:     __ jcc(Assembler::zero, L_done);
> 1557: 
> 1558:     __ movptr(Address(rbx, 0), rax);

I scratched my head trying to figure out what rbx is here.  It turns out it is 
the sender_sp from remove_activation.  And rsp here is based on last_sp.  
Previously, rbx and rsp would be the same because last_sp and sender_sp would 
be the same, as set in prepare_to_jump_from_interpreted.  But if this PR 
changes the meaning of sender_sp, rbx will have the wrong value here.  It 
should be using rsp here, I believe.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29744#discussion_r2935000602

Reply via email to