< prev index next >
src/share/vm/gc/g1/g1OopClosures.inline.hpp
Print this page
rev 12508 : imported patch 8162104-use-is_in_cset-instead-of-obj_in_cs
rev 12513 : 8071278: Fix the closure mess in G1RemSet::refine_card()
Summary: Remove the use of many nested closure in the code to refine a card.
Reviewed-by: kbarrett, sjohanss
*** 34,68 ****
#include "gc/g1/heapRegion.inline.hpp"
#include "gc/g1/heapRegionRemSet.hpp"
#include "memory/iterator.inline.hpp"
#include "runtime/prefetch.inline.hpp"
- /*
- * This really ought to be an inline function, but apparently the C++
- * compiler sometimes sees fit to ignore inline declarations. Sigh.
- */
-
- template <class T>
- inline void FilterIntoCSClosure::do_oop_work(T* p) {
- T heap_oop = oopDesc::load_heap_oop(p);
- if (!oopDesc::is_null(heap_oop) &&
- _g1->is_in_cset_or_humongous(oopDesc::decode_heap_oop_not_null(heap_oop))) {
- _oc->do_oop(p);
- }
- }
-
- template <class T>
- inline void FilterOutOfRegionClosure::do_oop_nv(T* p) {
- T heap_oop = oopDesc::load_heap_oop(p);
- if (!oopDesc::is_null(heap_oop)) {
- HeapWord* obj_hw = (HeapWord*)oopDesc::decode_heap_oop_not_null(heap_oop);
- if (obj_hw < _r_bottom || obj_hw >= _r_end) {
- _oc->do_oop(p);
- }
- }
- }
-
// This closure is applied to the fields of the objects that have just been copied.
template <class T>
inline void G1ParScanClosure::do_oop_nv(T* p) {
T heap_oop = oopDesc::load_heap_oop(p);
--- 34,43 ----
*** 134,170 ****
_cm->grayRoot(obj, hr);
}
}
template <class T>
! inline void G1Mux2Closure::do_oop_work(T* p) {
! // Apply first closure; then apply the second.
! _c1->do_oop(p);
! _c2->do_oop(p);
! }
! void G1Mux2Closure::do_oop(oop* p) { do_oop_work(p); }
! void G1Mux2Closure::do_oop(narrowOop* p) { do_oop_work(p); }
!
! template <class T>
! inline void G1TriggerClosure::do_oop_work(T* p) {
! // Record that this closure was actually applied (triggered).
! _triggered = true;
! }
! void G1TriggerClosure::do_oop(oop* p) { do_oop_work(p); }
! void G1TriggerClosure::do_oop(narrowOop* p) { do_oop_work(p); }
!
! template <class T>
! inline void G1InvokeIfNotTriggeredClosure::do_oop_work(T* p) {
! if (!_trigger_cl->triggered()) {
! _oop_cl->do_oop(p);
! }
! }
! void G1InvokeIfNotTriggeredClosure::do_oop(oop* p) { do_oop_work(p); }
! void G1InvokeIfNotTriggeredClosure::do_oop(narrowOop* p) { do_oop_work(p); }
!
! template <class T>
! inline void G1UpdateRSOrPushRefOopClosure::do_oop_work(T* p) {
oop obj = oopDesc::load_decode_heap_oop(p);
if (obj == NULL) {
return;
}
--- 109,119 ----
_cm->grayRoot(obj, hr);
}
}
template <class T>
! inline void G1UpdateRSOrPushRefOopClosure::do_oop_nv(T* p) {
oop obj = oopDesc::load_decode_heap_oop(p);
if (obj == NULL) {
return;
}
*** 215,224 ****
--- 164,174 ----
assert(_push_ref_cl != NULL, "should not be null");
// Push the reference in the refs queue of the G1ParScanThreadState
// instance for this worker thread.
_push_ref_cl->do_oop(p);
}
+ _has_refs_into_cset = true;
// Deferred updates to the CSet are either discarded (in the normal case),
// or processed (if an evacuation failure occurs) at the end
// of the collection.
// See G1RemSet::cleanup_after_oops_into_collection_set_do().
*** 230,241 ****
// the referenced object.
assert(to->rem_set() != NULL, "Need per-region 'into' remsets.");
to->rem_set()->add_reference(p, _worker_i);
}
}
! void G1UpdateRSOrPushRefOopClosure::do_oop(oop* p) { do_oop_work(p); }
! void G1UpdateRSOrPushRefOopClosure::do_oop(narrowOop* p) { do_oop_work(p); }
template <class T>
void G1ParCopyHelper::do_klass_barrier(T* p, oop new_obj) {
if (_g1->heap_region_containing(new_obj)->is_young()) {
_scanned_klass->record_modified_oops();
--- 180,191 ----
// the referenced object.
assert(to->rem_set() != NULL, "Need per-region 'into' remsets.");
to->rem_set()->add_reference(p, _worker_i);
}
}
! void G1UpdateRSOrPushRefOopClosure::do_oop(oop* p) { do_oop_nv(p); }
! void G1UpdateRSOrPushRefOopClosure::do_oop(narrowOop* p) { do_oop_nv(p); }
template <class T>
void G1ParCopyHelper::do_klass_barrier(T* p, oop new_obj) {
if (_g1->heap_region_containing(new_obj)->is_young()) {
_scanned_klass->record_modified_oops();
< prev index next >