RFR: 8354897: Support Soft/Weak Reference in AOT cache [v8]

Chen Liang liach at openjdk.org
Wed Apr 30 14:32:51 UTC 2025


On Wed, 30 Apr 2025 14:16:27 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Renamed the internal field ReferenceQueue.NULL to NULL_QUEUE to avoid failing hotspot/jtreg/sources/TestNoNULL.java
>
> src/java.base/share/classes/jdk/internal/util/ReferencedKeyMap.java line 353:
> 
>> 351:         for (ReferenceKey<K> key : map.keySet()) {
>> 352:             Object referent = key.get();
>> 353:             if (referent == null) {
> 
> Shouldn't this be `key.refersTo(null)`?

It is immediately passed to `CDS.keepAlive`, two separate calls of `refersTo` and `get` may produce `null` on the second call, I presume.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24757#discussion_r2068786986


More information about the hotspot-dev mailing list