RFR: 8291969: Convert LoaderConstraintsTable to ResourceHashtable [v2]

David Holmes dholmes at openjdk.org
Fri Aug 19 03:49:51 UTC 2022


On Wed, 17 Aug 2022 16:31:21 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> This converts the LoaderConstraintTable to ResourceHashtable.  It's a bit different than the other conversions in that the LoaderConstraintEntry has to be restructured to hold all the loader constraints for that class name, since the search key is the class name.  Also, I replaced the raw arrays with GrowableArray, because it's less code.
>> Tested with tier1-3, and tier 4-7 previously with other changes.  I also verified code paths with some temporary asserts with existing tests, including jck tests.
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix include for minimal build.

This one was much harder to follow. So IIUC:

- the loader constraint table is a mapping from a class-name (Symbol*) to a LoaderConstraintEntry.
- a LoaderConstraintEntry is a set of LoaderConstraints for a given class-name
- a LoaderConstraint is a set of classloaders (CLD) that share the same instanceKlass

src/hotspot/share/classfile/loaderConstraints.cpp line 73:

> 71: 
> 72:   // convenience
> 73:   void set_loader(oop p) {

This should be `add_loader` not `set_loader`.

src/hotspot/share/classfile/loaderConstraints.cpp line 78:

> 76: };
> 77: 
> 78: class LoaderConstraintEntry : public StackObj {      // copied into hashtable as value

StackObj does not seem appropriate for something being stored in a hashtable.

src/hotspot/share/classfile/loaderConstraints.cpp line 162:

> 160: 
> 161:   // The klass may be null if it hasn't been loaded yet, for instance while checking
> 162:   // an parameter name to a method call.  We impose this constraint that the

typo: s/an/a/

s/this/the/

src/hotspot/share/classfile/loaderConstraints.cpp line 163:

> 161:   // The klass may be null if it hasn't been loaded yet, for instance while checking
> 162:   // an parameter name to a method call.  We impose this constraint that the
> 163:   // class that is eventually loaded much match between these two loaders.

typo: s/much/must/

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

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


More information about the hotspot-runtime-dev mailing list