68 } 69 70 void ProtectionDomainCacheTable::oops_do(OopClosure* f) { 71 for (int index = 0; index < table_size(); index++) { 72 for (ProtectionDomainCacheEntry* probe = bucket(index); 73 probe != NULL; 74 probe = probe->next()) { 75 probe->oops_do(f); 76 } 77 } 78 } 79 80 #ifndef PRODUCT 81 void ProtectionDomainCacheTable::print() { 82 tty->print_cr("Protection domain cache table (table_size=%d, classes=%d)", 83 table_size(), number_of_entries()); 84 for (int index = 0; index < table_size(); index++) { 85 for (ProtectionDomainCacheEntry* probe = bucket(index); 86 probe != NULL; 87 probe = probe->next()) { 88 probe->print(); 89 } 90 } 91 } 92 93 void ProtectionDomainCacheEntry::print() { 94 tty->print_cr("entry " PTR_FORMAT " value " PTR_FORMAT " next " PTR_FORMAT, 95 p2i(this), p2i(literal()), p2i(next())); 96 } 97 #endif 98 99 void ProtectionDomainCacheTable::verify() { 100 verify_table<ProtectionDomainCacheEntry>("Protection Domain Table"); 101 } 102 103 void ProtectionDomainCacheEntry::verify() { 104 guarantee(literal()->is_oop(), "must be an oop"); 105 } 106 107 ProtectionDomainCacheEntry* ProtectionDomainCacheTable::get(Handle protection_domain) { 108 unsigned int hash = compute_hash(protection_domain); 109 int index = hash_to_index(hash); 110 111 ProtectionDomainCacheEntry* entry = find_entry(index, protection_domain); 112 if (entry == NULL) { 113 entry = add_entry(index, hash, protection_domain); 114 } 115 return entry; | 68 } 69 70 void ProtectionDomainCacheTable::oops_do(OopClosure* f) { 71 for (int index = 0; index < table_size(); index++) { 72 for (ProtectionDomainCacheEntry* probe = bucket(index); 73 probe != NULL; 74 probe = probe->next()) { 75 probe->oops_do(f); 76 } 77 } 78 } 79 80 #ifndef PRODUCT 81 void ProtectionDomainCacheTable::print() { 82 tty->print_cr("Protection domain cache table (table_size=%d, classes=%d)", 83 table_size(), number_of_entries()); 84 for (int index = 0; index < table_size(); index++) { 85 for (ProtectionDomainCacheEntry* probe = bucket(index); 86 probe != NULL; 87 probe = probe->next()) { 88 tty->print("%4d: ", index); 89 probe->print(); 90 } 91 } 92 } 93 94 void ProtectionDomainCacheEntry::print() { 95 tty->print_cr("protection_domain: " PTR_FORMAT, p2i(literal())); 96 } 97 #endif 98 99 void ProtectionDomainCacheTable::verify() { 100 verify_table<ProtectionDomainCacheEntry>("Protection Domain Table"); 101 } 102 103 void ProtectionDomainCacheEntry::verify() { 104 guarantee(literal()->is_oop(), "must be an oop"); 105 } 106 107 ProtectionDomainCacheEntry* ProtectionDomainCacheTable::get(Handle protection_domain) { 108 unsigned int hash = compute_hash(protection_domain); 109 int index = hash_to_index(hash); 110 111 ProtectionDomainCacheEntry* entry = find_entry(index, protection_domain); 112 if (entry == NULL) { 113 entry = add_entry(index, hash, protection_domain); 114 } 115 return entry; |