RFR: 8298601: Refactor archiving of java.lang.Module objects [v2]
Ioi Lam
iklam at openjdk.org
Thu Dec 22 21:50:04 UTC 2022
On Thu, 22 Dec 2022 02:37:59 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:
>> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>>
>> review from @coleenp and @calvinccheung
>
> src/hotspot/share/classfile/moduleEntry.cpp line 399:
>
>> 397: ModuleEntry* archived_entry = (ModuleEntry*)ArchiveBuilder::rw_region_alloc(sizeof(ModuleEntry));
>> 398: memcpy((void*)archived_entry, (void*)this, sizeof(ModuleEntry));
>> 399: archived_entry->_archived_module_index = -2;
>
> Why not use -1 as the initial value?
Fixed.
> src/hotspot/share/classfile/moduleEntry.cpp line 516:
>
>> 514: } else if (SystemDictionary::is_system_class_loader(loader_data()->class_loader())) {
>> 515: info.print("system");
>> 516: }
>
> I think this could be simplified to
> `info.print(loader_data()->loader_name());`
I changed the code to use `ModuleEntry::print()` instead, which internally calls `loader_data()->loader_name_and_id()`.
> src/hotspot/share/classfile/modules.hpp line 56:
>
>> 54: jstring location, jobjectArray packages, TRAPS);
>> 55:
>> 56: static bool check_module_oop(oop orig_module_obj);
>
> I think this needs `NOT_CDS_JAVA_HEAP_RETURN_(false)` at the end.
Fixed.
-------------
PR: https://git.openjdk.org/jdk/pull/11715
More information about the hotspot-runtime-dev
mailing list