diff -r aba258cd7df8 -r dd84de796f2c src/hotspot/share/gc/shared/collectedHeap.hpp --- a/src/hotspot/share/gc/shared/collectedHeap.hpp Thu Sep 05 08:26:44 2019 +0200 +++ b/src/hotspot/share/gc/shared/collectedHeap.hpp Thu Sep 05 08:26:49 2019 +0200 @@ -51,6 +51,7 @@ class GCMemoryManager; class MemoryPool; class MetaspaceSummary; +class ReservedHeapSpace; class SoftRefPolicy; class Thread; class ThreadClosure; @@ -102,9 +103,10 @@ 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 @@ 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 @@ // 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 @@ 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) {