RFR: 8365047: Remove exception handler stub code in C2

Damon Fenacci dfenacci at openjdk.org
Mon Aug 11 07:31:12 UTC 2025


On Thu, 7 Aug 2025 15:49:20 GMT, Ruben <duke at openjdk.org> wrote:

> The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob.
> 
> According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only.

Thanks for "cleaning" this @ruben-arm. 
Did you run some testing (on the touched platforms)?
I doubt that there is anything perceivable but, out of curiosity, did you notice any performance change?

src/hotspot/cpu/s390/s390.ad line 1652:

> 1650:  public:
> 1651: 
> 1652:   static int emit_exception_handler(C2_MacroAssembler *masm);

Is this declaration still needed?

src/hotspot/share/code/nmethod.cpp line 1486:

> 1484:       }
> 1485: 
> 1486:       assert(offsets->value(CodeOffsets::Deopt     ) != -1, "must be set");

It might be good to leave this line where it was at the beginning of the block, just to avoid one more diff.

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

PR Review: https://git.openjdk.org/jdk/pull/26678#pullrequestreview-3104246623
PR Review Comment: https://git.openjdk.org/jdk/pull/26678#discussion_r2265844527
PR Review Comment: https://git.openjdk.org/jdk/pull/26678#discussion_r2265878970


More information about the hotspot-dev mailing list