hotspot/src/share/vm/classfile/dictionary.hpp
changeset 46380 4a51438196cf
parent 46329 53ccc37bda19
child 46382 5520c435279b
equal deleted inserted replaced
46379:43ec76e10184 46380:4a51438196cf
    73   Dictionary(int table_size);
    73   Dictionary(int table_size);
    74   Dictionary(int table_size, HashtableBucket<mtClass>* t, int number_of_entries);
    74   Dictionary(int table_size, HashtableBucket<mtClass>* t, int number_of_entries);
    75 
    75 
    76   DictionaryEntry* new_entry(unsigned int hash, InstanceKlass* klass, ClassLoaderData* loader_data);
    76   DictionaryEntry* new_entry(unsigned int hash, InstanceKlass* klass, ClassLoaderData* loader_data);
    77 
    77 
    78   DictionaryEntry* new_entry();
       
    79 
       
    80   void free_entry(DictionaryEntry* entry);
    78   void free_entry(DictionaryEntry* entry);
    81 
    79 
    82   void add_klass(Symbol* class_name, ClassLoaderData* loader_data, InstanceKlass* obj);
    80   void add_klass(Symbol* class_name, ClassLoaderData* loader_data, InstanceKlass* obj);
    83 
    81 
    84   InstanceKlass* find_class(int index, unsigned int hash,
    82   InstanceKlass* find_class(int index, unsigned int hash,
    92   // GC support
    90   // GC support
    93   void oops_do(OopClosure* f);
    91   void oops_do(OopClosure* f);
    94   void always_strong_oops_do(OopClosure* blk);
    92   void always_strong_oops_do(OopClosure* blk);
    95   void roots_oops_do(OopClosure* strong, OopClosure* weak);
    93   void roots_oops_do(OopClosure* strong, OopClosure* weak);
    96 
    94 
    97   void always_strong_classes_do(KlassClosure* closure);
       
    98 
       
    99   void classes_do(void f(Klass*));
    95   void classes_do(void f(Klass*));
   100   void classes_do(void f(Klass*, TRAPS), TRAPS);
    96   void classes_do(void f(Klass*, TRAPS), TRAPS);
   101   void classes_do(void f(Klass*, ClassLoaderData*));
    97   void classes_do(void f(Klass*, ClassLoaderData*));
   102 
       
   103   void methods_do(void f(Method*));
       
   104 
    98 
   105   void unlink(BoolObjectClosure* is_alive);
    99   void unlink(BoolObjectClosure* is_alive);
   106   void remove_classes_in_error_state();
   100   void remove_classes_in_error_state();
   107 
   101 
   108   // Classes loaded by the bootstrap loader are always strongly reachable.
   102   // Classes loaded by the bootstrap loader are always strongly reachable.
   209 public:
   203 public:
   210 
   204 
   211   ProtectionDomainCacheTable(int table_size);
   205   ProtectionDomainCacheTable(int table_size);
   212 
   206 
   213   ProtectionDomainCacheEntry* get(Handle protection_domain);
   207   ProtectionDomainCacheEntry* get(Handle protection_domain);
   214   void free(ProtectionDomainCacheEntry* entry);
       
   215 
   208 
   216   void unlink(BoolObjectClosure* cl);
   209   void unlink(BoolObjectClosure* cl);
   217 
   210 
   218   // GC support
   211   // GC support
   219   void oops_do(OopClosure* f);
   212   void oops_do(OopClosure* f);
   276   bool contains_protection_domain(oop protection_domain) const;
   269   bool contains_protection_domain(oop protection_domain) const;
   277   // Adds a protection domain to the approved set.
   270   // Adds a protection domain to the approved set.
   278   void add_protection_domain(Dictionary* dict, Handle protection_domain);
   271   void add_protection_domain(Dictionary* dict, Handle protection_domain);
   279 
   272 
   280   InstanceKlass* klass() const { return (InstanceKlass*)literal(); }
   273   InstanceKlass* klass() const { return (InstanceKlass*)literal(); }
   281   InstanceKlass** klass_addr() { return (InstanceKlass**)literal_addr(); }
       
   282 
   274 
   283   DictionaryEntry* next() const {
   275   DictionaryEntry* next() const {
   284     return (DictionaryEntry*)HashtableEntry<InstanceKlass*, mtClass>::next();
   276     return (DictionaryEntry*)HashtableEntry<InstanceKlass*, mtClass>::next();
   285   }
   277   }
   286 
   278 
   291   ClassLoaderData* loader_data() const { return _loader_data; }
   283   ClassLoaderData* loader_data() const { return _loader_data; }
   292   void set_loader_data(ClassLoaderData* loader_data) { _loader_data = loader_data; }
   284   void set_loader_data(ClassLoaderData* loader_data) { _loader_data = loader_data; }
   293 
   285 
   294   ProtectionDomainEntry* pd_set() const { return _pd_set; }
   286   ProtectionDomainEntry* pd_set() const { return _pd_set; }
   295   void set_pd_set(ProtectionDomainEntry* pd_set) { _pd_set = pd_set; }
   287   void set_pd_set(ProtectionDomainEntry* pd_set) { _pd_set = pd_set; }
   296 
       
   297   bool has_protection_domain() { return _pd_set != NULL; }
       
   298 
   288 
   299   // Tells whether the initiating class' protection can access the this _klass
   289   // Tells whether the initiating class' protection can access the this _klass
   300   bool is_valid_protection_domain(Handle protection_domain) {
   290   bool is_valid_protection_domain(Handle protection_domain) {
   301     if (!ProtectionDomainVerification) return true;
   291     if (!ProtectionDomainVerification) return true;
   302     if (!SystemDictionary::has_checkPackageAccess()) return true;
   292     if (!SystemDictionary::has_checkPackageAccess()) return true;