On Thu, 7 Aug 2025 18:40:16 GMT, Chen Liang <li...@openjdk.org> wrote:

>> I think whenever we hit `readAccess`, it means we are missing this item in 
>> the cache and are already in this slow path. I pondered this may happen due 
>> to cache being too full too, in which case we have `updated == entry` in the 
>> backing map, so leaving it out of the if block should be correct.
>
> Also, this cache mechanism was authored before JDK 8 introduced fast table 
> cache in `ConcurrentHashMap`. In the long run, we may switch the 
> ClassValueMap to a ConcurrentHashMap-derived structure, like a 
> `ReferencedKeyMap`.

Ah, OK, so this is already slow path, good. But are we sure overwriting cache 
entry _with (the live version of) itself_ would not break things? Looking at 
`addToCache` implemenation, I am not 100% convinced it is safe. Please check?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26679#discussion_r2261237490

Reply via email to