mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8155672: Remove instanceKlassHandles and KlassHandles
Use unhandled pointers for Klass and InstanceKlass, remove handles with no implementation. Reviewed-by: dholmes, lfoltan, vlivanov, sspitsyn
This commit is contained in:
parent
7bca463789
commit
4b9562288f
152 changed files with 1892 additions and 2112 deletions
|
@ -46,7 +46,7 @@ size_t Dictionary::entry_size() {
|
|||
}
|
||||
|
||||
Dictionary::Dictionary(int table_size)
|
||||
: TwoOopHashtable<Klass*, mtClass>(table_size, (int)entry_size()) {
|
||||
: TwoOopHashtable<InstanceKlass*, mtClass>(table_size, (int)entry_size()) {
|
||||
_current_class_index = 0;
|
||||
_current_class_entry = NULL;
|
||||
_pd_cache_table = new ProtectionDomainCacheTable(defaultProtectionDomainCacheSize);
|
||||
|
@ -55,7 +55,7 @@ Dictionary::Dictionary(int table_size)
|
|||
|
||||
Dictionary::Dictionary(int table_size, HashtableBucket<mtClass>* t,
|
||||
int number_of_entries)
|
||||
: TwoOopHashtable<Klass*, mtClass>(table_size, (int)entry_size(), t, number_of_entries) {
|
||||
: TwoOopHashtable<InstanceKlass*, mtClass>(table_size, (int)entry_size(), t, number_of_entries) {
|
||||
_current_class_index = 0;
|
||||
_current_class_entry = NULL;
|
||||
_pd_cache_table = new ProtectionDomainCacheTable(defaultProtectionDomainCacheSize);
|
||||
|
@ -65,9 +65,9 @@ ProtectionDomainCacheEntry* Dictionary::cache_get(Handle protection_domain) {
|
|||
return _pd_cache_table->get(protection_domain);
|
||||
}
|
||||
|
||||
DictionaryEntry* Dictionary::new_entry(unsigned int hash, Klass* klass,
|
||||
DictionaryEntry* Dictionary::new_entry(unsigned int hash, InstanceKlass* klass,
|
||||
ClassLoaderData* loader_data) {
|
||||
DictionaryEntry* entry = (DictionaryEntry*)Hashtable<Klass*, mtClass>::new_entry(hash, klass);
|
||||
DictionaryEntry* entry = (DictionaryEntry*)Hashtable<InstanceKlass*, mtClass>::new_entry(hash, klass);
|
||||
entry->set_loader_data(loader_data);
|
||||
entry->set_pd_set(NULL);
|
||||
assert(klass->is_instance_klass(), "Must be");
|
||||
|
@ -85,7 +85,7 @@ void Dictionary::free_entry(DictionaryEntry* entry) {
|
|||
entry->set_pd_set(to_delete->next());
|
||||
delete to_delete;
|
||||
}
|
||||
Hashtable<Klass*, mtClass>::free_entry(entry);
|
||||
Hashtable<InstanceKlass*, mtClass>::free_entry(entry);
|
||||
}
|
||||
|
||||
|
||||
|
@ -351,10 +351,10 @@ void Dictionary::unlink(BoolObjectClosure* is_alive) {
|
|||
_pd_cache_table->unlink(is_alive);
|
||||
}
|
||||
|
||||
Klass* Dictionary::try_get_next_class() {
|
||||
InstanceKlass* Dictionary::try_get_next_class() {
|
||||
while (true) {
|
||||
if (_current_class_entry != NULL) {
|
||||
Klass* k = _current_class_entry->klass();
|
||||
InstanceKlass* k = _current_class_entry->klass();
|
||||
_current_class_entry = _current_class_entry->next();
|
||||
return k;
|
||||
}
|
||||
|
@ -371,15 +371,15 @@ Klass* Dictionary::try_get_next_class() {
|
|||
// by the compilers.
|
||||
|
||||
void Dictionary::add_klass(Symbol* class_name, ClassLoaderData* loader_data,
|
||||
KlassHandle obj) {
|
||||
InstanceKlass* obj) {
|
||||
assert_locked_or_safepoint(SystemDictionary_lock);
|
||||
assert(obj() != NULL, "adding NULL obj");
|
||||
assert(obj()->name() == class_name, "sanity check on name");
|
||||
assert(obj != NULL, "adding NULL obj");
|
||||
assert(obj->name() == class_name, "sanity check on name");
|
||||
assert(loader_data != NULL, "Must be non-NULL");
|
||||
|
||||
unsigned int hash = compute_hash(class_name, loader_data);
|
||||
int index = hash_to_index(hash);
|
||||
DictionaryEntry* entry = new_entry(hash, obj(), loader_data);
|
||||
DictionaryEntry* entry = new_entry(hash, obj, loader_data);
|
||||
add_entry(index, entry);
|
||||
}
|
||||
|
||||
|
@ -410,8 +410,8 @@ DictionaryEntry* Dictionary::get_entry(int index, unsigned int hash,
|
|||
}
|
||||
|
||||
|
||||
Klass* Dictionary::find(int index, unsigned int hash, Symbol* name,
|
||||
ClassLoaderData* loader_data, Handle protection_domain, TRAPS) {
|
||||
InstanceKlass* Dictionary::find(int index, unsigned int hash, Symbol* name,
|
||||
ClassLoaderData* loader_data, Handle protection_domain, TRAPS) {
|
||||
DictionaryEntry* entry = get_entry(index, hash, name, loader_data);
|
||||
if (entry != NULL && entry->is_valid_protection_domain(protection_domain)) {
|
||||
return entry->klass();
|
||||
|
@ -421,30 +421,30 @@ Klass* Dictionary::find(int index, unsigned int hash, Symbol* name,
|
|||
}
|
||||
|
||||
|
||||
Klass* Dictionary::find_class(int index, unsigned int hash,
|
||||
Symbol* name, ClassLoaderData* loader_data) {
|
||||
InstanceKlass* Dictionary::find_class(int index, unsigned int hash,
|
||||
Symbol* name, ClassLoaderData* loader_data) {
|
||||
assert_locked_or_safepoint(SystemDictionary_lock);
|
||||
assert (index == index_for(name, loader_data), "incorrect index?");
|
||||
|
||||
DictionaryEntry* entry = get_entry(index, hash, name, loader_data);
|
||||
return (entry != NULL) ? entry->klass() : (Klass*)NULL;
|
||||
return (entry != NULL) ? entry->klass() : NULL;
|
||||
}
|
||||
|
||||
|
||||
// Variant of find_class for shared classes. No locking required, as
|
||||
// that table is static.
|
||||
|
||||
Klass* Dictionary::find_shared_class(int index, unsigned int hash,
|
||||
Symbol* name) {
|
||||
InstanceKlass* Dictionary::find_shared_class(int index, unsigned int hash,
|
||||
Symbol* name) {
|
||||
assert (index == index_for(name, NULL), "incorrect index?");
|
||||
|
||||
DictionaryEntry* entry = get_entry(index, hash, name, NULL);
|
||||
return (entry != NULL) ? entry->klass() : (Klass*)NULL;
|
||||
return (entry != NULL) ? entry->klass() : NULL;
|
||||
}
|
||||
|
||||
|
||||
void Dictionary::add_protection_domain(int index, unsigned int hash,
|
||||
instanceKlassHandle klass,
|
||||
InstanceKlass* klass,
|
||||
ClassLoaderData* loader_data, Handle protection_domain,
|
||||
TRAPS) {
|
||||
Symbol* klass_name = klass->name();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue