RFR: 8259242: Remove ProtectionDomainSet_lock [v3]

Coleen Phillimore coleenp at openjdk.java.net
Fri Apr 9 11:13:10 UTC 2021


On Fri, 9 Apr 2021 02:17:29 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Make ProtectionDomainEntry delete list global and set a threshold for deletions before handshaking. Fix if to when.
>
> src/hotspot/share/classfile/dictionary.cpp line 455:
> 
>> 453:             prev->release_set_next(current->next_acquire());
>> 454:           }
>> 455:           delete_list->push(current);
> 
> Suggested comment before this:
> // Mark current for deletion, but in the meantime it can still be traversed
> 
> It is important that current is not unlinked so that in-progress traversals do not break. Though to be honest I'm unclear exactly what triggers the clearing of an entry this way.

I added the comment.  The service thread could be trying to remove this entry and there's a small chance that some class loading will be looking up this entry with SystemDictionary::find_instance_klass.

    // First clean cached pd lists in loaded CLDs
    // It's unlikely, but some loaded classes in a dictionary might
    // point to a protection_domain that has been unloaded.
    // The dictionary pd_set points at entries in the ProtectionDomainCacheTable.

There's a test runtime/Dictionary/ProtectionDomainCache.java that does this. It creates a protection domain with a jar file loading with a URL class loader that's then removed.  The defining class loader of the class loaded has that protection domain in its pd_set.

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

PR: https://git.openjdk.java.net/jdk/pull/3362


More information about the hotspot-dev mailing list