< prev index next >

src/hotspot/share/classfile/moduleEntry.cpp

Print this page

267 
268   // Store pointer to the ModuleEntry in the unnamed module's java.lang.Module object.
269   java_lang_Module::set_module_entry(module, unnamed_module);
270 
271   return unnamed_module;
272 }
273 
274 ModuleEntry* ModuleEntry::create_boot_unnamed_module(ClassLoaderData* cld) {
275   // For the boot loader, the java.lang.Module for the unnamed module
276   // is not known until a call to JVM_SetBootLoaderUnnamedModule is made. At
277   // this point initially create the ModuleEntry for the unnamed module.
278   ModuleEntry* unnamed_module = new_unnamed_module_entry(Handle(), cld);
279   assert(unnamed_module != NULL, "boot loader unnamed module should not be null");
280   return unnamed_module;
281 }
282 
283 // When creating an unnamed module, this is called without holding the Module_lock.
284 // This is okay because the unnamed module gets created before the ClassLoaderData
285 // is available to other threads.
286 ModuleEntry* ModuleEntry::new_unnamed_module_entry(Handle module_handle, ClassLoaderData* cld) {
287   ModuleEntry* entry = (ModuleEntry*) NEW_C_HEAP_ARRAY(char, sizeof(ModuleEntry), mtModule);
288 
289   // Initialize everything BasicHashtable would
290   entry->set_next(NULL);
291   entry->set_hash(0);
292   entry->set_literal(NULL);
293 
294   // Initialize fields specific to a ModuleEntry
295   entry->init();
296 
297   // Unnamed modules can read all other unnamed modules.
298   entry->set_can_read_all_unnamed();
299 
300   if (!module_handle.is_null()) {
301     entry->set_module(cld->add_handle(module_handle));
302   }
303 
304   entry->set_loader_data(cld);
305   entry->_is_open = true;
306 
307   JFR_ONLY(INIT_ID(entry);)

267 
268   // Store pointer to the ModuleEntry in the unnamed module's java.lang.Module object.
269   java_lang_Module::set_module_entry(module, unnamed_module);
270 
271   return unnamed_module;
272 }
273 
274 ModuleEntry* ModuleEntry::create_boot_unnamed_module(ClassLoaderData* cld) {
275   // For the boot loader, the java.lang.Module for the unnamed module
276   // is not known until a call to JVM_SetBootLoaderUnnamedModule is made. At
277   // this point initially create the ModuleEntry for the unnamed module.
278   ModuleEntry* unnamed_module = new_unnamed_module_entry(Handle(), cld);
279   assert(unnamed_module != NULL, "boot loader unnamed module should not be null");
280   return unnamed_module;
281 }
282 
283 // When creating an unnamed module, this is called without holding the Module_lock.
284 // This is okay because the unnamed module gets created before the ClassLoaderData
285 // is available to other threads.
286 ModuleEntry* ModuleEntry::new_unnamed_module_entry(Handle module_handle, ClassLoaderData* cld) {
287   ModuleEntry* entry = NEW_C_HEAP_OBJ(ModuleEntry, mtModule);
288 
289   // Initialize everything BasicHashtable would
290   entry->set_next(NULL);
291   entry->set_hash(0);
292   entry->set_literal(NULL);
293 
294   // Initialize fields specific to a ModuleEntry
295   entry->init();
296 
297   // Unnamed modules can read all other unnamed modules.
298   entry->set_can_read_all_unnamed();
299 
300   if (!module_handle.is_null()) {
301     entry->set_module(cld->add_handle(module_handle));
302   }
303 
304   entry->set_loader_data(cld);
305   entry->_is_open = true;
306 
307   JFR_ONLY(INIT_ID(entry);)
< prev index next >