comparison src/share/vm/gc_implementation/shared/markSweep.hpp @ 993:54b3b351d6f9

Merge
author jrose
date Wed, 23 Sep 2009 23:56:15 -0700
parents 148e5441d916 8b46c4d82093
children 753cf9794df9
comparison
equal deleted inserted replaced
992:6a8ccac44f41 993:54b3b351d6f9
21 * have any questions. 21 * have any questions.
22 * 22 *
23 */ 23 */
24 24
25 class ReferenceProcessor; 25 class ReferenceProcessor;
26 class DataLayout;
26 27
27 // MarkSweep takes care of global mark-compact garbage collection for a 28 // MarkSweep takes care of global mark-compact garbage collection for a
28 // GenCollectedHeap using a four-phase pointer forwarding algorithm. All 29 // GenCollectedHeap using a four-phase pointer forwarding algorithm. All
29 // generations are assumed to support marking; those that can also support 30 // generations are assumed to support marking; those that can also support
30 // compaction. 31 // compaction.
61 62
62 class MarkAndPushClosure: public OopClosure { 63 class MarkAndPushClosure: public OopClosure {
63 public: 64 public:
64 virtual void do_oop(oop* p); 65 virtual void do_oop(oop* p);
65 virtual void do_oop(narrowOop* p); 66 virtual void do_oop(narrowOop* p);
67 virtual const bool do_nmethods() const { return true; }
68 virtual const bool should_remember_mdo() const { return true; }
69 virtual void remember_mdo(DataLayout* p) { MarkSweep::revisit_mdo(p); }
66 }; 70 };
67 71
68 class FollowStackClosure: public VoidClosure { 72 class FollowStackClosure: public VoidClosure {
69 public: 73 public:
70 virtual void do_void(); 74 virtual void do_void();
99 // 103 //
100 friend class AdjustPointerClosure; 104 friend class AdjustPointerClosure;
101 friend class KeepAliveClosure; 105 friend class KeepAliveClosure;
102 friend class VM_MarkSweep; 106 friend class VM_MarkSweep;
103 friend void marksweep_init(); 107 friend void marksweep_init();
108 friend class DataLayout;
104 109
105 // 110 //
106 // Vars 111 // Vars
107 // 112 //
108 protected: 113 protected:
109 // Traversal stack used during phase1 114 // Traversal stack used during phase1
110 static GrowableArray<oop>* _marking_stack; 115 static GrowableArray<oop>* _marking_stack;
111 // Stack for live klasses to revisit at end of marking phase 116 // Stack for live klasses to revisit at end of marking phase
112 static GrowableArray<Klass*>* _revisit_klass_stack; 117 static GrowableArray<Klass*>* _revisit_klass_stack;
118 // Set (stack) of MDO's to revisit at end of marking phase
119 static GrowableArray<DataLayout*>* _revisit_mdo_stack;
113 120
114 // Space for storing/restoring mark word 121 // Space for storing/restoring mark word
115 static GrowableArray<markOop>* _preserved_mark_stack; 122 static GrowableArray<markOop>* _preserved_mark_stack;
116 static GrowableArray<oop>* _preserved_oop_stack; 123 static GrowableArray<oop>* _preserved_oop_stack;
117 static size_t _preserved_count; 124 static size_t _preserved_count;
153 static KeepAliveClosure keep_alive; 160 static KeepAliveClosure keep_alive;
154 161
155 // Class unloading. Update subklass/sibling/implementor links at end of marking phase. 162 // Class unloading. Update subklass/sibling/implementor links at end of marking phase.
156 static void follow_weak_klass_links(); 163 static void follow_weak_klass_links();
157 164
165 // Class unloading. Clear weak refs in MDO's (ProfileData)
166 // at the end of the marking phase.
167 static void follow_mdo_weak_refs();
168
158 // Debugging 169 // Debugging
159 static void trace(const char* msg) PRODUCT_RETURN; 170 static void trace(const char* msg) PRODUCT_RETURN;
160 171
161 public: 172 public:
162 // Public closures 173 // Public closures
210 // tracking down heap stomps. 221 // tracking down heap stomps.
211 static void print_new_location_of_heap_address(HeapWord* q); 222 static void print_new_location_of_heap_address(HeapWord* q);
212 #endif 223 #endif
213 224
214 // Call backs for class unloading 225 // Call backs for class unloading
215 static void revisit_weak_klass_link(Klass* k); // Update subklass/sibling/implementor links at end of marking. 226 // Update subklass/sibling/implementor links at end of marking.
227 static void revisit_weak_klass_link(Klass* k);
228 // For weak refs clearing in MDO's
229 static void revisit_mdo(DataLayout* p);
216 }; 230 };
217 231
218 class PreservedMark VALUE_OBJ_CLASS_SPEC { 232 class PreservedMark VALUE_OBJ_CLASS_SPEC {
219 private: 233 private:
220 oop _obj; 234 oop _obj;