Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 14486:4f227ecd7beb
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 | Mon, 24 Feb 2014 09:40:49 +0100 |
parents | e9d5c28e5059 |
children | 97300b6165f8 |
comparison
equal
deleted
inserted
replaced
14485:e9d5c28e5059 | 14486:4f227ecd7beb |
---|---|
4787 } | 4787 } |
4788 | 4788 |
4789 template <G1Barrier barrier, bool do_mark_object> | 4789 template <G1Barrier barrier, bool do_mark_object> |
4790 template <class T> | 4790 template <class T> |
4791 void G1ParCopyClosure<barrier, do_mark_object>::do_oop_work(T* p) { | 4791 void G1ParCopyClosure<barrier, do_mark_object>::do_oop_work(T* p) { |
4792 oop obj = oopDesc::load_decode_heap_oop(p); | 4792 T heap_oop = oopDesc::load_heap_oop(p); |
4793 | |
4794 if (oopDesc::is_null(heap_oop)) { | |
4795 return; | |
4796 } | |
4797 | |
4798 oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); | |
4793 | 4799 |
4794 assert(_worker_id == _par_scan_state->queue_num(), "sanity"); | 4800 assert(_worker_id == _par_scan_state->queue_num(), "sanity"); |
4795 | 4801 |
4796 // here the null check is implicit in the cset_fast_test() test | |
4797 if (_g1->in_cset_fast_test(obj)) { | 4802 if (_g1->in_cset_fast_test(obj)) { |
4798 oop forwardee; | 4803 oop forwardee; |
4799 if (obj->is_forwarded()) { | 4804 if (obj->is_forwarded()) { |
4800 forwardee = obj->forwardee(); | 4805 forwardee = obj->forwardee(); |
4801 } else { | 4806 } else { |
4814 } | 4819 } |
4815 } else { | 4820 } else { |
4816 // The object is not in collection set. If we're a root scanning | 4821 // The object is not in collection set. If we're a root scanning |
4817 // closure during an initial mark pause (i.e. do_mark_object will | 4822 // closure during an initial mark pause (i.e. do_mark_object will |
4818 // be true) then attempt to mark the object. | 4823 // be true) then attempt to mark the object. |
4819 if (do_mark_object && _g1->is_in_g1_reserved(obj)) { | 4824 if (do_mark_object) { |
4820 mark_object(obj); | 4825 mark_object(obj); |
4821 } | 4826 } |
4822 } | 4827 } |
4823 | 4828 |
4824 if (barrier == G1BarrierEvac && obj != NULL) { | 4829 if (barrier == G1BarrierEvac) { |
4825 _par_scan_state->update_rs(_from, p, _worker_id); | 4830 _par_scan_state->update_rs(_from, p, _worker_id); |
4826 } | 4831 } |
4827 } | 4832 } |
4828 | 4833 |
4829 template void G1ParCopyClosure<G1BarrierEvac, false>::do_oop_work(oop* p); | 4834 template void G1ParCopyClosure<G1BarrierEvac, false>::do_oop_work(oop* p); |