RFR: 8280682: Refactor AOT code source validation checks [v5]
Calvin Cheung
ccheung at openjdk.org
Fri Feb 21 06:19:56 UTC 2025
On Thu, 20 Feb 2025 07:29:07 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> How about adding the vm_exit in `ClassLoaderDataShared::ensure_module_entry_table_exist()` instead of assert?
>>
>>
>> void ClassLoaderDataShared::ensure_module_entry_table_exist(oop class_loader) {
>> Handle h_loader(JavaThread::current(), class_loader);
>> ModuleEntryTable* met = Modules::get_module_entry_table(h_loader);
>> if (met == nullptr) {
>> vm_exit_during_initialization("ClassLoaderDataShared::ensure_module_entry_table_exist() failed unexpectedly");
>> }
>> }
>
> I can't answer that. As a refactoring I expect to see the current behaviour preserved.
After discussion with Ioi, we found a place to call the vm_exit function:
void AOTClassLocationConfig::dumptime_init(JavaThread* current) {
assert(CDSConfig::is_dumping_archive(), "");
_dumptime_instance = NEW_C_HEAP_OBJ(AOTClassLocationConfig, mtClassShared);
_dumptime_instance->dumptime_init_helper(current);
if (current->has_pending_exception()) {
// we can get an exception only when we run out of metaspace, but that
// shouldn't happen this early in bootstrap.
java_lang_Throwable::print(current->pending_exception(), tty);
vm_exit_during_initialization("AOTClassLocationConfig::dumptime_init_helper() failed unexpectedly");
}
}
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23476#discussion_r1964907863
More information about the serviceability-dev
mailing list