Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 8506:c3657d00e343
-Merge with tip
author | Christos Kotselidis <christos.kotselidis@oracle.com> |
---|---|
date | Thu, 21 Mar 2013 14:11:13 +0100 |
parents | dee7c8b578c7 ad747ee9d0b1 |
children | b9a918201d47 |
comparison
equal
deleted
inserted
replaced
8505:dee7c8b578c7 | 8506:c3657d00e343 |
---|---|
1891 _is_alive_closure_stw(this), | 1891 _is_alive_closure_stw(this), |
1892 _ref_processor_cm(NULL), | 1892 _ref_processor_cm(NULL), |
1893 _ref_processor_stw(NULL), | 1893 _ref_processor_stw(NULL), |
1894 _process_strong_tasks(new SubTasksDone(G1H_PS_NumElements)), | 1894 _process_strong_tasks(new SubTasksDone(G1H_PS_NumElements)), |
1895 _bot_shared(NULL), | 1895 _bot_shared(NULL), |
1896 _objs_with_preserved_marks(NULL), _preserved_marks_of_objs(NULL), | |
1897 _evac_failure_scan_stack(NULL) , | 1896 _evac_failure_scan_stack(NULL) , |
1898 _mark_in_progress(false), | 1897 _mark_in_progress(false), |
1899 _cg1r(NULL), _summary_bytes_used(0), | 1898 _cg1r(NULL), _summary_bytes_used(0), |
1900 _g1mm(NULL), | 1899 _g1mm(NULL), |
1901 _refine_cte_cl(NULL), | 1900 _refine_cte_cl(NULL), |
4223 reset_cset_heap_region_claim_values(); | 4222 reset_cset_heap_region_claim_values(); |
4224 | 4223 |
4225 assert(check_cset_heap_region_claim_values(HeapRegion::InitialClaimValue), "sanity"); | 4224 assert(check_cset_heap_region_claim_values(HeapRegion::InitialClaimValue), "sanity"); |
4226 | 4225 |
4227 // Now restore saved marks, if any. | 4226 // Now restore saved marks, if any. |
4228 if (_objs_with_preserved_marks != NULL) { | 4227 assert(_objs_with_preserved_marks.size() == |
4229 assert(_preserved_marks_of_objs != NULL, "Both or none."); | 4228 _preserved_marks_of_objs.size(), "Both or none."); |
4230 guarantee(_objs_with_preserved_marks->length() == | 4229 while (!_objs_with_preserved_marks.is_empty()) { |
4231 _preserved_marks_of_objs->length(), "Both or none."); | 4230 oop obj = _objs_with_preserved_marks.pop(); |
4232 for (int i = 0; i < _objs_with_preserved_marks->length(); i++) { | 4231 markOop m = _preserved_marks_of_objs.pop(); |
4233 oop obj = _objs_with_preserved_marks->at(i); | 4232 obj->set_mark(m); |
4234 markOop m = _preserved_marks_of_objs->at(i); | 4233 } |
4235 obj->set_mark(m); | 4234 _objs_with_preserved_marks.clear(true); |
4236 } | 4235 _preserved_marks_of_objs.clear(true); |
4237 | |
4238 // Delete the preserved marks growable arrays (allocated on the C heap). | |
4239 delete _objs_with_preserved_marks; | |
4240 delete _preserved_marks_of_objs; | |
4241 _objs_with_preserved_marks = NULL; | |
4242 _preserved_marks_of_objs = NULL; | |
4243 } | |
4244 } | 4236 } |
4245 | 4237 |
4246 void G1CollectedHeap::push_on_evac_failure_scan_stack(oop obj) { | 4238 void G1CollectedHeap::push_on_evac_failure_scan_stack(oop obj) { |
4247 _evac_failure_scan_stack->push(obj); | 4239 _evac_failure_scan_stack->push(obj); |
4248 } | 4240 } |
4321 void G1CollectedHeap::preserve_mark_if_necessary(oop obj, markOop m) { | 4313 void G1CollectedHeap::preserve_mark_if_necessary(oop obj, markOop m) { |
4322 assert(evacuation_failed(), "Oversaving!"); | 4314 assert(evacuation_failed(), "Oversaving!"); |
4323 // We want to call the "for_promotion_failure" version only in the | 4315 // We want to call the "for_promotion_failure" version only in the |
4324 // case of a promotion failure. | 4316 // case of a promotion failure. |
4325 if (m->must_be_preserved_for_promotion_failure(obj)) { | 4317 if (m->must_be_preserved_for_promotion_failure(obj)) { |
4326 if (_objs_with_preserved_marks == NULL) { | 4318 _objs_with_preserved_marks.push(obj); |
4327 assert(_preserved_marks_of_objs == NULL, "Both or none."); | 4319 _preserved_marks_of_objs.push(m); |
4328 _objs_with_preserved_marks = | |
4329 new (ResourceObj::C_HEAP, mtGC) GrowableArray<oop>(40, true); | |
4330 _preserved_marks_of_objs = | |
4331 new (ResourceObj::C_HEAP, mtGC) GrowableArray<markOop>(40, true); | |
4332 } | |
4333 _objs_with_preserved_marks->push(obj); | |
4334 _preserved_marks_of_objs->push(m); | |
4335 } | 4320 } |
4336 } | 4321 } |
4337 | 4322 |
4338 HeapWord* G1CollectedHeap::par_allocate_during_gc(GCAllocPurpose purpose, | 4323 HeapWord* G1CollectedHeap::par_allocate_during_gc(GCAllocPurpose purpose, |
4339 size_t word_size) { | 4324 size_t word_size) { |