comparison src/share/vm/memory/compactingPermGenGen.cpp @ 2177:3582bf76420e

6990754: Use native memory and reference counting to implement SymbolTable Summary: move symbols from permgen into C heap and reference count them Reviewed-by: never, acorn, jmasa, stefank
author coleenp
date Thu, 27 Jan 2011 16:11:27 -0800
parents f95d63e2154a
children 1d1603768966
comparison
equal deleted inserted replaced
2176:27e4ea99855d 2177:3582bf76420e
93 // try to resolve them into shared classes. Other threads might be in 93 // try to resolve them into shared classes. Other threads might be in
94 // the process of loading a shared class and have strong roots on 94 // the process of loading a shared class and have strong roots on
95 // their stack to the class without having added the class to the 95 // their stack to the class without having added the class to the
96 // dictionary yet. This means the class will be marked during phase 1 96 // dictionary yet. This means the class will be marked during phase 1
97 // but will not be unmarked during the application of the 97 // but will not be unmarked during the application of the
98 // RecursiveAdjustSharedObjectClosure to the SystemDictionary. Note 98 // RecursiveAdjustSharedObjectClosure to the SystemDictionary.
99 // that we must not call find_shared_class with non-read-only symbols 99 class TraversePlaceholdersClosure {
100 // as doing so can cause hash codes to be computed, destroying 100 public:
101 // forwarding pointers. 101 static void placeholders_do(Symbol* sym, oop loader) {
102 class TraversePlaceholdersClosure : public OopClosure { 102 if (CompactingPermGenGen::is_shared(sym)) {
103 protected:
104 template <class T> inline void do_oop_work(T* p) {
105 oop obj = oopDesc::load_decode_heap_oop_not_null(p);
106 if (obj->klass() == Universe::symbolKlassObj() &&
107 obj->is_shared_readonly()) {
108 symbolHandle sym((symbolOop) obj);
109 oop k = SystemDictionary::find_shared_class(sym); 103 oop k = SystemDictionary::find_shared_class(sym);
110 if (k != NULL) { 104 if (k != NULL) {
111 RecursiveAdjustSharedObjectClosure clo; 105 RecursiveAdjustSharedObjectClosure clo;
112 clo.do_oop(&k); 106 clo.do_oop(&k);
113 } 107 }
114 } 108 }
115 } 109 }
116 public:
117 virtual void do_oop(oop* p) { TraversePlaceholdersClosure::do_oop_work(p); }
118 virtual void do_oop(narrowOop* p) { TraversePlaceholdersClosure::do_oop_work(p); }
119
120 }; 110 };
121
122 111
123 void CompactingPermGenGen::initialize_performance_counters() { 112 void CompactingPermGenGen::initialize_performance_counters() {
124 113
125 const char* gen_name = "perm"; 114 const char* gen_name = "perm";
126 115
333 } else { 322 } else {
334 RecursiveAdjustSharedObjectClosure blk; 323 RecursiveAdjustSharedObjectClosure blk;
335 Universe::oops_do(&blk); 324 Universe::oops_do(&blk);
336 StringTable::oops_do(&blk); 325 StringTable::oops_do(&blk);
337 SystemDictionary::always_strong_classes_do(&blk); 326 SystemDictionary::always_strong_classes_do(&blk);
338 TraversePlaceholdersClosure tpc; 327 SystemDictionary::placeholders_do(TraversePlaceholdersClosure::placeholders_do);
339 SystemDictionary::placeholders_do(&tpc);
340 } 328 }
341 } 329 }
342 } 330 }
343 331
344 332
488 return false; 476 return false;
489 } 477 }
490 } 478 }
491 return true; 479 return true;
492 } 480 }
493
494 void** CompactingPermGenGen::_vtbl_list;