8224815: Remove non-GC uses of CollectedHeap::is_in_reserved()

Reviewed-by: stefank, coleenp
This commit is contained in:
Erik Österlund 2019-09-05 08:26:49 +02:00
parent d19e6eae9e
commit f869706f5f
55 changed files with 242 additions and 239 deletions

View file

@ -51,6 +51,7 @@ class GCTracer;
class GCMemoryManager;
class MemoryPool;
class MetaspaceSummary;
class ReservedHeapSpace;
class SoftRefPolicy;
class Thread;
class ThreadClosure;
@ -102,9 +103,10 @@ class CollectedHeap : public CHeapObj<mtInternal> {
private:
GCHeapLog* _gc_heap_log;
protected:
// Not used by all GCs
MemRegion _reserved;
protected:
bool _is_gc_active;
// Used for filler objects (static, but initialized in ctor).
@ -203,9 +205,7 @@ class CollectedHeap : public CHeapObj<mtInternal> {
virtual void safepoint_synchronize_begin() {}
virtual void safepoint_synchronize_end() {}
void initialize_reserved_region(HeapWord *start, HeapWord *end);
MemRegion reserved_region() const { return _reserved; }
address base() const { return (address)reserved_region().start(); }
void initialize_reserved_region(const ReservedHeapSpace& rs);
virtual size_t capacity() const = 0;
virtual size_t used() const = 0;
@ -226,15 +226,6 @@ class CollectedHeap : public CHeapObj<mtInternal> {
// spaces).
virtual size_t max_capacity() const = 0;
// Returns "TRUE" if "p" points into the reserved area of the heap.
bool is_in_reserved(const void* p) const {
return _reserved.contains(p);
}
bool is_in_reserved_or_null(const void* p) const {
return p == NULL || is_in_reserved(p);
}
// Returns "TRUE" iff "p" points into the committed areas of the heap.
// This method can be expensive so avoid using it in performance critical
// code.
@ -242,6 +233,11 @@ class CollectedHeap : public CHeapObj<mtInternal> {
DEBUG_ONLY(bool is_in_or_null(const void* p) const { return p == NULL || is_in(p); })
// This function verifies that "addr" is a valid oop location, w.r.t. heap
// datastructures such as bitmaps and virtual memory address. It does *not*
// check if the location is within committed heap memory.
virtual void check_oop_location(void* addr) const;
virtual uint32_t hash_oop(oop obj) const;
void set_gc_cause(GCCause::Cause v) {