< prev index next >

src/share/vm/classfile/moduleEntry.cpp

Print this page




 322       }
 323       if (to_remove->location() != NULL) {
 324         to_remove->location()->decrement_refcount();
 325       }
 326 
 327       // Unlink from the Hashtable prior to freeing
 328       unlink_entry(to_remove);
 329       FREE_C_HEAP_ARRAY(char, to_remove);
 330     }
 331   }
 332   assert(number_of_entries() == 0, "should have removed all entries");
 333   assert(new_entry_free_list() == NULL, "entry present on ModuleEntryTable's free list");
 334   free_buckets();
 335 }
 336 
 337 ModuleEntry* ModuleEntryTable::new_entry(unsigned int hash, Handle module_handle,
 338                                          bool is_open, Symbol* name,
 339                                          Symbol* version, Symbol* location,
 340                                          ClassLoaderData* loader_data) {
 341   assert(Module_lock->owned_by_self(), "should have the Module_lock");
 342   ModuleEntry* entry = (ModuleEntry*) NEW_C_HEAP_ARRAY(char, entry_size(), mtModule);
 343 
 344   // Initialize everything BasicHashtable would
 345   entry->set_next(NULL);
 346   entry->set_hash(hash);
 347   entry->set_literal(name);
 348 
 349   // Initialize fields specific to a ModuleEntry
 350   entry->init();
 351   if (name != NULL) {
 352     name->increment_refcount();
 353   } else {
 354     // Unnamed modules can read all other unnamed modules.
 355     entry->set_can_read_all_unnamed();
 356   }
 357 
 358   if (!module_handle.is_null()) {
 359     entry->set_module(loader_data->add_handle(module_handle));
 360   }
 361 
 362   entry->set_loader_data(loader_data);
 363   entry->set_version(version);
 364   entry->set_location(location);
 365   entry->set_is_open(is_open);
 366 
 367   if (ClassLoader::is_in_patch_mod_entries(name)) {




 322       }
 323       if (to_remove->location() != NULL) {
 324         to_remove->location()->decrement_refcount();
 325       }
 326 
 327       // Unlink from the Hashtable prior to freeing
 328       unlink_entry(to_remove);
 329       FREE_C_HEAP_ARRAY(char, to_remove);
 330     }
 331   }
 332   assert(number_of_entries() == 0, "should have removed all entries");
 333   assert(new_entry_free_list() == NULL, "entry present on ModuleEntryTable's free list");
 334   free_buckets();
 335 }
 336 
 337 ModuleEntry* ModuleEntryTable::new_entry(unsigned int hash, Handle module_handle,
 338                                          bool is_open, Symbol* name,
 339                                          Symbol* version, Symbol* location,
 340                                          ClassLoaderData* loader_data) {
 341   assert(Module_lock->owned_by_self(), "should have the Module_lock");
 342   ModuleEntry* entry = (ModuleEntry*)Hashtable<Symbol*, mtModule>::allocate_new_entry(hash, name);





 343 
 344   // Initialize fields specific to a ModuleEntry
 345   entry->init();
 346   if (name != NULL) {
 347     name->increment_refcount();
 348   } else {
 349     // Unnamed modules can read all other unnamed modules.
 350     entry->set_can_read_all_unnamed();
 351   }
 352 
 353   if (!module_handle.is_null()) {
 354     entry->set_module(loader_data->add_handle(module_handle));
 355   }
 356 
 357   entry->set_loader_data(loader_data);
 358   entry->set_version(version);
 359   entry->set_location(location);
 360   entry->set_is_open(is_open);
 361 
 362   if (ClassLoader::is_in_patch_mod_entries(name)) {


< prev index next >