6049 MarkRefsIntoClosure::MarkRefsIntoClosure( |
6049 MarkRefsIntoClosure::MarkRefsIntoClosure( |
6050 MemRegion span, CMSBitMap* bitMap): |
6050 MemRegion span, CMSBitMap* bitMap): |
6051 _span(span), |
6051 _span(span), |
6052 _bitMap(bitMap) |
6052 _bitMap(bitMap) |
6053 { |
6053 { |
6054 assert(_ref_processor == NULL, "deliberately left NULL"); |
6054 assert(ref_processor() == NULL, "deliberately left NULL"); |
6055 assert(_bitMap->covers(_span), "_bitMap/_span mismatch"); |
6055 assert(_bitMap->covers(_span), "_bitMap/_span mismatch"); |
6056 } |
6056 } |
6057 |
6057 |
6058 void MarkRefsIntoClosure::do_oop(oop obj) { |
6058 void MarkRefsIntoClosure::do_oop(oop obj) { |
6059 // if p points into _span, then mark corresponding bit in _markBitMap |
6059 // if p points into _span, then mark corresponding bit in _markBitMap |
6060 assert(obj->is_oop(), "expected an oop"); |
6060 assert(obj->is_oop(), "expected an oop"); |
6071 Par_MarkRefsIntoClosure::Par_MarkRefsIntoClosure( |
6071 Par_MarkRefsIntoClosure::Par_MarkRefsIntoClosure( |
6072 MemRegion span, CMSBitMap* bitMap): |
6072 MemRegion span, CMSBitMap* bitMap): |
6073 _span(span), |
6073 _span(span), |
6074 _bitMap(bitMap) |
6074 _bitMap(bitMap) |
6075 { |
6075 { |
6076 assert(_ref_processor == NULL, "deliberately left NULL"); |
6076 assert(ref_processor() == NULL, "deliberately left NULL"); |
6077 assert(_bitMap->covers(_span), "_bitMap/_span mismatch"); |
6077 assert(_bitMap->covers(_span), "_bitMap/_span mismatch"); |
6078 } |
6078 } |
6079 |
6079 |
6080 void Par_MarkRefsIntoClosure::do_oop(oop obj) { |
6080 void Par_MarkRefsIntoClosure::do_oop(oop obj) { |
6081 // if p points into _span, then mark corresponding bit in _markBitMap |
6081 // if p points into _span, then mark corresponding bit in _markBitMap |
6082 assert(obj->is_oop(), "expected an oop"); |
6082 assert(obj->is_oop(), "expected an oop"); |
6095 MemRegion span, CMSBitMap* verification_bm, CMSBitMap* cms_bm): |
6095 MemRegion span, CMSBitMap* verification_bm, CMSBitMap* cms_bm): |
6096 _span(span), |
6096 _span(span), |
6097 _verification_bm(verification_bm), |
6097 _verification_bm(verification_bm), |
6098 _cms_bm(cms_bm) |
6098 _cms_bm(cms_bm) |
6099 { |
6099 { |
6100 assert(_ref_processor == NULL, "deliberately left NULL"); |
6100 assert(ref_processor() == NULL, "deliberately left NULL"); |
6101 assert(_verification_bm->covers(_span), "_verification_bm/_span mismatch"); |
6101 assert(_verification_bm->covers(_span), "_verification_bm/_span mismatch"); |
6102 } |
6102 } |
6103 |
6103 |
6104 void MarkRefsIntoVerifyClosure::do_oop(oop obj) { |
6104 void MarkRefsIntoVerifyClosure::do_oop(oop obj) { |
6105 // if p points into _span, then mark corresponding bit in _markBitMap |
6105 // if p points into _span, then mark corresponding bit in _markBitMap |
6106 assert(obj->is_oop(), "expected an oop"); |
6106 assert(obj->is_oop(), "expected an oop"); |
6138 mark_stack, concurrent_precleaning), |
6138 mark_stack, concurrent_precleaning), |
6139 _yield(should_yield), |
6139 _yield(should_yield), |
6140 _concurrent_precleaning(concurrent_precleaning), |
6140 _concurrent_precleaning(concurrent_precleaning), |
6141 _freelistLock(NULL) |
6141 _freelistLock(NULL) |
6142 { |
6142 { |
6143 _ref_processor = rp; |
6143 // FIXME: Should initialize in base class constructor. |
6144 assert(_ref_processor != NULL, "_ref_processor shouldn't be NULL"); |
6144 assert(rp != NULL, "ref_processor shouldn't be NULL"); |
|
6145 set_ref_processor_internal(rp); |
6145 } |
6146 } |
6146 |
6147 |
6147 // This closure is used to mark refs into the CMS generation at the |
6148 // This closure is used to mark refs into the CMS generation at the |
6148 // second (final) checkpoint, and to scan and transitively follow |
6149 // second (final) checkpoint, and to scan and transitively follow |
6149 // the unmarked oops. It is also used during the concurrent precleaning |
6150 // the unmarked oops. It is also used during the concurrent precleaning |
6244 _work_queue(work_queue), |
6245 _work_queue(work_queue), |
6245 _low_water_mark(MIN2((work_queue->max_elems()/4), |
6246 _low_water_mark(MIN2((work_queue->max_elems()/4), |
6246 ((uint)CMSWorkQueueDrainThreshold * ParallelGCThreads))), |
6247 ((uint)CMSWorkQueueDrainThreshold * ParallelGCThreads))), |
6247 _par_pushAndMarkClosure(collector, span, rp, bit_map, work_queue) |
6248 _par_pushAndMarkClosure(collector, span, rp, bit_map, work_queue) |
6248 { |
6249 { |
6249 _ref_processor = rp; |
6250 // FIXME: Should initialize in base class constructor. |
6250 assert(_ref_processor != NULL, "_ref_processor shouldn't be NULL"); |
6251 assert(rp != NULL, "ref_processor shouldn't be NULL"); |
|
6252 set_ref_processor_internal(rp); |
6251 } |
6253 } |
6252 |
6254 |
6253 // This closure is used to mark refs into the CMS generation at the |
6255 // This closure is used to mark refs into the CMS generation at the |
6254 // second (final) checkpoint, and to scan and transitively follow |
6256 // second (final) checkpoint, and to scan and transitively follow |
6255 // the unmarked oops. The marks are made in the marking bit map and |
6257 // the unmarked oops. The marks are made in the marking bit map and |
7095 _bit_map(bit_map), |
7097 _bit_map(bit_map), |
7096 _mod_union_table(mod_union_table), |
7098 _mod_union_table(mod_union_table), |
7097 _mark_stack(mark_stack), |
7099 _mark_stack(mark_stack), |
7098 _concurrent_precleaning(concurrent_precleaning) |
7100 _concurrent_precleaning(concurrent_precleaning) |
7099 { |
7101 { |
7100 assert(_ref_processor != NULL, "_ref_processor shouldn't be NULL"); |
7102 assert(ref_processor() != NULL, "ref_processor shouldn't be NULL"); |
7101 } |
7103 } |
7102 |
7104 |
7103 // Grey object rescan during pre-cleaning and second checkpoint phases -- |
7105 // Grey object rescan during pre-cleaning and second checkpoint phases -- |
7104 // the non-parallel version (the parallel version appears further below.) |
7106 // the non-parallel version (the parallel version appears further below.) |
7105 void PushAndMarkClosure::do_oop(oop obj) { |
7107 void PushAndMarkClosure::do_oop(oop obj) { |
7166 _collector(collector), |
7168 _collector(collector), |
7167 _span(span), |
7169 _span(span), |
7168 _bit_map(bit_map), |
7170 _bit_map(bit_map), |
7169 _work_queue(work_queue) |
7171 _work_queue(work_queue) |
7170 { |
7172 { |
7171 assert(_ref_processor != NULL, "_ref_processor shouldn't be NULL"); |
7173 assert(ref_processor() != NULL, "ref_processor shouldn't be NULL"); |
7172 } |
7174 } |
7173 |
7175 |
7174 void PushAndMarkClosure::do_oop(oop* p) { PushAndMarkClosure::do_oop_work(p); } |
7176 void PushAndMarkClosure::do_oop(oop* p) { PushAndMarkClosure::do_oop_work(p); } |
7175 void PushAndMarkClosure::do_oop(narrowOop* p) { PushAndMarkClosure::do_oop_work(p); } |
7177 void PushAndMarkClosure::do_oop(narrowOop* p) { PushAndMarkClosure::do_oop_work(p); } |
7176 |
7178 |