RFR: 8259713: Fix comments about ResetNoHandleMark in deoptimization
Coleen Phillimore
coleenp at openjdk.java.net
Thu Jan 14 13:34:02 UTC 2021
On Thu, 14 Jan 2021 13:20:31 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> My suggestion:
>> // JRT_LEAF methods don't normally allocate handles and there is a
>> // NoHandleMark to enforce that. It is actually safe to use Handles
>> // in a JRT_LEAF method, and sometimes desirable, but to do so we
>> // must use ResetNoHandleMark to bypass the NoHandleMark, and
>> // then use a HandleMark to ensure any Handles we do create are
>> // cleaned up in this scope.
>> I still question why such a function declares itself a LEAF instead of just being a JRT_ENTRY but that is a different argument. :)
>> Cheers,
>> David
>
> Ok, your comment says the same thing as mine and includes what I want to say, so I'll use your comment.
> I'm pretty sure this function wants a NoSafepointVerifier but some of the calls it uses might need handles, because we were pretty aggressive about making arguments into handles.
I actually think the HandleMark is there because of the PreserveExceptionMark call in VerifyStack, which is the thing that Erik ran into also with stack watermarks, and prompted the original request about lifting the restrictions for JRT_LEAF functions. I don't want there to be an unhandleized version of PreserveExceptionMark, and I don't want JRT_LEAF to allow Handles by default, so hopefully this comment is adequate documentation.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2069
More information about the hotspot-dev
mailing list