PlaceholderEntry* PlaceholderTable::new_entry(int hash, symbolOop name, oop loader, bool havesupername, symbolOop supername) { PlaceholderEntry* entry = (PlaceholderEntry*)Hashtable::new_entry(hash, name); entry->set_loader(loader); entry->set_havesupername(havesupername); entry->set_supername(supername); entry->set_superThreadQ(NULL); entry->set_loadInstanceThreadQ(NULL); entry->set_defineThreadQ(NULL); entry->set_definer(NULL); entry->set_instanceKlass(NULL); return entry; }
// find_and_add returns probe pointer - old or new // If no entry exists, add a placeholder entry // If entry exists, reuse entry // For both, push SeenThread for classloadAction // if havesupername: this is used for circularity for instanceklass loading PlaceholderEntry* PlaceholderTable::find_and_add(int index, unsigned int hash, symbolHandle name, Handle loader, classloadAction action, symbolHandle supername, Thread* thread) { PlaceholderEntry* probe = get_entry(index, hash, name, loader); if (probe == NULL) { // Nothing found, add place holder add_entry(index, hash, name, loader, (action == LOAD_SUPER), supername); probe = get_entry(index, hash, name, loader); } else { if (action == LOAD_SUPER) { probe->set_havesupername(true); probe->set_supername(supername()); } } if (probe) probe->add_seen_thread(thread, action); return probe; }
PlaceholderEntry* PlaceholderTable::new_entry(int hash, Symbol* name, ClassLoaderData* loader_data, bool havesupername, Symbol* supername) { PlaceholderEntry* entry = (PlaceholderEntry*)Hashtable<Symbol*, mtClass>::new_entry(hash, name); // Hashtable with Symbol* literal must increment and decrement refcount. name->increment_refcount(); entry->set_loader_data(loader_data); entry->set_havesupername(havesupername); entry->set_supername(supername); entry->set_superThreadQ(NULL); entry->set_loadInstanceThreadQ(NULL); entry->set_defineThreadQ(NULL); entry->set_definer(NULL); entry->set_instance_klass(NULL); return entry; }