Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 17688:2c2ae9e5f65d
8035326: Assume non-NULL references in G1CollectedHeap::in_cset_fast_test
Summary: Remove the assumption that G1CollectedHeap::in_cset_fast_test needs to check for NULL references. Most of the time this is not required, making the code doing this check multiple times.
Reviewed-by: stefank, mgerdin, jmasa
author | tschatzl |
---|---|
date | Wed, 26 Feb 2014 15:32:44 +0100 |
parents | 86b64209f715 |
children | 5d492d192cbf |
comparison
equal
deleted
inserted
replaced
17687:86b64209f715 | 17688:2c2ae9e5f65d |
---|---|
4792 } | 4792 } |
4793 | 4793 |
4794 template <G1Barrier barrier, bool do_mark_object> | 4794 template <G1Barrier barrier, bool do_mark_object> |
4795 template <class T> | 4795 template <class T> |
4796 void G1ParCopyClosure<barrier, do_mark_object>::do_oop_work(T* p) { | 4796 void G1ParCopyClosure<barrier, do_mark_object>::do_oop_work(T* p) { |
4797 oop obj = oopDesc::load_decode_heap_oop(p); | 4797 T heap_oop = oopDesc::load_heap_oop(p); |
4798 | |
4799 if (oopDesc::is_null(heap_oop)) { | |
4800 return; | |
4801 } | |
4802 | |
4803 oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); | |
4798 | 4804 |
4799 assert(_worker_id == _par_scan_state->queue_num(), "sanity"); | 4805 assert(_worker_id == _par_scan_state->queue_num(), "sanity"); |
4800 | 4806 |
4801 // here the null check is implicit in the cset_fast_test() test | |
4802 if (_g1->in_cset_fast_test(obj)) { | 4807 if (_g1->in_cset_fast_test(obj)) { |
4803 oop forwardee; | 4808 oop forwardee; |
4804 if (obj->is_forwarded()) { | 4809 if (obj->is_forwarded()) { |
4805 forwardee = obj->forwardee(); | 4810 forwardee = obj->forwardee(); |
4806 } else { | 4811 } else { |
4819 } | 4824 } |
4820 } else { | 4825 } else { |
4821 // The object is not in collection set. If we're a root scanning | 4826 // The object is not in collection set. If we're a root scanning |
4822 // closure during an initial mark pause (i.e. do_mark_object will | 4827 // closure during an initial mark pause (i.e. do_mark_object will |
4823 // be true) then attempt to mark the object. | 4828 // be true) then attempt to mark the object. |
4824 if (do_mark_object && _g1->is_in_g1_reserved(obj)) { | 4829 if (do_mark_object) { |
4825 mark_object(obj); | 4830 mark_object(obj); |
4826 } | 4831 } |
4827 } | 4832 } |
4828 | 4833 |
4829 if (barrier == G1BarrierEvac && obj != NULL) { | 4834 if (barrier == G1BarrierEvac) { |
4830 _par_scan_state->update_rs(_from, p, _worker_id); | 4835 _par_scan_state->update_rs(_from, p, _worker_id); |
4831 } | 4836 } |
4832 } | 4837 } |
4833 | 4838 |
4834 template void G1ParCopyClosure<G1BarrierEvac, false>::do_oop_work(oop* p); | 4839 template void G1ParCopyClosure<G1BarrierEvac, false>::do_oop_work(oop* p); |