RFR: 8267532: Try/catch block not optimized as expected [v4]
Tom Rodriguez
never at openjdk.org
Mon Nov 6 17:10:13 UTC 2023
On Mon, 6 Nov 2023 17:03:23 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> Thinking more about this: marking the handler as entered is mostly useful for C2 so that when we deoptimize and compile in C2 again, we don't emit an uncommon trap again. However, that would also require not seeing any exception in the interpreter or in tier 1-3. (Maybe not tracking C2 handler enters is actually desirable).
>>
>> I think we can mark the handler as entered in the deoptimization code that handles the uncommon trap that replaces the ex. handler instead, for C2 (and maybe that also works for JVMCI?)
>>
>> P.S. Ah, I didn't see your last comment :-)
>
>> If the expectation is that unhandled exception entry points will be deopts, then you may not actually have to do anything since the exception handling would end up going through the interpreter.
>
> The uncommon trap is located in the exception handler itself, so after the deopt we start interpreting in the exception handler, and don't go through the interpreter's exception dispatch code where we do the profiling (`InterpreterRuntime::exception_handler_for_exception`).
>
> I think handling this in `Deoptimization::uncommon_trap_inner` can work though.
Yes I think a solution like that would work for JVMCI as well. C2 and JVMCI exception dispatch are very similar.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16416#discussion_r1383680688
More information about the hotspot-dev
mailing list