RFR: 8215395: Allow null oops in Dictionary and JNIHandle verification
Per Liden
per.liden at oracle.com
Sat Dec 15 14:29:02 UTC 2018
Thanks for reviewing, Kim and Coleen!
On 12/14/2018 05:57 PM, Kim Barrett wrote:
>> On Dec 14, 2018, at 3:18 AM, Per Liden <per.liden at oracle.com> wrote:
>>
>> JDK-8214784 adjusted the Dictionary and JNIHandle verification, but failed to take into account that these oops can be null. We should be using oopDesc::is_oop_or_null() here rather than just oopDesc::is_oop().
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8215395
>> Webrev: http://cr.openjdk.java.net/~pliden/8215395/webrev.0
>>
>> /Per
>
> For the case of JNIHandles, I don't think the closure will ever be
> called with a pointer to a NULL oop.
>
> A strong JNI global handle never contains NULL, by design.
> (make_global when the argument is a NULL oop just returns NULL as the
> handle, rather than making a handle that points to NULL.)
>
> Verification calls JNIHandles::weak_oops_do with the verification
> closure, which calls OopStorage::weak_oops_do with that closure, which
> calls OopStorage::iterate_safepoint with a skip_null wrapper around
> the closure.
>
> That said, I don't strongly object to this change, if you want to make
> a "belts and suspenders" argument for it.
Check. I'll stick with allowing null for now.
/Per
More information about the hotspot-runtime-dev
mailing list