src/share/vm/classfile/dictionary.hpp

Mon, 07 Jul 2014 10:12:40 +0200

author
stefank
date
Mon, 07 Jul 2014 10:12:40 +0200
changeset 6992
2c6ef90f030a
parent 6680
78bbf4d43a14
child 7064
c3990b8c710e
permissions
-rw-r--r--

8049421: G1 Class Unloading after completing a concurrent mark cycle
Reviewed-by: tschatzl, ehelin, brutisso, coleenp, roland, iveresov
Contributed-by: stefan.karlsson@oracle.com, mikael.gerdin@oracle.com

duke@435 1 /*
drchase@6680 2 * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
duke@435 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 *
duke@435 5 * This code is free software; you can redistribute it and/or modify it
duke@435 6 * under the terms of the GNU General Public License version 2 only, as
duke@435 7 * published by the Free Software Foundation.
duke@435 8 *
duke@435 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 * accompanied this code).
duke@435 14 *
duke@435 15 * You should have received a copy of the GNU General Public License version
duke@435 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 *
trims@1907 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 * or visit www.oracle.com if you need additional information or have any
trims@1907 21 * questions.
duke@435 22 *
duke@435 23 */
duke@435 24
stefank@2314 25 #ifndef SHARE_VM_CLASSFILE_DICTIONARY_HPP
stefank@2314 26 #define SHARE_VM_CLASSFILE_DICTIONARY_HPP
stefank@2314 27
stefank@2314 28 #include "classfile/systemDictionary.hpp"
stefank@2314 29 #include "oops/instanceKlass.hpp"
tschatzl@5862 30 #include "oops/oop.inline.hpp"
stefank@2314 31 #include "utilities/hashtable.hpp"
stefank@2314 32
duke@435 33 class DictionaryEntry;
coleenp@4037 34 class PSPromotionManager;
tschatzl@5862 35 class ProtectionDomainCacheTable;
tschatzl@5862 36 class ProtectionDomainCacheEntry;
tschatzl@5862 37 class BoolObjectClosure;
duke@435 38
duke@435 39 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
duke@435 40 // The data structure for the system dictionary (and the shared system
duke@435 41 // dictionary).
duke@435 42
coleenp@4037 43 class Dictionary : public TwoOopHashtable<Klass*, mtClass> {
duke@435 44 friend class VMStructs;
duke@435 45 private:
duke@435 46 // current iteration index.
duke@435 47 static int _current_class_index;
duke@435 48 // pointer to the current hash table entry.
duke@435 49 static DictionaryEntry* _current_class_entry;
duke@435 50
tschatzl@5862 51 ProtectionDomainCacheTable* _pd_cache_table;
tschatzl@5862 52
duke@435 53 DictionaryEntry* get_entry(int index, unsigned int hash,
coleenp@4037 54 Symbol* name, ClassLoaderData* loader_data);
duke@435 55
duke@435 56 DictionaryEntry* bucket(int i) {
coleenp@4037 57 return (DictionaryEntry*)Hashtable<Klass*, mtClass>::bucket(i);
duke@435 58 }
duke@435 59
duke@435 60 // The following method is not MT-safe and must be done under lock.
duke@435 61 DictionaryEntry** bucket_addr(int i) {
coleenp@4037 62 return (DictionaryEntry**)Hashtable<Klass*, mtClass>::bucket_addr(i);
duke@435 63 }
duke@435 64
duke@435 65 void add_entry(int index, DictionaryEntry* new_entry) {
coleenp@4037 66 Hashtable<Klass*, mtClass>::add_entry(index, (HashtableEntry<Klass*, mtClass>*)new_entry);
duke@435 67 }
duke@435 68
duke@435 69 public:
duke@435 70 Dictionary(int table_size);
zgu@3900 71 Dictionary(int table_size, HashtableBucket<mtClass>* t, int number_of_entries);
duke@435 72
coleenp@4037 73 DictionaryEntry* new_entry(unsigned int hash, Klass* klass, ClassLoaderData* loader_data);
duke@435 74
duke@435 75 DictionaryEntry* new_entry();
duke@435 76
duke@435 77 void free_entry(DictionaryEntry* entry);
duke@435 78
coleenp@4037 79 void add_klass(Symbol* class_name, ClassLoaderData* loader_data,KlassHandle obj);
duke@435 80
coleenp@4037 81 Klass* find_class(int index, unsigned int hash,
coleenp@4037 82 Symbol* name, ClassLoaderData* loader_data);
duke@435 83
coleenp@4037 84 Klass* find_shared_class(int index, unsigned int hash, Symbol* name);
duke@435 85
duke@435 86 // Compiler support
coleenp@4037 87 Klass* try_get_next_class();
duke@435 88
duke@435 89 // GC support
coleenp@4037 90 void oops_do(OopClosure* f);
coleenp@4037 91 void always_strong_oops_do(OopClosure* blk);
stefank@6992 92 void roots_oops_do(OopClosure* strong, OopClosure* weak);
duke@435 93
coleenp@4037 94 void always_strong_classes_do(KlassClosure* closure);
duke@435 95
coleenp@4037 96 void classes_do(void f(Klass*));
coleenp@4037 97 void classes_do(void f(Klass*, TRAPS), TRAPS);
coleenp@4037 98 void classes_do(void f(Klass*, ClassLoaderData*));
coleenp@4037 99
coleenp@4037 100 void methods_do(void f(Method*));
duke@435 101
tschatzl@5862 102 void unlink(BoolObjectClosure* is_alive);
duke@435 103
duke@435 104 // Classes loaded by the bootstrap loader are always strongly reachable.
duke@435 105 // If we're not doing class unloading, all classes are strongly reachable.
coleenp@4037 106 static bool is_strongly_reachable(ClassLoaderData* loader_data, Klass* klass) {
duke@435 107 assert (klass != NULL, "should have non-null klass");
coleenp@4037 108 return (loader_data->is_the_null_class_loader_data() || !ClassUnloading);
duke@435 109 }
duke@435 110
duke@435 111 // Unload (that is, break root links to) all unmarked classes and
duke@435 112 // loaders. Returns "true" iff something was unloaded.
coleenp@4037 113 bool do_unloading();
duke@435 114
duke@435 115 // Protection domains
coleenp@4037 116 Klass* find(int index, unsigned int hash, Symbol* name,
coleenp@4037 117 ClassLoaderData* loader_data, Handle protection_domain, TRAPS);
duke@435 118 bool is_valid_protection_domain(int index, unsigned int hash,
coleenp@4037 119 Symbol* name, ClassLoaderData* loader_data,
duke@435 120 Handle protection_domain);
duke@435 121 void add_protection_domain(int index, unsigned int hash,
coleenp@4037 122 instanceKlassHandle klass, ClassLoaderData* loader_data,
duke@435 123 Handle protection_domain, TRAPS);
duke@435 124
duke@435 125 // Sharing support
duke@435 126 void reorder_dictionary();
duke@435 127
tschatzl@5862 128 ProtectionDomainCacheEntry* cache_get(oop protection_domain);
duke@435 129
duke@435 130 #ifndef PRODUCT
duke@435 131 void print();
duke@435 132 #endif
duke@435 133 void verify();
duke@435 134 };
duke@435 135
duke@435 136 // The following classes can be in dictionary.cpp, but we need these
tschatzl@5862 137 // to be in header file so that SA's vmStructs can access them.
tschatzl@5862 138 class ProtectionDomainCacheEntry : public HashtableEntry<oop, mtClass> {
tschatzl@5862 139 friend class VMStructs;
tschatzl@5862 140 private:
tschatzl@5862 141 // Flag indicating whether this protection domain entry is strongly reachable.
tschatzl@5862 142 // Used during iterating over the system dictionary to remember oops that need
tschatzl@5862 143 // to be updated.
tschatzl@5862 144 bool _strongly_reachable;
tschatzl@5862 145 public:
tschatzl@5862 146 oop protection_domain() { return literal(); }
tschatzl@5862 147
tschatzl@5862 148 void init() {
tschatzl@5862 149 _strongly_reachable = false;
tschatzl@5862 150 }
tschatzl@5862 151
tschatzl@5862 152 ProtectionDomainCacheEntry* next() {
tschatzl@5862 153 return (ProtectionDomainCacheEntry*)HashtableEntry<oop, mtClass>::next();
tschatzl@5862 154 }
tschatzl@5862 155
tschatzl@5862 156 ProtectionDomainCacheEntry** next_addr() {
tschatzl@5862 157 return (ProtectionDomainCacheEntry**)HashtableEntry<oop, mtClass>::next_addr();
tschatzl@5862 158 }
tschatzl@5862 159
tschatzl@5862 160 void oops_do(OopClosure* f) {
tschatzl@5862 161 f->do_oop(literal_addr());
tschatzl@5862 162 }
tschatzl@5862 163
tschatzl@5862 164 void set_strongly_reachable() { _strongly_reachable = true; }
tschatzl@5862 165 bool is_strongly_reachable() { return _strongly_reachable; }
tschatzl@5862 166 void reset_strongly_reachable() { _strongly_reachable = false; }
tschatzl@5862 167
tschatzl@5862 168 void print() PRODUCT_RETURN;
tschatzl@5862 169 void verify();
tschatzl@5862 170 };
tschatzl@5862 171
tschatzl@5862 172 // The ProtectionDomainCacheTable contains all protection domain oops. The system
tschatzl@5862 173 // dictionary entries reference its entries instead of having references to oops
tschatzl@5862 174 // directly.
tschatzl@5862 175 // This is used to speed up system dictionary iteration: the oops in the
tschatzl@5862 176 // protection domain are the only ones referring the Java heap. So when there is
tschatzl@5862 177 // need to update these, instead of going over every entry of the system dictionary,
tschatzl@5862 178 // we only need to iterate over this set.
tschatzl@5862 179 // The amount of different protection domains used is typically magnitudes smaller
tschatzl@5862 180 // than the number of system dictionary entries (loaded classes).
tschatzl@5862 181 class ProtectionDomainCacheTable : public Hashtable<oop, mtClass> {
tschatzl@5862 182 friend class VMStructs;
tschatzl@5862 183 private:
tschatzl@5862 184 ProtectionDomainCacheEntry* bucket(int i) {
tschatzl@5862 185 return (ProtectionDomainCacheEntry*) Hashtable<oop, mtClass>::bucket(i);
tschatzl@5862 186 }
tschatzl@5862 187
tschatzl@5862 188 // The following method is not MT-safe and must be done under lock.
tschatzl@5862 189 ProtectionDomainCacheEntry** bucket_addr(int i) {
tschatzl@5862 190 return (ProtectionDomainCacheEntry**) Hashtable<oop, mtClass>::bucket_addr(i);
tschatzl@5862 191 }
tschatzl@5862 192
tschatzl@5862 193 ProtectionDomainCacheEntry* new_entry(unsigned int hash, oop protection_domain) {
tschatzl@5862 194 ProtectionDomainCacheEntry* entry = (ProtectionDomainCacheEntry*) Hashtable<oop, mtClass>::new_entry(hash, protection_domain);
tschatzl@5862 195 entry->init();
tschatzl@5862 196 return entry;
tschatzl@5862 197 }
tschatzl@5862 198
tschatzl@5862 199 static unsigned int compute_hash(oop protection_domain) {
tschatzl@5862 200 return (unsigned int)(protection_domain->identity_hash());
tschatzl@5862 201 }
tschatzl@5862 202
tschatzl@5862 203 int index_for(oop protection_domain) {
tschatzl@5862 204 return hash_to_index(compute_hash(protection_domain));
tschatzl@5862 205 }
tschatzl@5862 206
tschatzl@5862 207 ProtectionDomainCacheEntry* add_entry(int index, unsigned int hash, oop protection_domain);
tschatzl@5862 208 ProtectionDomainCacheEntry* find_entry(int index, oop protection_domain);
tschatzl@5862 209
tschatzl@5862 210 public:
tschatzl@5862 211
tschatzl@5862 212 ProtectionDomainCacheTable(int table_size);
tschatzl@5862 213
tschatzl@5862 214 ProtectionDomainCacheEntry* get(oop protection_domain);
tschatzl@5862 215 void free(ProtectionDomainCacheEntry* entry);
tschatzl@5862 216
tschatzl@5862 217 void unlink(BoolObjectClosure* cl);
tschatzl@5862 218
tschatzl@5862 219 // GC support
tschatzl@5862 220 void oops_do(OopClosure* f);
tschatzl@5862 221 void always_strong_oops_do(OopClosure* f);
stefank@6992 222 void roots_oops_do(OopClosure* strong, OopClosure* weak);
tschatzl@5862 223
tschatzl@5862 224 static uint bucket_size();
tschatzl@5862 225
tschatzl@5862 226 void print() PRODUCT_RETURN;
tschatzl@5862 227 void verify();
tschatzl@5862 228 };
tschatzl@5862 229
duke@435 230
zgu@3900 231 class ProtectionDomainEntry :public CHeapObj<mtClass> {
duke@435 232 friend class VMStructs;
duke@435 233 public:
duke@435 234 ProtectionDomainEntry* _next;
tschatzl@5862 235 ProtectionDomainCacheEntry* _pd_cache;
duke@435 236
tschatzl@5862 237 ProtectionDomainEntry(ProtectionDomainCacheEntry* pd_cache, ProtectionDomainEntry* next) {
tschatzl@5862 238 _pd_cache = pd_cache;
tschatzl@5862 239 _next = next;
duke@435 240 }
duke@435 241
duke@435 242 ProtectionDomainEntry* next() { return _next; }
tschatzl@5862 243 oop protection_domain() { return _pd_cache->protection_domain(); }
duke@435 244 };
duke@435 245
duke@435 246 // An entry in the system dictionary, this describes a class as
coleenp@4037 247 // { Klass*, loader, protection_domain }.
duke@435 248
coleenp@4037 249 class DictionaryEntry : public HashtableEntry<Klass*, mtClass> {
duke@435 250 friend class VMStructs;
duke@435 251 private:
duke@435 252 // Contains the set of approved protection domains that can access
duke@435 253 // this system dictionary entry.
tschatzl@5862 254 //
tschatzl@5862 255 // This protection domain set is a set of tuples:
tschatzl@5862 256 //
tschatzl@5862 257 // (InstanceKlass C, initiating class loader ICL, Protection Domain PD)
tschatzl@5862 258 //
tschatzl@5862 259 // [Note that C.protection_domain(), which is stored in the java.lang.Class
tschatzl@5862 260 // mirror of C, is NOT the same as PD]
tschatzl@5862 261 //
tschatzl@5862 262 // If such an entry (C, ICL, PD) exists in the table, it means that
tschatzl@5862 263 // it is okay for a class Foo to reference C, where
tschatzl@5862 264 //
tschatzl@5862 265 // Foo.protection_domain() == PD, and
tschatzl@5862 266 // Foo's defining class loader == ICL
tschatzl@5862 267 //
tschatzl@5862 268 // The usage of the PD set can be seen in SystemDictionary::validate_protection_domain()
tschatzl@5862 269 // It is essentially a cache to avoid repeated Java up-calls to
tschatzl@5862 270 // ClassLoader.checkPackageAccess().
tschatzl@5862 271 //
duke@435 272 ProtectionDomainEntry* _pd_set;
coleenp@4037 273 ClassLoaderData* _loader_data;
duke@435 274
duke@435 275 public:
duke@435 276 // Tells whether a protection is in the approved set.
duke@435 277 bool contains_protection_domain(oop protection_domain) const;
duke@435 278 // Adds a protection domain to the approved set.
tschatzl@5862 279 void add_protection_domain(Dictionary* dict, oop protection_domain);
duke@435 280
coleenp@4037 281 Klass* klass() const { return (Klass*)literal(); }
coleenp@4037 282 Klass** klass_addr() { return (Klass**)literal_addr(); }
duke@435 283
duke@435 284 DictionaryEntry* next() const {
coleenp@4037 285 return (DictionaryEntry*)HashtableEntry<Klass*, mtClass>::next();
duke@435 286 }
duke@435 287
duke@435 288 DictionaryEntry** next_addr() {
coleenp@4037 289 return (DictionaryEntry**)HashtableEntry<Klass*, mtClass>::next_addr();
duke@435 290 }
duke@435 291
coleenp@4037 292 ClassLoaderData* loader_data() const { return _loader_data; }
coleenp@4037 293 void set_loader_data(ClassLoaderData* loader_data) { _loader_data = loader_data; }
duke@435 294
duke@435 295 ProtectionDomainEntry* pd_set() const { return _pd_set; }
duke@435 296 void set_pd_set(ProtectionDomainEntry* pd_set) { _pd_set = pd_set; }
duke@435 297
duke@435 298 bool has_protection_domain() { return _pd_set != NULL; }
duke@435 299
duke@435 300 // Tells whether the initiating class' protection can access the this _klass
duke@435 301 bool is_valid_protection_domain(Handle protection_domain) {
duke@435 302 if (!ProtectionDomainVerification) return true;
duke@435 303 if (!SystemDictionary::has_checkPackageAccess()) return true;
duke@435 304
duke@435 305 return protection_domain() == NULL
duke@435 306 ? true
duke@435 307 : contains_protection_domain(protection_domain());
duke@435 308 }
duke@435 309
tschatzl@5862 310 void set_strongly_reachable() {
duke@435 311 for (ProtectionDomainEntry* current = _pd_set;
duke@435 312 current != NULL;
duke@435 313 current = current->_next) {
tschatzl@5862 314 current->_pd_cache->set_strongly_reachable();
duke@435 315 }
duke@435 316 }
duke@435 317
duke@435 318 void verify_protection_domain_set() {
duke@435 319 for (ProtectionDomainEntry* current = _pd_set;
duke@435 320 current != NULL;
duke@435 321 current = current->_next) {
tschatzl@5862 322 current->_pd_cache->protection_domain()->verify();
duke@435 323 }
duke@435 324 }
duke@435 325
coleenp@4037 326 bool equals(Symbol* class_name, ClassLoaderData* loader_data) const {
coleenp@4037 327 Klass* klass = (Klass*)literal();
coleenp@4037 328 return (InstanceKlass::cast(klass)->name() == class_name &&
coleenp@4037 329 _loader_data == loader_data);
duke@435 330 }
duke@435 331
duke@435 332 void print() {
duke@435 333 int count = 0;
duke@435 334 for (ProtectionDomainEntry* current = _pd_set;
duke@435 335 current != NULL;
duke@435 336 current = current->_next) {
duke@435 337 count++;
duke@435 338 }
duke@435 339 tty->print_cr("pd set = #%d", count);
duke@435 340 }
duke@435 341 };
jrose@1145 342
coleenp@2497 343 // Entry in a SymbolPropertyTable, mapping a single Symbol*
jrose@1145 344 // to a managed and an unmanaged pointer.
zgu@3900 345 class SymbolPropertyEntry : public HashtableEntry<Symbol*, mtSymbol> {
jrose@1145 346 friend class VMStructs;
jrose@1145 347 private:
jrose@1862 348 intptr_t _symbol_mode; // secondary key
coleenp@4037 349 Method* _method;
coleenp@4037 350 oop _method_type;
jrose@1145 351
jrose@1145 352 public:
coleenp@2497 353 Symbol* symbol() const { return literal(); }
jrose@1145 354
jrose@1862 355 intptr_t symbol_mode() const { return _symbol_mode; }
jrose@1862 356 void set_symbol_mode(intptr_t m) { _symbol_mode = m; }
jrose@1862 357
coleenp@4037 358 Method* method() const { return _method; }
coleenp@4037 359 void set_method(Method* p) { _method = p; }
jrose@1145 360
coleenp@4037 361 oop method_type() const { return _method_type; }
coleenp@4037 362 oop* method_type_addr() { return &_method_type; }
coleenp@4037 363 void set_method_type(oop p) { _method_type = p; }
jrose@1145 364
jrose@1145 365 SymbolPropertyEntry* next() const {
zgu@3900 366 return (SymbolPropertyEntry*)HashtableEntry<Symbol*, mtSymbol>::next();
jrose@1145 367 }
jrose@1145 368
jrose@1145 369 SymbolPropertyEntry** next_addr() {
zgu@3900 370 return (SymbolPropertyEntry**)HashtableEntry<Symbol*, mtSymbol>::next_addr();
jrose@1145 371 }
jrose@1145 372
jrose@1145 373 void print_on(outputStream* st) const {
jrose@1145 374 symbol()->print_value_on(st);
jrose@1862 375 st->print("/mode="INTX_FORMAT, symbol_mode());
jrose@1145 376 st->print(" -> ");
jrose@1145 377 bool printed = false;
coleenp@4037 378 if (method() != NULL) {
coleenp@4037 379 method()->print_value_on(st);
jrose@1145 380 printed = true;
jrose@1145 381 }
coleenp@4037 382 if (method_type() != NULL) {
jrose@1145 383 if (printed) st->print(" and ");
drchase@6680 384 st->print(INTPTR_FORMAT, p2i((void *)method_type()));
jrose@1145 385 printed = true;
jrose@1145 386 }
jrose@1145 387 st->print_cr(printed ? "" : "(empty)");
jrose@1145 388 }
jrose@1145 389 };
jrose@1145 390
jrose@1145 391 // A system-internal mapping of symbols to pointers, both managed
jrose@1145 392 // and unmanaged. Used to record the auto-generation of each method
jrose@1145 393 // MethodHandle.invoke(S)T, for all signatures (S)T.
zgu@3900 394 class SymbolPropertyTable : public Hashtable<Symbol*, mtSymbol> {
jrose@1145 395 friend class VMStructs;
jrose@1145 396 private:
jrose@1145 397 SymbolPropertyEntry* bucket(int i) {
zgu@3900 398 return (SymbolPropertyEntry*) Hashtable<Symbol*, mtSymbol>::bucket(i);
jrose@1145 399 }
jrose@1145 400
jrose@1145 401 // The following method is not MT-safe and must be done under lock.
jrose@1145 402 SymbolPropertyEntry** bucket_addr(int i) {
zgu@3900 403 return (SymbolPropertyEntry**) Hashtable<Symbol*, mtSymbol>::bucket_addr(i);
jrose@1145 404 }
jrose@1145 405
jrose@1145 406 void add_entry(int index, SymbolPropertyEntry* new_entry) {
jrose@1145 407 ShouldNotReachHere();
jrose@1145 408 }
jrose@1145 409 void set_entry(int index, SymbolPropertyEntry* new_entry) {
jrose@1145 410 ShouldNotReachHere();
jrose@1145 411 }
jrose@1145 412
coleenp@2497 413 SymbolPropertyEntry* new_entry(unsigned int hash, Symbol* symbol, intptr_t symbol_mode) {
zgu@3900 414 SymbolPropertyEntry* entry = (SymbolPropertyEntry*) Hashtable<Symbol*, mtSymbol>::new_entry(hash, symbol);
coleenp@2497 415 // Hashtable with Symbol* literal must increment and decrement refcount.
coleenp@2497 416 symbol->increment_refcount();
jrose@1862 417 entry->set_symbol_mode(symbol_mode);
coleenp@4037 418 entry->set_method(NULL);
coleenp@4037 419 entry->set_method_type(NULL);
jrose@1145 420 return entry;
jrose@1145 421 }
jrose@1145 422
jrose@1145 423 public:
jrose@1145 424 SymbolPropertyTable(int table_size);
zgu@3900 425 SymbolPropertyTable(int table_size, HashtableBucket<mtSymbol>* t, int number_of_entries);
jrose@1145 426
jrose@1145 427 void free_entry(SymbolPropertyEntry* entry) {
coleenp@2497 428 // decrement Symbol refcount here because hashtable doesn't.
coleenp@2497 429 entry->literal()->decrement_refcount();
zgu@3900 430 Hashtable<Symbol*, mtSymbol>::free_entry(entry);
jrose@1145 431 }
jrose@1145 432
coleenp@2497 433 unsigned int compute_hash(Symbol* sym, intptr_t symbol_mode) {
jrose@1145 434 // Use the regular identity_hash.
zgu@3900 435 return Hashtable<Symbol*, mtSymbol>::compute_hash(sym) ^ symbol_mode;
jrose@1862 436 }
jrose@1862 437
coleenp@2497 438 int index_for(Symbol* name, intptr_t symbol_mode) {
jrose@1862 439 return hash_to_index(compute_hash(name, symbol_mode));
jrose@1145 440 }
jrose@1145 441
jrose@1145 442 // need not be locked; no state change
coleenp@2497 443 SymbolPropertyEntry* find_entry(int index, unsigned int hash, Symbol* name, intptr_t name_mode);
jrose@1145 444
jrose@1145 445 // must be done under SystemDictionary_lock
coleenp@2497 446 SymbolPropertyEntry* add_entry(int index, unsigned int hash, Symbol* name, intptr_t name_mode);
jrose@1145 447
jrose@1145 448 // GC support
jrose@1145 449 void oops_do(OopClosure* f);
coleenp@4037 450
coleenp@4037 451 void methods_do(void f(Method*));
jrose@1145 452
jrose@1145 453 // Sharing support
jrose@1145 454 void reorder_dictionary();
jrose@1145 455
jrose@1145 456 #ifndef PRODUCT
jrose@1145 457 void print();
jrose@1145 458 #endif
jrose@1145 459 void verify();
jrose@1145 460 };
stefank@2314 461 #endif // SHARE_VM_CLASSFILE_DICTIONARY_HPP

mercurial