src/share/vm/classfile/dictionary.hpp

Print this page


   1 /*
   2  * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 








  25 class DictionaryEntry;
  26 
  27 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  28 // The data structure for the system dictionary (and the shared system
  29 // dictionary).
  30 
  31 class Dictionary : public TwoOopHashtable {
  32   friend class VMStructs;
  33 private:
  34   // current iteration index.
  35   static int                    _current_class_index;
  36   // pointer to the current hash table entry.
  37   static DictionaryEntry*       _current_class_entry;
  38 
  39   DictionaryEntry* get_entry(int index, unsigned int hash,
  40                              symbolHandle name, Handle loader);
  41 
  42   DictionaryEntry* bucket(int i) {
  43     return (DictionaryEntry*)Hashtable::bucket(i);
  44   }


 319   SymbolPropertyEntry* find_entry(int index, unsigned int hash, symbolHandle name, intptr_t name_mode);
 320 
 321   // must be done under SystemDictionary_lock
 322   SymbolPropertyEntry* add_entry(int index, unsigned int hash, symbolHandle name, intptr_t name_mode);
 323 
 324   // GC support
 325   void oops_do(OopClosure* f);
 326   void methods_do(void f(methodOop));
 327 
 328   // Sharing support
 329   void dump(SerializeOopClosure* soc);
 330   void restore(SerializeOopClosure* soc);
 331   void reorder_dictionary();
 332 
 333 #ifndef PRODUCT
 334   void print();
 335 #endif
 336   void verify();
 337 };
 338 


   1 /*
   2  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_CLASSFILE_DICTIONARY_HPP
  26 #define SHARE_VM_CLASSFILE_DICTIONARY_HPP
  27 
  28 #include "classfile/systemDictionary.hpp"
  29 #include "oops/instanceKlass.hpp"
  30 #include "oops/oop.hpp"
  31 #include "utilities/hashtable.hpp"
  32 
  33 class DictionaryEntry;
  34 
  35 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  36 // The data structure for the system dictionary (and the shared system
  37 // dictionary).
  38 
  39 class Dictionary : public TwoOopHashtable {
  40   friend class VMStructs;
  41 private:
  42   // current iteration index.
  43   static int                    _current_class_index;
  44   // pointer to the current hash table entry.
  45   static DictionaryEntry*       _current_class_entry;
  46 
  47   DictionaryEntry* get_entry(int index, unsigned int hash,
  48                              symbolHandle name, Handle loader);
  49 
  50   DictionaryEntry* bucket(int i) {
  51     return (DictionaryEntry*)Hashtable::bucket(i);
  52   }


 327   SymbolPropertyEntry* find_entry(int index, unsigned int hash, symbolHandle name, intptr_t name_mode);
 328 
 329   // must be done under SystemDictionary_lock
 330   SymbolPropertyEntry* add_entry(int index, unsigned int hash, symbolHandle name, intptr_t name_mode);
 331 
 332   // GC support
 333   void oops_do(OopClosure* f);
 334   void methods_do(void f(methodOop));
 335 
 336   // Sharing support
 337   void dump(SerializeOopClosure* soc);
 338   void restore(SerializeOopClosure* soc);
 339   void reorder_dictionary();
 340 
 341 #ifndef PRODUCT
 342   void print();
 343 #endif
 344   void verify();
 345 };
 346 
 347 
 348 #endif // SHARE_VM_CLASSFILE_DICTIONARY_HPP