Skip to content

Commit 66836d4

Browse files
committed
8361292: Rename ModuleEntry::module() to module_oop()
Reviewed-by: coleenp, ccheung, sspitsyn
1 parent 3daa03c commit 66836d4

File tree

12 files changed

+35
-35
lines changed

12 files changed

+35
-35
lines changed

src/hotspot/share/classfile/classFileParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5176,7 +5176,7 @@ void ClassFileParser::fill_instance_klass(InstanceKlass* ik,
51765176
assert(module_entry != nullptr, "module_entry should always be set");
51775177

51785178
// Obtain java.lang.Module
5179-
Handle module_handle(THREAD, module_entry->module());
5179+
Handle module_handle(THREAD, module_entry->module_oop());
51805180

51815181
// Allocate mirror and initialize static fields
51825182
java_lang_Class::create_mirror(ik,

src/hotspot/share/classfile/classLoaderDataShared.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ void ClassLoaderDataShared::clear_archived_oops() {
208208
oop ClassLoaderDataShared::restore_archived_oops_for_null_class_loader_data() {
209209
assert(CDSConfig::is_using_full_module_graph(), "must be");
210210
_archived_boot_loader_data.restore(null_class_loader_data(), false, true);
211-
return _archived_javabase_moduleEntry->module();
211+
return _archived_javabase_moduleEntry->module_oop();
212212
}
213213

214214
void ClassLoaderDataShared::restore_java_platform_loader_from_archive(ClassLoaderData* loader_data) {

src/hotspot/share/classfile/javaClasses.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,15 +1036,15 @@ void java_lang_Class::set_mirror_module_field(JavaThread* current, Klass* k, Han
10361036
// If java.base was already defined then patch this particular class with java.base.
10371037
if (javabase_was_defined) {
10381038
ModuleEntry *javabase_entry = ModuleEntryTable::javabase_moduleEntry();
1039-
assert(javabase_entry != nullptr && javabase_entry->module() != nullptr,
1039+
assert(javabase_entry != nullptr && javabase_entry->module_oop() != nullptr,
10401040
"Setting class module field, " JAVA_BASE_NAME " should be defined");
1041-
Handle javabase_handle(current, javabase_entry->module());
1041+
Handle javabase_handle(current, javabase_entry->module_oop());
10421042
set_module(mirror(), javabase_handle());
10431043
}
10441044
} else {
10451045
assert(Universe::is_module_initialized() ||
10461046
(ModuleEntryTable::javabase_defined() &&
1047-
(module() == ModuleEntryTable::javabase_moduleEntry()->module())),
1047+
(module() == ModuleEntryTable::javabase_moduleEntry()->module_oop())),
10481048
"Incorrect java.lang.Module specification while creating mirror");
10491049
set_module(mirror(), module());
10501050
}

src/hotspot/share/classfile/moduleEntry.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
ModuleEntry* ModuleEntryTable::_javabase_module = nullptr;
5151

52-
oop ModuleEntry::module() const { return _module.resolve(); }
52+
oop ModuleEntry::module_oop() const { return _module_handle.resolve(); }
5353

5454
void ModuleEntry::set_location(Symbol* location) {
5555
// _location symbol's refcounts are managed by ModuleEntry,
@@ -284,7 +284,7 @@ ModuleEntry::ModuleEntry(Handle module_handle,
284284
}
285285

286286
if (!module_handle.is_null()) {
287-
_module = loader_data->add_handle(module_handle);
287+
_module_handle = loader_data->add_handle(module_handle);
288288
}
289289

290290
set_version(version);
@@ -401,7 +401,7 @@ ModuleEntry* ModuleEntry::allocate_archived_entry() const {
401401
memcpy((void*)archived_entry, (void*)this, sizeof(ModuleEntry));
402402

403403
if (CDSConfig::is_dumping_full_module_graph()) {
404-
archived_entry->_archived_module_index = HeapShared::append_root(module());
404+
archived_entry->_archived_module_index = HeapShared::append_root(module_oop());
405405
} else {
406406
archived_entry->_archived_module_index = -1;
407407
}
@@ -422,7 +422,7 @@ ModuleEntry* ModuleEntry::allocate_archived_entry() const {
422422

423423
// Clear handles and restore at run time. Handles cannot be archived.
424424
OopHandle null_handle;
425-
archived_entry->_module = null_handle;
425+
archived_entry->_module_handle = null_handle;
426426

427427
// For verify_archived_module_entries()
428428
DEBUG_ONLY(_num_inited_module_entries++);
@@ -526,7 +526,7 @@ void ModuleEntry::restore_archived_oops(ClassLoaderData* loader_data) {
526526
assert(CDSConfig::is_using_archive(), "runtime only");
527527
Handle module_handle(Thread::current(), HeapShared::get_root(_archived_module_index, /*clear=*/true));
528528
assert(module_handle.not_null(), "huh");
529-
set_module(loader_data->add_handle(module_handle));
529+
set_module_handle(loader_data->add_handle(module_handle));
530530

531531
// This was cleared to zero during dump time -- we didn't save the value
532532
// because it may be affected by archive relocation.
@@ -662,7 +662,7 @@ void ModuleEntryTable::finalize_javabase(Handle module_handle, Symbol* version,
662662
jb_module->set_location(location);
663663
// Once java.base's ModuleEntry _module field is set with the known
664664
// java.lang.Module, java.base is considered "defined" to the VM.
665-
jb_module->set_module(boot_loader_data->add_handle(module_handle));
665+
jb_module->set_module_handle(boot_loader_data->add_handle(module_handle));
666666

667667
// Store pointer to the ModuleEntry for java.base in the java.lang.Module object.
668668
java_lang_Module::set_module_entry(module_handle(), jb_module);
@@ -700,7 +700,7 @@ void ModuleEntryTable::patch_javabase_entries(JavaThread* current, Handle module
700700
// We allow -XX:ArchiveHeapTestClass to archive additional classes
701701
// into the CDS heap, but these must be in the unnamed module.
702702
ModuleEntry* unnamed_module = ClassLoaderData::the_null_class_loader_data()->unnamed_module();
703-
Handle unnamed_module_handle(current, unnamed_module->module());
703+
Handle unnamed_module_handle(current, unnamed_module->module_oop());
704704
java_lang_Class::fixup_module_field(k, unnamed_module_handle);
705705
} else
706706
#endif
@@ -745,7 +745,7 @@ void ModuleEntry::print(outputStream* st) {
745745
st->print_cr("entry " PTR_FORMAT " name %s module " PTR_FORMAT " loader %s version %s location %s strict %s",
746746
p2i(this),
747747
name_as_C_string(),
748-
p2i(module()),
748+
p2i(module_oop()),
749749
loader_data()->loader_name_and_id(),
750750
version() != nullptr ? version()->as_C_string() : "nullptr",
751751
location() != nullptr ? location()->as_C_string() : "nullptr",

src/hotspot/share/classfile/moduleEntry.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class ModuleClosure;
5353
// A ModuleEntry describes a module that has been defined by a call to JVM_DefineModule.
5454
// It contains:
5555
// - Symbol* containing the module's name.
56-
// - pointer to the java.lang.Module for this module.
56+
// - pointer to the java.lang.Module: the representation of this module as a Java object
5757
// - pointer to the java.security.ProtectionDomain shared by classes defined to this module.
5858
// - ClassLoaderData*, class loader of this module.
5959
// - a growable array containing other module entries that this module can read.
@@ -63,7 +63,7 @@ class ModuleClosure;
6363
// data structure. This lock must be taken on all accesses to either table.
6464
class ModuleEntry : public CHeapObj<mtModule> {
6565
private:
66-
OopHandle _module; // java.lang.Module
66+
OopHandle _module_handle; // java.lang.Module
6767
OopHandle _shared_pd; // java.security.ProtectionDomain, cached
6868
// for shared classes from this module
6969
Symbol* _name; // name of this module
@@ -96,9 +96,9 @@ class ModuleEntry : public CHeapObj<mtModule> {
9696
~ModuleEntry();
9797

9898
Symbol* name() const { return _name; }
99-
oop module() const;
100-
OopHandle module_handle() const { return _module; }
101-
void set_module(OopHandle j) { _module = j; }
99+
oop module_oop() const;
100+
OopHandle module_handle() const { return _module_handle; }
101+
void set_module_handle(OopHandle j) { _module_handle = j; }
102102

103103
// The shared ProtectionDomain reference is set once the VM loads a shared class
104104
// originated from the current Module. The referenced ProtectionDomain object is
@@ -262,7 +262,7 @@ class ModuleEntryTable : public CHeapObj<mtModule> {
262262
}
263263

264264
static bool javabase_defined() { return ((_javabase_module != nullptr) &&
265-
(_javabase_module->module() != nullptr)); }
265+
(_javabase_module->module_oop() != nullptr)); }
266266
static void finalize_javabase(Handle module_handle, Symbol* version, Symbol* location);
267267
static void patch_javabase_entries(JavaThread* current, Handle module_handle);
268268

src/hotspot/share/classfile/modules.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ void Modules::set_bootloader_unnamed_module(Handle module, TRAPS) {
773773
ClassLoaderData* boot_loader_data = ClassLoaderData::the_null_class_loader_data();
774774
ModuleEntry* unnamed_module = boot_loader_data->unnamed_module();
775775
assert(unnamed_module != nullptr, "boot loader's unnamed ModuleEntry not defined");
776-
unnamed_module->set_module(boot_loader_data->add_handle(module));
776+
unnamed_module->set_module_handle(boot_loader_data->add_handle(module));
777777
// Store pointer to the ModuleEntry in the unnamed module's java.lang.Module object.
778778
java_lang_Module::set_module_entry(module(), unnamed_module);
779779
}
@@ -954,8 +954,8 @@ oop Modules::get_named_module(Handle h_loader, const char* package_name) {
954954
get_package_entry_by_name(package_sym, h_loader);
955955
const ModuleEntry* const module_entry = (pkg_entry != nullptr ? pkg_entry->module() : nullptr);
956956

957-
if (module_entry != nullptr && module_entry->module() != nullptr && module_entry->is_named()) {
958-
return module_entry->module();
957+
if (module_entry != nullptr && module_entry->module_oop() != nullptr && module_entry->is_named()) {
958+
return module_entry->module_oop();
959959
}
960960
return nullptr;
961961
}

src/hotspot/share/jfr/jni/jfrUpcalls.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ ClassFileStream* JfrUpcalls::on_method_trace(InstanceKlass* ik, const ClassFileS
237237
ModuleEntry* module_entry = ik->module();
238238
oop module = nullptr;
239239
if (module_entry != nullptr) {
240-
module = module_entry->module();
240+
module = module_entry->module_oop();
241241
}
242242
instanceHandle module_handle(THREAD, (instanceOop)module);
243243

src/hotspot/share/jvmci/jvmciCompiler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ bool JVMCICompiler::force_comp_at_level_simple(const methodHandle& method) {
144144
if (excludeModules.not_null()) {
145145
ModuleEntry* moduleEntry = method->method_holder()->module();
146146
for (int i = 0; i < excludeModules->length(); i++) {
147-
if (excludeModules->obj_at(i) == moduleEntry->module()) {
147+
if (excludeModules->obj_at(i) == moduleEntry->module_oop()) {
148148
return true;
149149
}
150150
}

src/hotspot/share/oops/arrayKlass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ void ArrayKlass::complete_create_array_klass(ArrayKlass* k, Klass* super_klass,
120120
// java.base is defined.
121121
assert((module_entry != nullptr) || ((module_entry == nullptr) && !ModuleEntryTable::javabase_defined()),
122122
"module entry not available post " JAVA_BASE_NAME " definition");
123-
oop module = (module_entry != nullptr) ? module_entry->module() : (oop)nullptr;
124-
java_lang_Class::create_mirror(k, Handle(THREAD, k->class_loader()), Handle(THREAD, module), Handle(), Handle(), CHECK);
123+
oop module_oop = (module_entry != nullptr) ? module_entry->module_oop() : (oop)nullptr;
124+
java_lang_Class::create_mirror(k, Handle(THREAD, k->class_loader()), Handle(THREAD, module_oop), Handle(), Handle(), CHECK);
125125
}
126126

127127
ArrayKlass* ArrayKlass::array_klass(int n, TRAPS) {

src/hotspot/share/oops/klass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ void Klass::restore_unshareable_info(ClassLoaderData* loader_data, Handle protec
896896
module_entry = ModuleEntryTable::javabase_moduleEntry();
897897
}
898898
// Obtain java.lang.Module, if available
899-
Handle module_handle(THREAD, ((module_entry != nullptr) ? module_entry->module() : (oop)nullptr));
899+
Handle module_handle(THREAD, ((module_entry != nullptr) ? module_entry->module_oop() : (oop)nullptr));
900900

901901
if (this->has_archived_mirror_index()) {
902902
ResourceMark rm(THREAD);

0 commit comments

Comments
 (0)