On Fri, 13 Mar 2026 02:13:20 GMT, Dean Long <[email protected]> wrote:

> The value of the unextended_sp >= sp invariant seems dubious to me.

I agree that it might not seem having a huge value, but I think _if_  we can 
make it safely, it would be very good to have the same behavior on both 
supported platforms. 

> I don't have a confident answer for that. Changing the semantics may have 
> unintended side effects. Is it really worth the risk?

I can dig a bit more and place some sort of asserts in the assembly code where 
a raw `r19` value is used to restore `sp`, and see if it really leads to the 
presumably wrong state.

> BTW, how are you testing this? I looked for places that call safe_for_sender 
> with something other than the result of frame(sp, fp, pc), but couldn't find 
> one. On x86 and aarch64, the 3-arg frame(sp, fp, pc) always sets 
> unextended_sp = sp, does it not?

Initially I placed guarantees to break in `safe_for_sender()`, and only one 
test actually broke, that is 
test/hotspot/jtreg/serviceability/AsyncGetCallTrace. I am aware that the 
machinery it is testing is "obsolete" and not maintained, but still used by 
some 3rd party programs. 

Then I found another good place to place a guarantee, it is in 
`sender_for_interpreter_frame()`. This one breaks way more often. It is 
equivalent to placing a guarantee statement inside of the 4-argument frame 
constructor.

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

PR Comment: https://git.openjdk.org/jdk/pull/29744#issuecomment-4054117471

Reply via email to