RFR: 8299089: Instrument global jni handles with tag to make them distinguishable

Axel Boldt-Christmas aboldtch at openjdk.org
Mon Jan 16 09:33:13 UTC 2023


On Wed, 21 Dec 2022 09:40:56 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Weak global jni handles are tagged so the GC can distinguish them when resolving the object. Today there is no cheap way of distinguishing global jni handles from local jni handles. For generational ZGC the OopStorage handles and the thread local handles semantical difference requires the handles to be distinguishable. 
>> 
>> This enhancements instruments the jni handles with a global tag similarly to the jweak tag. 
>> 
>> Note: 
>>  * the s390 implementation has minimal changes and requires improvement.
>>  * There is room for enchantment here to create the same abstraction that ppc uses for all platforms, i.e. move the resolve_jobject from the MacroAssembler to the BarrierSetAssembler which allows for more optimised code for GCs that can treat local and global handles the same. 
>> 
>> Testing: GHA. Oracle supported platforms tier1-3. Will run higher tiers. Has also been tested on the generational branch of ZGC for over three months. Requires testing on non Oracle platforms.
>
>> Today there is no cheap way of distinguishing global jni handles from local jni handles.
> 
> So is the code you added "cheap"? Else what is the performance hit for adding this? Thanks.

@dholmes-ora Ran a suite of microbenchmarks, SPECxxx and Renaissance benchmarks. Could not see any significant change. If there is some other benchmark / tests that tests the JNI performance more heavily that you want run?

@fisk and @stefank Changed some of the names and asserts based on @albertnetymk's feedback. 

Given that this change touches all platforms, do porters have any comments?

The changeset has been tested on generational ZGC for PPC by @TheRealMDoerr

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

PR: https://git.openjdk.org/jdk/pull/11740


More information about the hotspot-dev mailing list