On Thu, 1 Sep 2022 04:12:32 GMT, David Holmes <dhol...@openjdk.org> wrote:
>> 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. “Mapping to itself” is how this table works internally. I am not sure if this information is useful here. But the purpose of this table is really to keep track of all PDs that have been registered and not yet garbage collected. ------------- PR: https://git.openjdk.org/jdk/pull/10043