RFR: 8365047: Remove exception handler stub code in C2 [v4]
Martin Doerr
mdoerr at openjdk.org
Mon Sep 15 15:05:30 UTC 2025
On Mon, 15 Sep 2025 10:53:50 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:
>> Ruben has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - Offset the deoptimization handler entry point
>>
>> Change-Id: I596317ec6a364b341e4642636fa5cf08f87ed722
>> - Revert "Ensure stub code is not adjacent to a call"
>
> I suggest reverting only the PPC64 files to the previous version. That one works. There should never be a `bl` instruction immediately before the deopt handler on PPC64.
> Thank you, @TheRealMDoerr, I will revert the change in PPC64 files and will add a comment in the `emit_deopt_handler`. Would it be possible for you to advise what does guarantee there is never a `bl` before the deopt handler?
Thanks!
The main code ends with `blr` or `b` instructions. There may be trampoline stubs which end with `bctr` instructions. None of them set the `LR` (link register).
I wonder why arm uses instructions which set it and the end. Does that make any sense?
Note that we sometimes emit a 2nd deopt handler: https://github.com/openjdk/jdk/blob/a7dc011ac4fec73d686661b1bb6969c7135982f2/src/hotspot/share/opto/output.cpp#L1814
After having executed the first one, LR may point to the beginning of the 2nd one. I don't think this causes problems on PPC64, but should better be double-checked. At least, this code pattern is not new.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26678#issuecomment-3292652424
More information about the hotspot-dev
mailing list