RFR: 8292068: Convert ModuleEntryTable into ResourceHashtable

Coleen Phillimore coleenp at openjdk.org
Wed Aug 10 12:21:54 UTC 2022


On Wed, 10 Aug 2022 05:45:40 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> Converted the ModuleEntryTable to use ResourceHashtable.
>> Ran tiers 1-7.  Also ran performance tests with this and other changes with no performance difference, although the footprint of this should be better.
>
> src/hotspot/share/classfile/moduleEntry.cpp line 359:
> 
>> 357:  public:
>> 358:   bool do_entry(const Symbol*& name, ModuleEntry*& entry) {
>> 359:     ResourceMark rm;
> 
> The ResourceMark should be used inside `log_is_enabled(...) `

this usage is ugly but I'll add it because of the as_C_string() is used only if logging.

> src/hotspot/share/classfile/moduleEntry.cpp line 595:
> 
>> 593: // lookup_only by Symbol* to find a ModuleEntry.
>> 594: ModuleEntry* ModuleEntryTable::lookup_only(Symbol* name) {
>> 595:   assert_locked_or_safepoint(Module_lock);
> 
> Is it true that all public functions in the ModuleEntryTable class require the Module_lock to be held? If so, maybe this should be documented in the class declaration, and the assert to be added to all the functions.

It is true, but wasn't true when the ModuleTable first was developed.  I'll add the asserts.

> src/hotspot/share/classfile/moduleEntry.hpp line 209:
> 
>> 207:   static ModuleEntry* _javabase_module;
>> 208:   ResourceHashtable<const Symbol*, ModuleEntry*, 109, ResourceObj::C_HEAP, mtModule,
>> 209:                     Symbol::compute_hash, Symbol::compare> _table;
> 
> Is the `Symbol::compare` necessary? The `_invoke_method_type_table` table in systemDictionary.hpp is able to use the default comparison method.

It is not necessary.

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

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


More information about the hotspot-dev mailing list