On Thu, 4 Dec 2025 01:55:57 GMT, Vladimir Ivanov <[email protected]> wrote:

>> I don't think we can use a SoftReference here if we need to achieve constant 
>> folding.
>> 
>> Looking at inline_reference_get0, I think we might introduce another field 
>> property to trust a reference (potentially in an array) if both that 
>> reference and the referent within the reference is non-null.  I think that 
>> belongs to a separate RFE. What do you think?
>
> Then it makes sense to limit the caching to safe cases only for now. 
> Otherwise, it would functionally regress due to a possible memory leak.

I have added a primitive checking system to ensure safety for most cases and 
added a unit test to ensure there is no memory leak due to this cache.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28585#discussion_r2596829153

Reply via email to