RFR: 8259375: JvmtiExport::jni_Get/SetField_probe calls do not need ResetNoHandleMark

David Holmes dholmes at openjdk.java.net
Fri Jan 8 07:05:57 UTC 2021


On Fri, 8 Jan 2021 07:00:45 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> This is a trivial change to remove the comments and the ResetNoHandleMark from jvmti functions.  They're called by JNI_ENTRY so they don't have a NoHandleMark that needs to be reset.  It may not have always been the case.
>> Tested with the other patch for https://bugs.openjdk.java.net/browse/JDK-8258032 and retesting with tier1-3.
>
> src/hotspot/share/prims/jvmtiExport.cpp line 1891:
> 
>> 1889:     // At least one field access watch is set so we have more work
>> 1890:     // to do. This wrapper is used by "quick" entry points that don't
>> 1891:     // allow us to create handles in post_field_access_by_jni(). We
> 
> This part of the comment should have remained - no? It is what distinguishes the _nh version from the regular version. (Though this code seems so confused it may be that we don't even need a _nh version?)
> 
> Cheers,
> David

Looking closer this code is broken - both the _nh and regular version actually create Handles! The _nh version should be read as being used  when "the caller does not allow handles" and hence it needed the RNHM. So either the RHNM remains necessary or else all calls to x_nh() should be changed to x().

David

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

PR: https://git.openjdk.java.net/jdk/pull/1975


More information about the serviceability-dev mailing list