src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp

changeset 6329
86b64209f715
parent 6271
0eb64cfc0b76
child 6330
2c2ae9e5f65d
equal deleted inserted replaced
6328:d69952503db0 6329:86b64209f715
4656 } while (!refs()->is_empty()); 4656 } while (!refs()->is_empty());
4657 } 4657 }
4658 4658
4659 G1ParClosureSuper::G1ParClosureSuper(G1CollectedHeap* g1, 4659 G1ParClosureSuper::G1ParClosureSuper(G1CollectedHeap* g1,
4660 G1ParScanThreadState* par_scan_state) : 4660 G1ParScanThreadState* par_scan_state) :
4661 _g1(g1), _g1_rem(_g1->g1_rem_set()), _cm(_g1->concurrent_mark()), 4661 _g1(g1), _par_scan_state(par_scan_state),
4662 _par_scan_state(par_scan_state), 4662 _worker_id(par_scan_state->queue_num()) { }
4663 _worker_id(par_scan_state->queue_num()), 4663
4664 _during_initial_mark(_g1->g1_policy()->during_initial_mark_pause()), 4664 void G1ParCopyHelper::mark_object(oop obj) {
4665 _mark_in_progress(_g1->mark_in_progress()) { }
4666
4667 template <G1Barrier barrier, bool do_mark_object>
4668 void G1ParCopyClosure<barrier, do_mark_object>::mark_object(oop obj) {
4669 #ifdef ASSERT 4665 #ifdef ASSERT
4670 HeapRegion* hr = _g1->heap_region_containing(obj); 4666 HeapRegion* hr = _g1->heap_region_containing(obj);
4671 assert(hr != NULL, "sanity"); 4667 assert(hr != NULL, "sanity");
4672 assert(!hr->in_collection_set(), "should not mark objects in the CSet"); 4668 assert(!hr->in_collection_set(), "should not mark objects in the CSet");
4673 #endif // ASSERT 4669 #endif // ASSERT
4674 4670
4675 // We know that the object is not moving so it's safe to read its size. 4671 // We know that the object is not moving so it's safe to read its size.
4676 _cm->grayRoot(obj, (size_t) obj->size(), _worker_id); 4672 _cm->grayRoot(obj, (size_t) obj->size(), _worker_id);
4677 } 4673 }
4678 4674
4679 template <G1Barrier barrier, bool do_mark_object> 4675 void G1ParCopyHelper::mark_forwarded_object(oop from_obj, oop to_obj) {
4680 void G1ParCopyClosure<barrier, do_mark_object>
4681 ::mark_forwarded_object(oop from_obj, oop to_obj) {
4682 #ifdef ASSERT 4676 #ifdef ASSERT
4683 assert(from_obj->is_forwarded(), "from obj should be forwarded"); 4677 assert(from_obj->is_forwarded(), "from obj should be forwarded");
4684 assert(from_obj->forwardee() == to_obj, "to obj should be the forwardee"); 4678 assert(from_obj->forwardee() == to_obj, "to obj should be the forwardee");
4685 assert(from_obj != to_obj, "should not be self-forwarded"); 4679 assert(from_obj != to_obj, "should not be self-forwarded");
4686 4680
4797 } 4791 }
4798 } 4792 }
4799 4793
4800 template <G1Barrier barrier, bool do_mark_object> 4794 template <G1Barrier barrier, bool do_mark_object>
4801 template <class T> 4795 template <class T>
4802 void G1ParCopyClosure<barrier, do_mark_object> 4796 void G1ParCopyClosure<barrier, do_mark_object>::do_oop_work(T* p) {
4803 ::do_oop_work(T* p) {
4804 oop obj = oopDesc::load_decode_heap_oop(p); 4797 oop obj = oopDesc::load_decode_heap_oop(p);
4805 4798
4806 assert(_worker_id == _par_scan_state->queue_num(), "sanity"); 4799 assert(_worker_id == _par_scan_state->queue_num(), "sanity");
4807 4800
4808 // here the null check is implicit in the cset_fast_test() test 4801 // here the null check is implicit in the cset_fast_test() test

mercurial