Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 14485:e9d5c28e5059
8027559: Decrease code size and templatizing in G1ParCopyClosure::do_oop_work
Summary: Move methods that are not dependent on any of G1ParCopyClosure's template parameters into G1ParCopyHelper. Further remove unused methods and members of the class hierarchy.
Reviewed-by: mgerdin, stefank
author | tschatzl |
---|---|
date | Mon, 24 Feb 2014 09:40:21 +0100 |
parents | d166675568f6 |
children | 4f227ecd7beb |
comparison
equal
deleted
inserted
replaced
14484:3cdda110bbb5 | 14485:e9d5c28e5059 |
---|---|
4651 } while (!refs()->is_empty()); | 4651 } while (!refs()->is_empty()); |
4652 } | 4652 } |
4653 | 4653 |
4654 G1ParClosureSuper::G1ParClosureSuper(G1CollectedHeap* g1, | 4654 G1ParClosureSuper::G1ParClosureSuper(G1CollectedHeap* g1, |
4655 G1ParScanThreadState* par_scan_state) : | 4655 G1ParScanThreadState* par_scan_state) : |
4656 _g1(g1), _g1_rem(_g1->g1_rem_set()), _cm(_g1->concurrent_mark()), | 4656 _g1(g1), _par_scan_state(par_scan_state), |
4657 _par_scan_state(par_scan_state), | 4657 _worker_id(par_scan_state->queue_num()) { } |
4658 _worker_id(par_scan_state->queue_num()), | 4658 |
4659 _during_initial_mark(_g1->g1_policy()->during_initial_mark_pause()), | 4659 void G1ParCopyHelper::mark_object(oop obj) { |
4660 _mark_in_progress(_g1->mark_in_progress()) { } | |
4661 | |
4662 template <G1Barrier barrier, bool do_mark_object> | |
4663 void G1ParCopyClosure<barrier, do_mark_object>::mark_object(oop obj) { | |
4664 #ifdef ASSERT | 4660 #ifdef ASSERT |
4665 HeapRegion* hr = _g1->heap_region_containing(obj); | 4661 HeapRegion* hr = _g1->heap_region_containing(obj); |
4666 assert(hr != NULL, "sanity"); | 4662 assert(hr != NULL, "sanity"); |
4667 assert(!hr->in_collection_set(), "should not mark objects in the CSet"); | 4663 assert(!hr->in_collection_set(), "should not mark objects in the CSet"); |
4668 #endif // ASSERT | 4664 #endif // ASSERT |
4669 | 4665 |
4670 // We know that the object is not moving so it's safe to read its size. | 4666 // We know that the object is not moving so it's safe to read its size. |
4671 _cm->grayRoot(obj, (size_t) obj->size(), _worker_id); | 4667 _cm->grayRoot(obj, (size_t) obj->size(), _worker_id); |
4672 } | 4668 } |
4673 | 4669 |
4674 template <G1Barrier barrier, bool do_mark_object> | 4670 void G1ParCopyHelper::mark_forwarded_object(oop from_obj, oop to_obj) { |
4675 void G1ParCopyClosure<barrier, do_mark_object> | |
4676 ::mark_forwarded_object(oop from_obj, oop to_obj) { | |
4677 #ifdef ASSERT | 4671 #ifdef ASSERT |
4678 assert(from_obj->is_forwarded(), "from obj should be forwarded"); | 4672 assert(from_obj->is_forwarded(), "from obj should be forwarded"); |
4679 assert(from_obj->forwardee() == to_obj, "to obj should be the forwardee"); | 4673 assert(from_obj->forwardee() == to_obj, "to obj should be the forwardee"); |
4680 assert(from_obj != to_obj, "should not be self-forwarded"); | 4674 assert(from_obj != to_obj, "should not be self-forwarded"); |
4681 | 4675 |
4792 } | 4786 } |
4793 } | 4787 } |
4794 | 4788 |
4795 template <G1Barrier barrier, bool do_mark_object> | 4789 template <G1Barrier barrier, bool do_mark_object> |
4796 template <class T> | 4790 template <class T> |
4797 void G1ParCopyClosure<barrier, do_mark_object> | 4791 void G1ParCopyClosure<barrier, do_mark_object>::do_oop_work(T* p) { |
4798 ::do_oop_work(T* p) { | |
4799 oop obj = oopDesc::load_decode_heap_oop(p); | 4792 oop obj = oopDesc::load_decode_heap_oop(p); |
4800 | 4793 |
4801 assert(_worker_id == _par_scan_state->queue_num(), "sanity"); | 4794 assert(_worker_id == _par_scan_state->queue_num(), "sanity"); |
4802 | 4795 |
4803 // here the null check is implicit in the cset_fast_test() test | 4796 // here the null check is implicit in the cset_fast_test() test |