Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8252034: G1: Remove *g1_reserved* methods
Remove duplicate methods.

Reviewed-by: sjohanss, kbarrett
  • Loading branch information
Thomas Schatzl committed Aug 21, 2020
1 parent 3b9afac commit f19d5549555718b0c86e35cc5c6c1ecdfec35c5d
@@ -1141,18 +1141,6 @@ class G1CollectedHeap : public CollectedHeap {
inline G1HeapRegionAttr region_attr(const void* obj) const;
inline G1HeapRegionAttr region_attr(uint idx) const;

// Return "TRUE" iff the given object address is in the reserved
// region of g1.
bool is_in_g1_reserved(const void* p) const {
return _hrm->reserved().contains(p);
}

// Returns a MemRegion that corresponds to the space that has been
// reserved for the heap
MemRegion g1_reserved() const {
return _hrm->reserved();
}

MemRegion reserved_region() const {
return _reserved;
}
@@ -87,18 +87,18 @@ inline HeapWord* G1CollectedHeap::bottom_addr_for_region(uint index) const {
template <class T>
inline HeapRegion* G1CollectedHeap::heap_region_containing(const T addr) const {
assert(addr != NULL, "invariant");
assert(is_in_g1_reserved((const void*) addr),
assert(is_in_reserved((const void*) addr),
"Address " PTR_FORMAT " is outside of the heap ranging from [" PTR_FORMAT " to " PTR_FORMAT ")",
p2i((void*)addr), p2i(g1_reserved().start()), p2i(g1_reserved().end()));
p2i((void*)addr), p2i(reserved_region().start()), p2i(reserved_region().end()));
return _hrm->addr_to_region((HeapWord*)(void*) addr);
}

template <class T>
inline HeapRegion* G1CollectedHeap::heap_region_containing_or_null(const T addr) const {
assert(addr != NULL, "invariant");
assert(is_in_g1_reserved((const void*) addr),
assert(is_in_reserved((const void*) addr),
"Address " PTR_FORMAT " is outside of the heap ranging from [" PTR_FORMAT " to " PTR_FORMAT ")",
p2i((void*)addr), p2i(g1_reserved().start()), p2i(g1_reserved().end()));
p2i((void*)addr), p2i(reserved_region().start()), p2i(reserved_region().end()));
uint const region_idx = addr_to_region(addr);
return region_at_or_null(region_idx);
}
@@ -1664,7 +1664,7 @@ class G1ObjectCountIsAliveClosure: public BoolObjectClosure {

bool do_object_b(oop obj) {
return obj != NULL &&
(!_g1h->is_in_g1_reserved(obj) || !_g1h->is_obj_dead(obj));
(!_g1h->is_in_reserved(obj) || !_g1h->is_obj_dead(obj));
}
};

@@ -1830,7 +1830,7 @@ G1ConcurrentMark::claim_region(uint worker_id) {
HeapWord* finger = _finger;

while (finger < _heap.end()) {
assert(_g1h->is_in_g1_reserved(finger), "invariant");
assert(_g1h->is_in_reserved(finger), "invariant");

HeapRegion* curr_region = _g1h->heap_region_containing(finger);
// Make sure that the reads below do not float before loading curr_region.
@@ -2893,15 +2893,15 @@ G1PrintRegionLivenessInfoClosure::G1PrintRegionLivenessInfoClosure(const char* p
}

G1CollectedHeap* g1h = G1CollectedHeap::heap();
MemRegion g1_reserved = g1h->g1_reserved();
MemRegion reserved = g1h->reserved_region();
double now = os::elapsedTime();

// Print the header of the output.
log_trace(gc, liveness)(G1PPRL_LINE_PREFIX" PHASE %s @ %1.3f", phase_name, now);
log_trace(gc, liveness)(G1PPRL_LINE_PREFIX" HEAP"
G1PPRL_SUM_ADDR_FORMAT("reserved")
G1PPRL_SUM_BYTE_FORMAT("region-size"),
p2i(g1_reserved.start()), p2i(g1_reserved.end()),
p2i(reserved.start()), p2i(reserved.end()),
HeapRegion::GrainBytes);
log_trace(gc, liveness)(G1PPRL_LINE_PREFIX);
log_trace(gc, liveness)(G1PPRL_LINE_PREFIX
@@ -106,7 +106,7 @@ inline void G1CMMarkStack::iterate(Fn fn) const {
inline void G1CMTask::scan_task_entry(G1TaskQueueEntry task_entry) { process_grey_task_entry<true>(task_entry); }

inline void G1CMTask::push(G1TaskQueueEntry task_entry) {
assert(task_entry.is_array_slice() || _g1h->is_in_g1_reserved(task_entry.obj()), "invariant");
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!!!
@@ -125,14 +125,14 @@ void G1ParScanThreadState::verify_task(narrowOop* task) const {
assert(task != NULL, "invariant");
assert(UseCompressedOops, "sanity");
oop p = RawAccess<>::oop_load(task);
assert(_g1h->is_in_g1_reserved(p),
assert(_g1h->is_in_reserved(p),
"task=" PTR_FORMAT " p=" PTR_FORMAT, p2i(task), p2i(p));
}

void G1ParScanThreadState::verify_task(oop* task) const {
assert(task != NULL, "invariant");
oop p = RawAccess<>::oop_load(task);
assert(_g1h->is_in_g1_reserved(p),
assert(_g1h->is_in_reserved(p),
"task=" PTR_FORMAT " p=" PTR_FORMAT, p2i(task), p2i(p));
}

0 comments on commit f19d554

Please sign in to comment.