On Thu, 1 Sep 2022 07:53:07 GMT, David Holmes <dhol...@openjdk.org> wrote:

>> "mapping a PD to a unique Weakhandle" is not an implementation detail. It's 
>> the only useful API provided by this class:
>> 
>> 
>> WeakHandle obj = 
>> ProtectionDomainCacheTable::add_if_absent(protection_domain);
>> 
>> 
>> and that's the reason I question why this table is needed at all.
>
> The fact it is a weakhandle is an implementation detail. The table simply 
> records whether a PD (wrapped in a WeakHandle) has been seen.

Since I know what this table does, either comment is fine if it helps someone 
understand it.
The "map each PD to itself" is pretty odd to me too.   How about collect each 
PD for fast lookup in a hashtable?  The code says how it's mapped.  There isn't 
that much code and it's easy to see how the Key is mapped.

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

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

Reply via email to