8281637: Remove unused VerifyOption_G1UseNextMarking

Reviewed-by: tschatzl, iwalulya
This commit is contained in:
Stefan Johansson 2022-02-14 09:03:45 +00:00
parent 46f522962f
commit 2632d40dfc
9 changed files with 18 additions and 53 deletions

View File

@ -2405,7 +2405,6 @@ bool G1CollectedHeap::is_obj_dead_cond(const oop obj,
const VerifyOption vo) const {
switch (vo) {
case VerifyOption_G1UsePrevMarking: return is_obj_dead(obj, hr);
case VerifyOption_G1UseNextMarking: return is_obj_ill(obj, hr);
case VerifyOption_G1UseFullMarking: return is_obj_dead_full(obj, hr);
default: ShouldNotReachHere();
}
@ -2416,7 +2415,6 @@ bool G1CollectedHeap::is_obj_dead_cond(const oop obj,
const VerifyOption vo) const {
switch (vo) {
case VerifyOption_G1UsePrevMarking: return is_obj_dead(obj);
case VerifyOption_G1UseNextMarking: return is_obj_ill(obj);
case VerifyOption_G1UseFullMarking: return is_obj_dead_full(obj);
default: ShouldNotReachHere();
}

View File

@ -1236,11 +1236,6 @@ public:
// the region to which the object belongs.
inline bool is_obj_dead(const oop obj, const HeapRegion* hr) const;
// This function returns true when an object has been
// around since the previous marking and hasn't yet
// been marked during this marking, and is not in a closed archive region.
inline bool is_obj_ill(const oop obj, const HeapRegion* hr) const;
// Determine if an object is dead, given only the object itself.
// This will find the region to which the object belongs and
// then call the region version of the same function.
@ -1249,8 +1244,6 @@ public:
inline bool is_obj_dead(const oop obj) const;
inline bool is_obj_ill(const oop obj) const;
inline bool is_obj_dead_full(const oop obj, const HeapRegion* hr) const;
inline bool is_obj_dead_full(const oop obj) const;
@ -1302,15 +1295,11 @@ public:
// Perform verification.
// vo == UsePrevMarking -> use "prev" marking information,
// vo == UseNextMarking -> use "next" marking information
// vo == UseFullMarking -> use "next" marking bitmap but no TAMS
//
// NOTE: Only the "prev" marking information is guaranteed to be
// consistent most of the time, so most calls to this should use
// vo == UsePrevMarking.
// Currently, there is only one case where this is called with
// vo == UseNextMarking, which is to verify the "next" marking
// information at the end of remark.
// Currently there is only one place where this is called with
// vo == UseFullMarking, which is to verify the marking during a
// full GC.

View File

@ -226,20 +226,6 @@ inline bool G1CollectedHeap::is_obj_dead(const oop obj) const {
return is_obj_dead(obj, heap_region_containing(obj));
}
inline bool G1CollectedHeap::is_obj_ill(const oop obj, const HeapRegion* hr) const {
return
!hr->obj_allocated_since_next_marking(obj) &&
!is_marked_next(obj) &&
!hr->is_closed_archive();
}
inline bool G1CollectedHeap::is_obj_ill(const oop obj) const {
if (obj == NULL) {
return false;
}
return is_obj_ill(obj, heap_region_containing(obj));
}
inline bool G1CollectedHeap::is_obj_dead_full(const oop obj, const HeapRegion* hr) const {
return !is_marked_next(obj) && !hr->is_closed_archive();
}

View File

@ -41,7 +41,20 @@
#include "utilities/bitMap.inline.hpp"
inline bool G1CMIsAliveClosure::do_object_b(oop obj) {
return !_g1h->is_obj_ill(obj);
HeapRegion* hr = _g1h->heap_region_containing(cast_from_oop<HeapWord*>(obj));
// All objects allocated since the start of marking are considered live.
if (hr->obj_allocated_since_next_marking(obj)) {
return true;
}
// All objects in closed archive regions are live.
if (hr->is_closed_archive()) {
return true;
}
// All objects that are marked are live.
return _g1h->is_marked_next(obj);
}
inline bool G1CMSubjectToDiscoveryClosure::do_object_b(oop obj) {
@ -110,7 +123,6 @@ inline void G1CMTask::push(G1TaskQueueEntry task_entry) {
assert(task_entry.is_array_slice() || _g1h->is_in_reserved(task_entry.obj()), "invariant");
assert(task_entry.is_array_slice() || !_g1h->is_on_master_free_list(
_g1h->heap_region_containing(task_entry.obj())), "invariant");
assert(task_entry.is_array_slice() || !_g1h->is_obj_ill(task_entry.obj()), "invariant"); // FIXME!!!
assert(task_entry.is_array_slice() || _next_mark_bitmap->is_marked(cast_from_oop<HeapWord*>(task_entry.obj())), "invariant");
if (!_task_queue->push(task_entry)) {

View File

@ -53,7 +53,6 @@ private:
bool _failures;
public:
// _vo == UsePrevMarking -> use "prev" marking information,
// _vo == UseNextMarking -> use "next" marking information,
// _vo == UseFullMarking -> use "next" marking bitmap but no TAMS
VerifyRootsClosure(VerifyOption vo) :
_g1h(G1CollectedHeap::heap()),
@ -206,7 +205,6 @@ private:
VerifyOption _vo;
public:
// _vo == UsePrevMarking -> use "prev" marking information,
// _vo == UseNextMarking -> use "next" marking information,
// _vo == UseFullMarking -> use "next" marking bitmap but no TAMS.
VerifyObjsInRegionClosure(HeapRegion *hr, VerifyOption vo)
: _live_bytes(0), _hr(hr), _vo(vo) {
@ -359,7 +357,6 @@ private:
bool _failures;
public:
// _vo == UsePrevMarking -> use "prev" marking information,
// _vo == UseNextMarking -> use "next" marking information,
// _vo == UseFullMarking -> use "next" marking bitmap but no TAMS
VerifyRegionClosure(bool par, VerifyOption vo)
: _par(par),
@ -407,16 +404,10 @@ public:
} else if (!r->is_starts_humongous()) {
VerifyObjsInRegionClosure not_dead_yet_cl(r, _vo);
r->object_iterate(&not_dead_yet_cl);
if (_vo != VerifyOption_G1UseNextMarking) {
if (r->max_live_bytes() < not_dead_yet_cl.live_bytes()) {
log_error(gc, verify)("[" PTR_FORMAT "," PTR_FORMAT "] max_live_bytes " SIZE_FORMAT " < calculated " SIZE_FORMAT,
if (r->max_live_bytes() < not_dead_yet_cl.live_bytes()) {
log_error(gc, verify)("[" PTR_FORMAT "," PTR_FORMAT "] max_live_bytes " SIZE_FORMAT " < calculated " SIZE_FORMAT,
p2i(r->bottom()), p2i(r->end()), r->max_live_bytes(), not_dead_yet_cl.live_bytes());
_failures = true;
}
} else {
// When vo == UseNextMarking we cannot currently do a sanity
// check on the live bytes as the calculation has not been
// finalized yet.
_failures = true;
}
}
}
@ -435,7 +426,6 @@ private:
public:
// _vo == UsePrevMarking -> use "prev" marking information,
// _vo == UseNextMarking -> use "next" marking information,
// _vo == UseFullMarking -> use "next" marking bitmap but no TAMS
G1ParVerifyTask(G1CollectedHeap* g1h, VerifyOption vo) :
WorkerTask("Parallel verify task"),

View File

@ -61,15 +61,11 @@ public:
// Perform verification.
// vo == UsePrevMarking -> use "prev" marking information,
// vo == UseNextMarking -> use "next" marking information
// vo == UseFullMarking -> use "next" marking bitmap but no TAMS
//
// NOTE: Only the "prev" marking information is guaranteed to be
// consistent most of the time, so most calls to this should use
// vo == UsePrevMarking.
// Currently, there is only one case where this is called with
// vo == UseNextMarking, which is to verify the "next" marking
// information at the end of remark.
// Currently there is only one place where this is called with
// vo == UseFullMarking, which is to verify the marking during a
// full GC.

View File

@ -479,7 +479,6 @@ protected:
VerifyOption _vo;
public:
// _vo == UsePrevMarking -> use "prev" marking information,
// _vo == UseNextMarking -> use "next" marking information,
// _vo == UseFullMarking -> use "next" marking bitmap but no TAMS.
G1VerificationClosure(G1CollectedHeap* g1h, VerifyOption vo) :
_g1h(g1h), _ct(g1h->card_table()),

View File

@ -582,15 +582,11 @@ public:
void print_on(outputStream* st) const;
// vo == UsePrevMarking -> use "prev" marking information,
// vo == UseNextMarking -> use "next" marking information
// vo == UseFullMarking -> use "next" marking bitmap but no TAMS
//
// NOTE: Only the "prev" marking information is guaranteed to be
// consistent most of the time, so most calls to this should use
// vo == UsePrevMarking.
// Currently, there is only one case where this is called with
// vo == UseNextMarking, which is to verify the "next" marking
// information at the end of remark.
// Currently there is only one place where this is called with
// vo == UseFullMarking, which is to verify the marking during a
// full GC.

View File

@ -30,8 +30,7 @@ enum VerifyOption {
// G1
VerifyOption_G1UsePrevMarking = VerifyOption_Default,
VerifyOption_G1UseNextMarking = VerifyOption_G1UsePrevMarking + 1,
VerifyOption_G1UseFullMarking = VerifyOption_G1UseNextMarking + 1
VerifyOption_G1UseFullMarking = VerifyOption_G1UsePrevMarking + 1
};
#endif // SHARE_GC_SHARED_VERIFYOPTION_HPP