comparison src/share/vm/classfile/resolutionErrors.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
65 65
66 // create new error entry 66 // create new error entry
67 ResolutionErrorEntry* ResolutionErrorTable::new_entry(int hash, constantPoolOop pool, 67 ResolutionErrorEntry* ResolutionErrorTable::new_entry(int hash, constantPoolOop pool,
68 int cp_index, Symbol* error) 68 int cp_index, Symbol* error)
69 { 69 {
70 ResolutionErrorEntry* entry = (ResolutionErrorEntry*)Hashtable<constantPoolOop>::new_entry(hash, pool); 70 ResolutionErrorEntry* entry = (ResolutionErrorEntry*)Hashtable<constantPoolOop, mtClass>::new_entry(hash, pool);
71 entry->set_cp_index(cp_index); 71 entry->set_cp_index(cp_index);
72 NOT_PRODUCT(entry->set_error(NULL);) 72 NOT_PRODUCT(entry->set_error(NULL);)
73 entry->set_error(error); 73 entry->set_error(error);
74 74
75 return entry; 75 return entry;
77 77
78 void ResolutionErrorTable::free_entry(ResolutionErrorEntry *entry) { 78 void ResolutionErrorTable::free_entry(ResolutionErrorEntry *entry) {
79 // decrement error refcount 79 // decrement error refcount
80 assert(entry->error() != NULL, "error should be set"); 80 assert(entry->error() != NULL, "error should be set");
81 entry->error()->decrement_refcount(); 81 entry->error()->decrement_refcount();
82 Hashtable<constantPoolOop>::free_entry(entry); 82 Hashtable<constantPoolOop, mtClass>::free_entry(entry);
83 } 83 }
84 84
85 85
86 // create resolution error table 86 // create resolution error table
87 ResolutionErrorTable::ResolutionErrorTable(int table_size) 87 ResolutionErrorTable::ResolutionErrorTable(int table_size)
88 : Hashtable<constantPoolOop>(table_size, sizeof(ResolutionErrorEntry)) { 88 : Hashtable<constantPoolOop, mtClass>(table_size, sizeof(ResolutionErrorEntry)) {
89 } 89 }
90 90
91 // GC support 91 // GC support
92 void ResolutionErrorTable::oops_do(OopClosure* f) { 92 void ResolutionErrorTable::oops_do(OopClosure* f) {
93 for (int i = 0; i < table_size(); i++) { 93 for (int i = 0; i < table_size(); i++) {