RFR: 8267532: Try/catch block not optimized as expected [v4]

Tom Rodriguez never at openjdk.org
Mon Nov 6 15:43:12 UTC 2023


On Mon, 6 Nov 2023 13:15:36 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> I think it should be straightforward to add this profile for JVMCI compiler at line 693 with
>> 
>>       if (t->bci() != -1) { // did we find a handler in this method?
>>         sd->method()->set_ex_handler_entered(t->bci()); // profile
>>       }
>
> Note that we don't have an `sd` at that point in the code. `cm->method()` only points at the top-level method, so we'd have to do the same method/handler bci lookup as we do for C2 in the big `while` loop below the JVMCI code. Given that we don't do that already, I figured JVMCI exception handler routing just worked differently, and there was another point (on the Java side maybe) where the method + bci is looked up.

I think this fine for now as well.  The code as written just can't work for JVMCI since we don't even enter that part of the logic.  We do a straight lookup based on the pc offset and dispatch there directly.  The generated code actually does the exception dispatch for the inlined scopes so it's not visible to the runtime which handler actually services the request.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16416#discussion_r1383539526


More information about the hotspot-dev mailing list