src/hotspot/share/classfile/dictionary.hpp
changeset 47774 69c081ca110a
parent 47761 1b0566927c7a
child 48781 6ebef5cd0c8d
--- a/src/hotspot/share/classfile/dictionary.hpp	Thu Nov 02 18:44:44 2017 +0300
+++ b/src/hotspot/share/classfile/dictionary.hpp	Thu Nov 02 11:00:34 2017 -0500
@@ -43,6 +43,11 @@
 class Dictionary : public Hashtable<InstanceKlass*, mtClass> {
   friend class VMStructs;
 
+  static bool _some_dictionary_needs_resizing;
+  bool _resizable;
+  bool _needs_resizing;
+  void check_if_needs_resize();
+
   ClassLoaderData* _loader_data;  // backpointer to owning loader
   ClassLoaderData* loader_data() const { return _loader_data; }
 
@@ -51,13 +56,16 @@
 protected:
   static size_t entry_size();
 public:
-  Dictionary(ClassLoaderData* loader_data, int table_size);
-  Dictionary(ClassLoaderData* loader_data, int table_size, HashtableBucket<mtClass>* t, int number_of_entries);
+  Dictionary(ClassLoaderData* loader_data, int table_size, bool resizable = false);
+  Dictionary(ClassLoaderData* loader_data, int table_size, HashtableBucket<mtClass>* t, int number_of_entries, bool resizable = false);
   ~Dictionary();
 
+  static bool does_any_dictionary_needs_resizing();
+  bool resize_if_needed();
+
   DictionaryEntry* new_entry(unsigned int hash, InstanceKlass* klass);
 
-  void add_klass(int index, unsigned int hash, Symbol* class_name, InstanceKlass* obj);
+  void add_klass(unsigned int hash, Symbol* class_name, InstanceKlass* obj);
 
   InstanceKlass* find_class(int index, unsigned int hash, Symbol* name);
 
@@ -79,8 +87,8 @@
   void do_unloading();
 
   // Protection domains
-  InstanceKlass* find(int index, unsigned int hash, Symbol* name, Handle protection_domain);
-  bool is_valid_protection_domain(int index, unsigned int hash,
+  InstanceKlass* find(unsigned int hash, Symbol* name, Handle protection_domain);
+  bool is_valid_protection_domain(unsigned int hash,
                                   Symbol* name,
                                   Handle protection_domain);
   void add_protection_domain(int index, unsigned int hash,