RFR: 8330181: Move PcDesc cache from nmethod header
Vladimir Kozlov
kvn at openjdk.org
Tue Apr 23 03:57:29 UTC 2024
On Tue, 23 Apr 2024 01:16:40 GMT, Dean Long <dlong at openjdk.org> wrote:
>> Currently PcDescCache (32 bytes in 64-bit VM: PcDesc* _pc_descs[4]) is allocated in `nmethod` header.
>>
>> Moved PcDescContainer (which includes cache) to C heap similar to ExceptionCache to reduce size of `nmethod` header and to remove WXWrite transition when we update the cache in `PcDescCache::add_pc_desc()`.
>>
>> Removed `PcDescSearch` class which was leftover from `CompiledMethod` days.
>>
>> Tested tier1-4,stress,xcomp and performance.
>
> src/hotspot/share/code/nmethod.cpp line 2738:
>
>> 2736: // which is typically called in a signal handler
>> 2737: _pc_desc_cache.add_pc_desc(upper);
>> 2738: }
>
> The special case for ASGCT, along with ThreadWXEnable changes here:
> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/runtime/sharedRuntime.cpp#L484
> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/runtime/sharedRuntime.cpp#L1755
> https://github.com/openjdk/jdk/blob/master/src/hotspot/os/posix/signals_posix.cpp#L617
> look like they will no longer be needed. I suggest filing a follow-up RFE for an ASGCT expert to take.
Thank you, @dean-long, for pointing this.
[JDK-8302736](https://bugs.openjdk.org/browse/JDK-8302736) added 2 ThreadWXEnable in sharedRuntime.cpp
And later [JDK-8316392](https://bugs.openjdk.org/browse/JDK-8316392) added it to `PcDescCache::add_pc_desc()`
What a mess ...
We can now safely remove (after testing) all ThreadWXEnable which guards calls to `add_pc_desc()`
And file separate RFE for runtime to look on `!Thread::current_in_asgct()`
Is this what you are suggesting? I will do it.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18895#discussion_r1575607477
More information about the hotspot-compiler-dev
mailing list