src/share/vm/classfile/dictionary.hpp

Print this page
rev 9227 : [mq] cds


  36 class ProtectionDomainCacheEntry;
  37 class BoolObjectClosure;
  38 
  39 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  40 // The data structure for the system dictionary (and the shared system
  41 // dictionary).
  42 
  43 class Dictionary : public TwoOopHashtable<Klass*, mtClass> {
  44   friend class VMStructs;
  45 private:
  46   // current iteration index.
  47   static int                    _current_class_index;
  48   // pointer to the current hash table entry.
  49   static DictionaryEntry*       _current_class_entry;
  50 
  51   ProtectionDomainCacheTable*   _pd_cache_table;
  52 
  53   DictionaryEntry* get_entry(int index, unsigned int hash,
  54                              Symbol* name, ClassLoaderData* loader_data);
  55 

  56   DictionaryEntry* bucket(int i) {
  57     return (DictionaryEntry*)Hashtable<Klass*, mtClass>::bucket(i);
  58   }
  59 
  60   // The following method is not MT-safe and must be done under lock.
  61   DictionaryEntry** bucket_addr(int i) {
  62     return (DictionaryEntry**)Hashtable<Klass*, mtClass>::bucket_addr(i);
  63   }
  64 
  65   void add_entry(int index, DictionaryEntry* new_entry) {
  66     Hashtable<Klass*, mtClass>::add_entry(index, (HashtableEntry<Klass*, mtClass>*)new_entry);
  67   }
  68 

  69 public:
  70   Dictionary(int table_size);
  71   Dictionary(int table_size, HashtableBucket<mtClass>* t, int number_of_entries);
  72 
  73   DictionaryEntry* new_entry(unsigned int hash, Klass* klass, ClassLoaderData* loader_data);
  74 
  75   DictionaryEntry* new_entry();
  76 
  77   void free_entry(DictionaryEntry* entry);
  78 
  79   void add_klass(Symbol* class_name, ClassLoaderData* loader_data,KlassHandle obj);
  80 
  81   Klass* find_class(int index, unsigned int hash,
  82                       Symbol* name, ClassLoaderData* loader_data);
  83 
  84   Klass* find_shared_class(int index, unsigned int hash, Symbol* name);
  85 
  86   // Compiler support
  87   Klass* try_get_next_class();
  88 




  36 class ProtectionDomainCacheEntry;
  37 class BoolObjectClosure;
  38 
  39 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  40 // The data structure for the system dictionary (and the shared system
  41 // dictionary).
  42 
  43 class Dictionary : public TwoOopHashtable<Klass*, mtClass> {
  44   friend class VMStructs;
  45 private:
  46   // current iteration index.
  47   static int                    _current_class_index;
  48   // pointer to the current hash table entry.
  49   static DictionaryEntry*       _current_class_entry;
  50 
  51   ProtectionDomainCacheTable*   _pd_cache_table;
  52 
  53   DictionaryEntry* get_entry(int index, unsigned int hash,
  54                              Symbol* name, ClassLoaderData* loader_data);
  55 
  56 protected:
  57   DictionaryEntry* bucket(int i) {
  58     return (DictionaryEntry*)Hashtable<Klass*, mtClass>::bucket(i);
  59   }
  60 
  61   // The following method is not MT-safe and must be done under lock.
  62   DictionaryEntry** bucket_addr(int i) {
  63     return (DictionaryEntry**)Hashtable<Klass*, mtClass>::bucket_addr(i);
  64   }
  65 
  66   void add_entry(int index, DictionaryEntry* new_entry) {
  67     Hashtable<Klass*, mtClass>::add_entry(index, (HashtableEntry<Klass*, mtClass>*)new_entry);
  68   }
  69 
  70   static size_t entry_size();
  71 public:
  72   Dictionary(int table_size);
  73   Dictionary(int table_size, HashtableBucket<mtClass>* t, int number_of_entries);
  74 
  75   DictionaryEntry* new_entry(unsigned int hash, Klass* klass, ClassLoaderData* loader_data);
  76 
  77   DictionaryEntry* new_entry();
  78 
  79   void free_entry(DictionaryEntry* entry);
  80 
  81   void add_klass(Symbol* class_name, ClassLoaderData* loader_data,KlassHandle obj);
  82 
  83   Klass* find_class(int index, unsigned int hash,
  84                       Symbol* name, ClassLoaderData* loader_data);
  85 
  86   Klass* find_shared_class(int index, unsigned int hash, Symbol* name);
  87 
  88   // Compiler support
  89   Klass* try_get_next_class();
  90