8357944: Remove unused CollectedHeap::is_maximal_no_gc

Reviewed-by: jsikstro, tschatzl
This commit is contained in:
Albert Mingkun Yang 2025-06-02 08:23:06 +00:00
parent 3f59bfd2e1
commit 6418306211
12 changed files with 1 additions and 51 deletions

View File

@ -80,11 +80,6 @@ public:
bool requires_barriers(stackChunkOop obj) const override { return false; }
bool is_maximal_no_gc() const override {
// No GC is going to happen. Return "we are at max", when we are about to fail.
return used() == capacity();
}
// Allocation
HeapWord* allocate_work(size_t size, bool verbose = true);
HeapWord* mem_allocate(size_t size, bool* gc_overhead_limit_was_exceeded) override;

View File

@ -966,7 +966,7 @@ public:
// end fields defining the extent of the contiguous allocation region.)
// But G1CollectedHeap doesn't yet support this.
bool is_maximal_no_gc() const override {
bool is_maximal_no_gc() const {
return _hrm.num_inactive_regions() == 0;
}

View File

@ -207,12 +207,6 @@ size_t ParallelScavengeHeap::used() const {
return value;
}
bool ParallelScavengeHeap::is_maximal_no_gc() const {
// We don't expand young-gen except at a GC.
return old_gen()->is_maximal_no_gc();
}
size_t ParallelScavengeHeap::max_capacity() const {
size_t estimated = reserved_region().byte_size();
if (UseAdaptiveSizePolicy) {

View File

@ -158,11 +158,6 @@ public:
size_t capacity() const override;
size_t used() const override;
// Return "true" if all generations have reached the
// maximal committed limit that they can reach, without a garbage
// collection.
bool is_maximal_no_gc() const override;
void register_nmethod(nmethod* nm) override;
void unregister_nmethod(nmethod* nm) override;
void verify_nmethod(nmethod* nm) override;

View File

@ -109,10 +109,6 @@ class PSOldGen : public CHeapObj<mtGC> {
size_t capacity_in_bytes() const { return object_space()->capacity_in_bytes(); }
size_t used_in_bytes() const { return object_space()->used_in_bytes(); }
bool is_maximal_no_gc() const {
return virtual_space()->uncommitted_size() == 0;
}
void complete_loaded_archive_space(MemRegion archive_space);
// Calculating new sizes

View File

@ -766,11 +766,6 @@ void SerialHeap::prepare_for_verify() {
ensure_parsability(false); // no need to retire TLABs
}
bool SerialHeap::is_maximal_no_gc() const {
// We don't expand young-gen except at a GC.
return _old_gen->is_maximal_no_gc();
}
void SerialHeap::save_marks() {
_young_gen_saved_top = _young_gen->to()->top();
_old_gen_saved_top = _old_gen->space()->top();

View File

@ -216,11 +216,6 @@ public:
void print_heap_change(const PreGenGCValues& pre_gc_values) const;
// Return "true" if all generations have reached the
// maximal committed limit that they can reach, without a garbage
// collection.
virtual bool is_maximal_no_gc() const override;
// This function returns the CardTableRS object that allows us to scan
// generations in a fully generational heap.
CardTableRS* rem_set() { return _rem_set; }

View File

@ -102,12 +102,6 @@ public:
MemRegion prev_used_region() const { return _prev_used_region; }
void save_used_region() { _prev_used_region = used_region(); }
// Returns true if this generation cannot be expanded further
// without a GC.
bool is_maximal_no_gc() const {
return _virtual_space.uncommitted_size() == 0;
}
HeapWord* block_start(const void* addr) const;
void scan_old_to_young_refs(HeapWord* saved_top_in_old_gen);

View File

@ -259,11 +259,6 @@ protected:
size_t used_at_last_gc() const { return _used_at_last_gc; }
void update_capacity_and_used_at_gc();
// Return "true" if the part of the heap that allocates Java
// objects has reached the maximal committed limit that it can
// reach, without a garbage collection.
virtual bool is_maximal_no_gc() const = 0;
// Support for java.lang.Runtime.maxMemory(): return the maximum amount of
// memory that the vm could make available for storing 'normal' java objects.
// This is based on the reserved address space, but should not include space

View File

@ -614,8 +614,6 @@ private:
// and can be stubbed out.
//
public:
bool is_maximal_no_gc() const override shenandoah_not_implemented_return(false);
// Check the pointer is in active part of Java heap.
// Use is_in_reserved to check if object is within heap bounds.
bool is_in(const void* p) const override;

View File

@ -126,12 +126,6 @@ size_t ZCollectedHeap::unused() const {
return _heap.unused();
}
bool ZCollectedHeap::is_maximal_no_gc() const {
// Not supported
ShouldNotReachHere();
return false;
}
bool ZCollectedHeap::is_in(const void* p) const {
return _heap.is_in((uintptr_t)p);
}

View File

@ -70,7 +70,6 @@ public:
size_t used() const override;
size_t unused() const override;
bool is_maximal_no_gc() const override;
bool is_in(const void* p) const override;
bool requires_barriers(stackChunkOop obj) const override;