RFR: 8267532: Try/catch block not optimized as expected
Jorn Vernee
jvernee at openjdk.org
Thu Nov 2 12:29:02 UTC 2023
On Thu, 2 Nov 2023 05:02:21 GMT, David Holmes <dholmes at openjdk.org> wrote:
> @JornVernee could you add tiers 7 and 8 to your testing please. I would be worried in case there is any subtle interaction with Xcomp mode, or with ZGC.
Ok
> what happens when a "dead" catch block turns out to not be dead afterall?
We insert an uncommon trap in place of the exception handler. So, if the handler is needed after all, we deoptimize and go back to the interpreter. If the method is recompiled later, we see that the exception handler has been entered, and don't emit an uncommon trap that time.
Note also that C2 already emits uncommon traps in place of exception handlers if it sees an unloaded exception type as well: https://github.com/openjdk/jdk/blob/faa8bde27569b4db3a1a9dd62adee0b10e81a718/src/hotspot/share/opto/doCall.cpp#L886-L888
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16416#issuecomment-1790633998
More information about the hotspot-dev
mailing list