--- old/src/hotspot/share/classfile/javaClasses.cpp 2020-08-31 08:09:12.207348995 -0700 +++ new/src/hotspot/share/classfile/javaClasses.cpp 2020-08-31 08:09:11.983340563 -0700 @@ -3393,12 +3393,17 @@ module->obj_field_put(_name_offset, value); } -ModuleEntry* java_lang_Module::module_entry(oop module) { +ModuleEntry* java_lang_Module::module_entry_raw(oop module) { assert(_module_entry_offset != 0, "Uninitialized module_entry_offset"); assert(module != NULL, "module can't be null"); assert(oopDesc::is_oop(module), "module must be oop"); ModuleEntry* module_entry = (ModuleEntry*)module->address_field(_module_entry_offset); + return module_entry; +} + +ModuleEntry* java_lang_Module::module_entry(oop module) { + ModuleEntry* module_entry = module_entry_raw(module); if (module_entry == NULL) { // If the inject field containing the ModuleEntry* is null then return the // class loader's unnamed module. @@ -4822,7 +4827,6 @@ Klass* klass = obj->klass(); if (klass == SystemDictionary::ClassLoader_klass() || // ClassLoader::loader_data is malloc'ed. - klass == SystemDictionary::Module_klass() || // Module::module_entry is malloc'ed // The next 3 classes are used to implement java.lang.invoke, and are not used directly in // regular Java code. The implementation of java.lang.invoke uses generated anonymoys classes // (e.g., as referenced by ResolvedMethodName::vmholder) that are not yet supported by CDS.