--- a/hotspot/src/share/vm/memory/compactingPermGenGen.cpp Thu Jan 27 13:42:28 2011 -0800
+++ b/hotspot/src/share/vm/memory/compactingPermGenGen.cpp Thu Jan 27 16:11:27 2011 -0800
@@ -95,17 +95,11 @@
// their stack to the class without having added the class to the
// dictionary yet. This means the class will be marked during phase 1
// but will not be unmarked during the application of the
-// RecursiveAdjustSharedObjectClosure to the SystemDictionary. Note
-// that we must not call find_shared_class with non-read-only symbols
-// as doing so can cause hash codes to be computed, destroying
-// forwarding pointers.
-class TraversePlaceholdersClosure : public OopClosure {
- protected:
- template <class T> inline void do_oop_work(T* p) {
- oop obj = oopDesc::load_decode_heap_oop_not_null(p);
- if (obj->klass() == Universe::symbolKlassObj() &&
- obj->is_shared_readonly()) {
- symbolHandle sym((symbolOop) obj);
+// RecursiveAdjustSharedObjectClosure to the SystemDictionary.
+class TraversePlaceholdersClosure {
+ public:
+ static void placeholders_do(Symbol* sym, oop loader) {
+ if (CompactingPermGenGen::is_shared(sym)) {
oop k = SystemDictionary::find_shared_class(sym);
if (k != NULL) {
RecursiveAdjustSharedObjectClosure clo;
@@ -113,13 +107,8 @@
}
}
}
- public:
- virtual void do_oop(oop* p) { TraversePlaceholdersClosure::do_oop_work(p); }
- virtual void do_oop(narrowOop* p) { TraversePlaceholdersClosure::do_oop_work(p); }
-
};
-
void CompactingPermGenGen::initialize_performance_counters() {
const char* gen_name = "perm";
@@ -335,8 +324,7 @@
Universe::oops_do(&blk);
StringTable::oops_do(&blk);
SystemDictionary::always_strong_classes_do(&blk);
- TraversePlaceholdersClosure tpc;
- SystemDictionary::placeholders_do(&tpc);
+ SystemDictionary::placeholders_do(TraversePlaceholdersClosure::placeholders_do);
}
}
}
@@ -490,5 +478,3 @@
}
return true;
}
-
-void** CompactingPermGenGen::_vtbl_list;