[9] RFR(S): 8005873: JRuby test_respond_to.rb asserts with: MT-unsafe modification of inline cache

Remi Forax forax at univ-mlv.fr
Thu May 15 08:36:35 UTC 2014


On 05/14/2014 10:50 PM, Vladimir Ivanov wrote:
>>>> Or perhaps use Unsafe.CAS directly within setCachedLambdaForm?
>>> Yes, Unsafe is another option here. But since cache updates should be
>>> rare, Unsafe is an overkill here IMO - locking should be fine.
>>
>> I don't get it, AtomicReferenceArray.CAS implementation uses Unsafe.CAS
> By overkill I meant code complexity - it increases for no benefit.
>
> If we use Unsafe directly, we need to duplicate offset calculation 
> logic from AtomicReferenceArray.

yes

>
> AtomicReferenceArray doesn't fit, because to declare an array as 
> @Stable we need to work with it directly, but AtomicReferenceArray 
> manages it's private copy we don't have access to.

yes,

I may be wrong but for me cachedLambdaForm() is used in a fast path.
If it's not the case, I agree that a lock is enough.

>
> Best regards,
> Vladimir Ivanov

regards,
Rémi



More information about the hotspot-dev mailing list