RFR: 8365047: Remove exception handler stub code in C2 [v4]

Ruben duke at openjdk.org
Mon Sep 15 09:55:34 UTC 2025


On Mon, 15 Sep 2025 09:19:45 GMT, Andrew Dinn <adinn 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"
>
> src/hotspot/cpu/aarch64/aarch64.ad line 2276:
> 
>> 2274:   __ far_call(RuntimeAddress(SharedRuntime::deopt_blob()->unpack()));
>> 2275: 
>> 2276:   int entry_point = __ offset();
> 
> I feel we ought to have a comment somewhere that explains why this backward jump exists so that no one subsequently tries to 'optimize' it away. It would be most helpful right here in the code -- even though that means repeating it in every port's generator file
> 
> Suggestion:
> 
>   // the entry point is placed immediately after the unpack call so we can test for
>   // it as a return PC marking the nmethod being in deopt
>   int entry_point = __ offset();

Thanks for the feedback. I will update the PR to add an explanatory comment at each `emit_deopt_handler`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26678#discussion_r2348462182


More information about the hotspot-dev mailing list