< prev index next >

src/share/vm/classfile/protectionDomainCache.cpp

Print this page




  80   }
  81 }
  82 
  83 void ProtectionDomainCacheTable::print_on(outputStream* st) const {
  84   st->print_cr("Protection domain cache table (table_size=%d, classes=%d)",
  85                table_size(), number_of_entries());
  86   for (int index = 0; index < table_size(); index++) {
  87     for (ProtectionDomainCacheEntry* probe = bucket(index);
  88                                      probe != NULL;
  89                                      probe = probe->next()) {
  90       st->print_cr("%4d: protection_domain: " PTR_FORMAT, index, p2i(probe->literal()));
  91     }
  92   }
  93 }
  94 
  95 void ProtectionDomainCacheTable::verify() {
  96   verify_table<ProtectionDomainCacheEntry>("Protection Domain Table");
  97 }
  98 
  99 void ProtectionDomainCacheEntry::verify() {
 100   guarantee(literal()->is_oop(), "must be an oop");
 101 }
 102 
 103 ProtectionDomainCacheEntry* ProtectionDomainCacheTable::get(Handle protection_domain) {
 104   unsigned int hash = compute_hash(protection_domain);
 105   int index = hash_to_index(hash);
 106 
 107   ProtectionDomainCacheEntry* entry = find_entry(index, protection_domain);
 108   if (entry == NULL) {
 109     entry = add_entry(index, hash, protection_domain);
 110   }
 111   return entry;
 112 }
 113 
 114 ProtectionDomainCacheEntry* ProtectionDomainCacheTable::find_entry(int index, Handle protection_domain) {
 115   for (ProtectionDomainCacheEntry* e = bucket(index); e != NULL; e = e->next()) {
 116     if (e->protection_domain() == protection_domain()) {
 117       return e;
 118     }
 119   }
 120 


  80   }
  81 }
  82 
  83 void ProtectionDomainCacheTable::print_on(outputStream* st) const {
  84   st->print_cr("Protection domain cache table (table_size=%d, classes=%d)",
  85                table_size(), number_of_entries());
  86   for (int index = 0; index < table_size(); index++) {
  87     for (ProtectionDomainCacheEntry* probe = bucket(index);
  88                                      probe != NULL;
  89                                      probe = probe->next()) {
  90       st->print_cr("%4d: protection_domain: " PTR_FORMAT, index, p2i(probe->literal()));
  91     }
  92   }
  93 }
  94 
  95 void ProtectionDomainCacheTable::verify() {
  96   verify_table<ProtectionDomainCacheEntry>("Protection Domain Table");
  97 }
  98 
  99 void ProtectionDomainCacheEntry::verify() {
 100   guarantee(oopDesc::is_oop(literal()), "must be an oop");
 101 }
 102 
 103 ProtectionDomainCacheEntry* ProtectionDomainCacheTable::get(Handle protection_domain) {
 104   unsigned int hash = compute_hash(protection_domain);
 105   int index = hash_to_index(hash);
 106 
 107   ProtectionDomainCacheEntry* entry = find_entry(index, protection_domain);
 108   if (entry == NULL) {
 109     entry = add_entry(index, hash, protection_domain);
 110   }
 111   return entry;
 112 }
 113 
 114 ProtectionDomainCacheEntry* ProtectionDomainCacheTable::find_entry(int index, Handle protection_domain) {
 115   for (ProtectionDomainCacheEntry* e = bucket(index); e != NULL; e = e->next()) {
 116     if (e->protection_domain() == protection_domain()) {
 117       return e;
 118     }
 119   }
 120 
< prev index next >