comparison src/share/vm/classfile/placeholders.cpp @ 6197:d2a62e0f25eb

6995781: Native Memory Tracking (Phase 1) 7151532: DCmd for hotspot native memory tracking Summary: Implementation of native memory tracking phase 1, which tracks VM native memory usage, and related DCmd Reviewed-by: acorn, coleenp, fparain
author zgu
date Thu, 28 Jun 2012 17:03:16 -0400
parents 1d1603768966
children da91efe96a93
comparison
equal deleted inserted replaced
6174:74533f63b116 6197:d2a62e0f25eb
32 // Placeholder methods 32 // Placeholder methods
33 33
34 PlaceholderEntry* PlaceholderTable::new_entry(int hash, Symbol* name, 34 PlaceholderEntry* PlaceholderTable::new_entry(int hash, Symbol* name,
35 oop loader, bool havesupername, 35 oop loader, bool havesupername,
36 Symbol* supername) { 36 Symbol* supername) {
37 PlaceholderEntry* entry = (PlaceholderEntry*)Hashtable<Symbol*>::new_entry(hash, name); 37 PlaceholderEntry* entry = (PlaceholderEntry*)Hashtable<Symbol*, mtClass>::new_entry(hash, name);
38 // Hashtable with Symbol* literal must increment and decrement refcount. 38 // Hashtable with Symbol* literal must increment and decrement refcount.
39 name->increment_refcount(); 39 name->increment_refcount();
40 entry->set_loader(loader); 40 entry->set_loader(loader);
41 entry->set_havesupername(havesupername); 41 entry->set_havesupername(havesupername);
42 entry->set_supername(supername); 42 entry->set_supername(supername);
50 50
51 void PlaceholderTable::free_entry(PlaceholderEntry* entry) { 51 void PlaceholderTable::free_entry(PlaceholderEntry* entry) {
52 // decrement Symbol refcount here because Hashtable doesn't. 52 // decrement Symbol refcount here because Hashtable doesn't.
53 entry->literal()->decrement_refcount(); 53 entry->literal()->decrement_refcount();
54 if (entry->supername() != NULL) entry->supername()->decrement_refcount(); 54 if (entry->supername() != NULL) entry->supername()->decrement_refcount();
55 Hashtable<Symbol*>::free_entry(entry); 55 Hashtable<Symbol*, mtClass>::free_entry(entry);
56 } 56 }
57 57
58 58
59 // Placeholder objects represent classes currently being loaded. 59 // Placeholder objects represent classes currently being loaded.
60 // All threads examining the placeholder table must hold the 60 // All threads examining the placeholder table must hold the
164 } 164 }
165 } 165 }
166 } 166 }
167 167
168 PlaceholderTable::PlaceholderTable(int table_size) 168 PlaceholderTable::PlaceholderTable(int table_size)
169 : TwoOopHashtable<Symbol*>(table_size, sizeof(PlaceholderEntry)) { 169 : TwoOopHashtable<Symbol*, mtClass>(table_size, sizeof(PlaceholderEntry)) {
170 } 170 }
171 171
172 172
173 void PlaceholderTable::oops_do(OopClosure* f) { 173 void PlaceholderTable::oops_do(OopClosure* f) {
174 for (int index = 0; index < table_size(); index++) { 174 for (int index = 0; index < table_size(); index++) {