RFR: 8329597: C2: Intrinsify Reference.clear [v3]
Kim Barrett
kbarrett at openjdk.org
Fri Sep 27 23:56:37 UTC 2024
On Fri, 19 Jul 2024 15:52:14 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> [JDK-8240696](https://bugs.openjdk.org/browse/JDK-8240696) added the native method for `Reference.clear`. The original patch skipped intrinsification of this method, because we thought `Reference.clear` is not on a performance sensitive path. However, it shows up prominently on simple benchmarks that touch e.g. `ThreadLocal` cleanups. See the bug for an example profile with `RRWL` benchmarks.
>>
>> We need to know the actual oop strongness/weakness before we call into C2 Access API, this work models this after existing code for `refersTo0` intrinsics. C2 Access also need a support for `AS_NO_KEEPALIVE` for stores.
>>
>> Additional testing:
>> - [x] Linux x86_64 server fastdebug, `all`
>> - [x] Linux AArch64 server fastdebug, `all`
>
> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
>
> Amend the test case for guaranteing it works under different compilation regimes
Changes requested by kbarrett (Reviewer).
src/java.base/share/classes/java/lang/ref/Reference.java line 420:
> 418: /* Implementation of clear(), also used by enqueue(). A simple
> 419: * assignment of the referent field won't do for some garbage
> 420: * collectors.
Description of clear0 is rendered stale by this change. The first sentence is no longer true, since it's now
clearImpl that has that role. The second sentence probably ought to also be moved into the description of
clearImpl.
-------------
PR Review: https://git.openjdk.org/jdk/pull/20139#pullrequestreview-2334816850
PR Review Comment: https://git.openjdk.org/jdk/pull/20139#discussion_r1779311136
More information about the core-libs-dev
mailing list