On Wed, 31 Aug 2022 12:39:08 GMT, Coleen Phillimore <cole...@openjdk.org> wrote:

>> Please review this simple conversion for the ProtectionDomainCacheTable from 
>> Old Hashtable to ResourceHashtable.  There are specific tests for this table 
>> in test/hotspot/jtreg/runtime/Dictionary and 
>> serviceability/dcmd/vm/DictionaryStatsTest.java.
>> Also tested with tier1-7.
>
> Coleen Phillimore has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Fix comments, add assert.

src/hotspot/share/classfile/protectionDomainCache.hpp line 33:

> 31: 
> 32: // The ProtectionDomainCacheTable maps all java.security.ProtectionDomain 
> objects that are
> 33: // registered by DictionaryEntry::add_protection_domain() to a unique 
> WeakHandle.

Now that I understand what this table does, this comment is confusing to me. 
The table maps each PD to itself (using the WeakHandle as the actual key and 
value) as a means to track which PDs have been seen/registered. I would 
describe it thus:

// The ProtectionDomainCacheTable records all of the 
java.security.ProtectionDomain instances that have
// been registered by DictionaryEntry::add_protection_domain(). We use a 
hashtable to
map each  PD 
// instance to itself (using WeakHandles) to allow for fast lookup.

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

PR: https://git.openjdk.org/jdk/pull/10043

Reply via email to