RFR: 8327651: Rename DictionaryEntry members related to protection domain

Coleen Phillimore coleenp at openjdk.org
Tue Mar 12 18:59:13 UTC 2024


On Tue, 12 Mar 2024 08:18:06 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> Rename `DictionaryEntry::_pd_set` to `_package_access_cache`, and rename all related methods accordingly.
> 
> The old name was very confusing. It makes one wonder,
> 
>> Is `DictionaryEntry::_pd_set` related to the `java.lang.Class.getProtectionDomain()` of the `DictionaryEntry::_instance_klass` in any way?
> 
> (Hint, they have absolutely no relationship to each other).
> 
> I am making this PR as future changes in the Leyden project may be touching this area. I don't want the reviewers of my future PRs be confused by this code.
> 
> ----------------
> This PR is mostly name changes and comment clarification.
> 
> Other than a log message change for clarification, there are no behavioral changes in this PR.

Other than deleting the useful comment, the renaming seems ok.

src/hotspot/share/classfile/dictionary.hpp line 114:

> 112:   // The usage of the PD set can be seen in SystemDictionary::validate_protection_domain()
> 113:   // It is essentially a cache to avoid repeated Java up-calls to
> 114:   // ClassLoader.checkPackageAccess().

This was a pretty helpful comment, especially that we're trying to avoid repeated Java upcalls.  Why not just rename validate_protection_domain here too.

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

PR Review: https://git.openjdk.org/jdk/pull/18222#pullrequestreview-1932076800
PR Review Comment: https://git.openjdk.org/jdk/pull/18222#discussion_r1521976129


More information about the hotspot-runtime-dev mailing list