< prev index next >

src/hotspot/share/classfile/moduleEntry.cpp

Print this page


 335 
 336       // Clean out the C heap allocated reads list first before freeing the entry
 337       to_remove->delete_reads();
 338       if (to_remove->name() != NULL) {
 339         to_remove->name()->decrement_refcount();
 340       }
 341       if (to_remove->version() != NULL) {
 342         to_remove->version()->decrement_refcount();
 343       }
 344       if (to_remove->location() != NULL) {
 345         to_remove->location()->decrement_refcount();
 346       }
 347 
 348       // Unlink from the Hashtable prior to freeing
 349       unlink_entry(to_remove);
 350       FREE_C_HEAP_ARRAY(char, to_remove);
 351     }
 352   }
 353   assert(number_of_entries() == 0, "should have removed all entries");
 354   assert(new_entry_free_list() == NULL, "entry present on ModuleEntryTable's free list");
 355   free_buckets();
 356 }
 357 
 358 ModuleEntry* ModuleEntryTable::new_entry(unsigned int hash, Handle module_handle,
 359                                          bool is_open, Symbol* name,
 360                                          Symbol* version, Symbol* location,
 361                                          ClassLoaderData* loader_data) {
 362   assert(Module_lock->owned_by_self(), "should have the Module_lock");
 363   ModuleEntry* entry = (ModuleEntry*)Hashtable<Symbol*, mtModule>::allocate_new_entry(hash, name);
 364 
 365   // Initialize fields specific to a ModuleEntry
 366   entry->init();
 367   if (name != NULL) {
 368     name->increment_refcount();
 369   } else {
 370     // Unnamed modules can read all other unnamed modules.
 371     entry->set_can_read_all_unnamed();
 372   }
 373 
 374   if (!module_handle.is_null()) {
 375     entry->set_module(loader_data->add_handle(module_handle));




 335 
 336       // Clean out the C heap allocated reads list first before freeing the entry
 337       to_remove->delete_reads();
 338       if (to_remove->name() != NULL) {
 339         to_remove->name()->decrement_refcount();
 340       }
 341       if (to_remove->version() != NULL) {
 342         to_remove->version()->decrement_refcount();
 343       }
 344       if (to_remove->location() != NULL) {
 345         to_remove->location()->decrement_refcount();
 346       }
 347 
 348       // Unlink from the Hashtable prior to freeing
 349       unlink_entry(to_remove);
 350       FREE_C_HEAP_ARRAY(char, to_remove);
 351     }
 352   }
 353   assert(number_of_entries() == 0, "should have removed all entries");
 354   assert(new_entry_free_list() == NULL, "entry present on ModuleEntryTable's free list");

 355 }
 356 
 357 ModuleEntry* ModuleEntryTable::new_entry(unsigned int hash, Handle module_handle,
 358                                          bool is_open, Symbol* name,
 359                                          Symbol* version, Symbol* location,
 360                                          ClassLoaderData* loader_data) {
 361   assert(Module_lock->owned_by_self(), "should have the Module_lock");
 362   ModuleEntry* entry = (ModuleEntry*)Hashtable<Symbol*, mtModule>::allocate_new_entry(hash, name);
 363 
 364   // Initialize fields specific to a ModuleEntry
 365   entry->init();
 366   if (name != NULL) {
 367     name->increment_refcount();
 368   } else {
 369     // Unnamed modules can read all other unnamed modules.
 370     entry->set_can_read_all_unnamed();
 371   }
 372 
 373   if (!module_handle.is_null()) {
 374     entry->set_module(loader_data->add_handle(module_handle));


< prev index next >