comparison src/share/vm/memory/defNewGeneration.hpp @ 1836:894b1d7c7e01

6423256: GC stacks should use a better data structure 6942771: SEGV in ParScanThreadState::take_from_overflow_stack Reviewed-by: apetrusenko, ysr, pbk
author jcoomes
date Tue, 28 Sep 2010 15:56:15 -0700
parents c18cbe5936b8
children a7214d79fcf1
comparison
equal deleted inserted replaced
1835:4805b9f4779e 1836:894b1d7c7e01
75 75
76 // Preserve the mark of "obj", if necessary, in preparation for its mark 76 // Preserve the mark of "obj", if necessary, in preparation for its mark
77 // word being overwritten with a self-forwarding-pointer. 77 // word being overwritten with a self-forwarding-pointer.
78 void preserve_mark_if_necessary(oop obj, markOop m); 78 void preserve_mark_if_necessary(oop obj, markOop m);
79 79
80 // When one is non-null, so is the other. Together, they each pair is 80 // Together, these keep <object with a preserved mark, mark value> pairs.
81 // an object with a preserved mark, and its mark value. 81 // They should always contain the same number of elements.
82 GrowableArray<oop>* _objs_with_preserved_marks; 82 Stack<oop> _objs_with_preserved_marks;
83 GrowableArray<markOop>* _preserved_marks_of_objs; 83 Stack<markOop> _preserved_marks_of_objs;
84 84
85 // Returns true if the collection can be safely attempted. 85 // Returns true if the collection can be safely attempted.
86 // If this method returns false, a collection is not 86 // If this method returns false, a collection is not
87 // guaranteed to fail but the system may not be able 87 // guaranteed to fail but the system may not be able
88 // to recover from the failure. 88 // to recover from the failure.
92 OopClosure *_promo_failure_scan_stack_closure; 92 OopClosure *_promo_failure_scan_stack_closure;
93 void set_promo_failure_scan_stack_closure(OopClosure *scan_stack_closure) { 93 void set_promo_failure_scan_stack_closure(OopClosure *scan_stack_closure) {
94 _promo_failure_scan_stack_closure = scan_stack_closure; 94 _promo_failure_scan_stack_closure = scan_stack_closure;
95 } 95 }
96 96
97 GrowableArray<oop>* _promo_failure_scan_stack; 97 Stack<oop> _promo_failure_scan_stack;
98 GrowableArray<oop>* promo_failure_scan_stack() const {
99 return _promo_failure_scan_stack;
100 }
101 void push_on_promo_failure_scan_stack(oop);
102 void drain_promo_failure_scan_stack(void); 98 void drain_promo_failure_scan_stack(void);
103 bool _promo_failure_drain_in_progress; 99 bool _promo_failure_drain_in_progress;
104 100
105 // Performance Counters 101 // Performance Counters
106 GenerationCounters* _gen_counters; 102 GenerationCounters* _gen_counters;
182 EvacuateFollowersClosure(GenCollectedHeap* gch, int level, 178 EvacuateFollowersClosure(GenCollectedHeap* gch, int level,
183 ScanClosure* cur, ScanClosure* older); 179 ScanClosure* cur, ScanClosure* older);
184 void do_void(); 180 void do_void();
185 }; 181 };
186 182
187 class FastEvacuateFollowersClosure;
188 friend class FastEvacuateFollowersClosure;
189 class FastEvacuateFollowersClosure: public VoidClosure { 183 class FastEvacuateFollowersClosure: public VoidClosure {
190 GenCollectedHeap* _gch; 184 GenCollectedHeap* _gch;
191 int _level; 185 int _level;
192 DefNewGeneration* _gen; 186 DefNewGeneration* _gen;
193 FastScanClosure* _scan_cur_or_nonheap; 187 FastScanClosure* _scan_cur_or_nonheap;
333 327
334 // PrintHeapAtGC support. 328 // PrintHeapAtGC support.
335 void print_on(outputStream* st) const; 329 void print_on(outputStream* st) const;
336 330
337 void verify(bool allow_dirty); 331 void verify(bool allow_dirty);
332
333 bool promo_failure_scan_is_complete() const {
334 return _promo_failure_scan_stack.is_empty();
335 }
338 336
339 protected: 337 protected:
340 // If clear_space is true, clear the survivor spaces. Eden is 338 // If clear_space is true, clear the survivor spaces. Eden is
341 // cleared if the minimum size of eden is 0. If mangle_space 339 // cleared if the minimum size of eden is 0. If mangle_space
342 // is true, also mangle the space in debug mode. 340 // is true, also mangle the space in debug mode.