mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-03 11:38:44 +00:00
8274068: Rename G1ScanInYoungSetter to G1SkipCardEnqueueSetter
Reviewed-by: sjohanss, ayang
This commit is contained in:
parent
7f78803b09
commit
3f73ca7fcd
@ -85,19 +85,19 @@ public:
|
||||
|
||||
// This closure is applied to the fields of the objects that have just been copied during evacuation.
|
||||
class G1ScanEvacuatedObjClosure : public G1ScanClosureBase {
|
||||
friend class G1ScanInYoungSetter;
|
||||
friend class G1SkipCardEnqueueSetter;
|
||||
|
||||
enum ScanningInYoungValues {
|
||||
enum SkipCardEnqueueTristate {
|
||||
False = 0,
|
||||
True,
|
||||
Uninitialized
|
||||
};
|
||||
|
||||
ScanningInYoungValues _scanning_in_young;
|
||||
SkipCardEnqueueTristate _skip_card_enqueue;
|
||||
|
||||
public:
|
||||
G1ScanEvacuatedObjClosure(G1CollectedHeap* g1h, G1ParScanThreadState* par_scan_state) :
|
||||
G1ScanClosureBase(g1h, par_scan_state), _scanning_in_young(Uninitialized) { }
|
||||
G1ScanClosureBase(g1h, par_scan_state), _skip_card_enqueue(Uninitialized) { }
|
||||
|
||||
template <class T> void do_oop_work(T* p);
|
||||
virtual void do_oop(oop* p) { do_oop_work(p); }
|
||||
@ -111,18 +111,18 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
// RAII object to properly set the _scanning_in_young field in G1ScanEvacuatedObjClosure.
|
||||
class G1ScanInYoungSetter : public StackObj {
|
||||
// RAII object to properly set the _skip_card_enqueue field in G1ScanEvacuatedObjClosure.
|
||||
class G1SkipCardEnqueueSetter : public StackObj {
|
||||
G1ScanEvacuatedObjClosure* _closure;
|
||||
|
||||
public:
|
||||
G1ScanInYoungSetter(G1ScanEvacuatedObjClosure* closure, bool new_value) : _closure(closure) {
|
||||
assert(_closure->_scanning_in_young == G1ScanEvacuatedObjClosure::Uninitialized, "Must not be set");
|
||||
_closure->_scanning_in_young = new_value ? G1ScanEvacuatedObjClosure::True : G1ScanEvacuatedObjClosure::False;
|
||||
G1SkipCardEnqueueSetter(G1ScanEvacuatedObjClosure* closure, bool new_value) : _closure(closure) {
|
||||
assert(_closure->_skip_card_enqueue == G1ScanEvacuatedObjClosure::Uninitialized, "Must not be set");
|
||||
_closure->_skip_card_enqueue = new_value ? G1ScanEvacuatedObjClosure::True : G1ScanEvacuatedObjClosure::False;
|
||||
}
|
||||
|
||||
~G1ScanInYoungSetter() {
|
||||
DEBUG_ONLY(_closure->_scanning_in_young = G1ScanEvacuatedObjClosure::Uninitialized;)
|
||||
~G1SkipCardEnqueueSetter() {
|
||||
DEBUG_ONLY(_closure->_skip_card_enqueue = G1ScanEvacuatedObjClosure::Uninitialized;)
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -88,8 +88,8 @@ inline void G1ScanEvacuatedObjClosure::do_oop_work(T* p) {
|
||||
prefetch_and_push(p, obj);
|
||||
} else if (!HeapRegion::is_in_same_region(p, obj)) {
|
||||
handle_non_cset_obj_common(region_attr, p, obj);
|
||||
assert(_scanning_in_young != Uninitialized, "Scan location has not been initialized.");
|
||||
if (_scanning_in_young == True) {
|
||||
assert(_skip_card_enqueue != Uninitialized, "Scan location has not been initialized.");
|
||||
if (_skip_card_enqueue == True) {
|
||||
return;
|
||||
}
|
||||
_par_scan_state->enqueue_card_if_tracked(region_attr, p, obj);
|
||||
|
||||
@ -242,7 +242,7 @@ void G1ParScanThreadState::do_partial_array(PartialArrayScanTask task) {
|
||||
}
|
||||
|
||||
HeapRegion* hr = _g1h->heap_region_containing(to_array);
|
||||
G1ScanInYoungSetter x(&_scanner, hr->is_young());
|
||||
G1SkipCardEnqueueSetter x(&_scanner, hr->is_young());
|
||||
// Process claimed task. The length of to_array is not correct, but
|
||||
// fortunately the iteration ignores the length field and just relies
|
||||
// on start/end.
|
||||
@ -274,7 +274,7 @@ void G1ParScanThreadState::start_partial_objarray(G1HeapRegionAttr dest_attr,
|
||||
push_on_queue(ScannerTask(PartialArrayScanTask(from_obj)));
|
||||
}
|
||||
|
||||
G1ScanInYoungSetter x(&_scanner, dest_attr.is_young());
|
||||
G1SkipCardEnqueueSetter x(&_scanner, dest_attr.is_young());
|
||||
// Process the initial chunk. No need to process the type in the
|
||||
// klass, as it will already be handled by processing the built-in
|
||||
// module. The length of to_array is not correct, but fortunately
|
||||
@ -519,7 +519,7 @@ oop G1ParScanThreadState::do_copy_to_survivor_space(G1HeapRegionAttr const regio
|
||||
_string_dedup_requests.add(old);
|
||||
}
|
||||
|
||||
G1ScanInYoungSetter x(&_scanner, dest_attr.is_young());
|
||||
G1SkipCardEnqueueSetter x(&_scanner, dest_attr.is_young());
|
||||
obj->oop_iterate_backwards(&_scanner, klass);
|
||||
return obj;
|
||||
|
||||
@ -606,7 +606,7 @@ oop G1ParScanThreadState::handle_evacuation_failure_par(oop old, markWord m, siz
|
||||
_preserved_marks->push_if_necessary(old, m);
|
||||
_evacuation_failed_info.register_copy_failure(word_sz);
|
||||
|
||||
G1ScanInYoungSetter x(&_scanner, r->is_young());
|
||||
G1SkipCardEnqueueSetter x(&_scanner, r->is_young());
|
||||
old->oop_iterate_backwards(&_scanner);
|
||||
|
||||
return old;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user