diff --git a/src/hotspot/share/gc/serial/defNewGeneration.hpp b/src/hotspot/share/gc/serial/defNewGeneration.hpp index 5bfce3c2eef..ddc177f6ccc 100644 --- a/src/hotspot/share/gc/serial/defNewGeneration.hpp +++ b/src/hotspot/share/gc/serial/defNewGeneration.hpp @@ -201,9 +201,6 @@ class DefNewGeneration: public Generation { // Return true if the expansion was successful. bool expand(size_t bytes); - // DefNewGeneration cannot currently expand except at - // a GC. - virtual bool is_maximal_no_gc() const { return true; } // Iteration void object_iterate(ObjectClosure* blk); diff --git a/src/hotspot/share/gc/serial/generation.hpp b/src/hotspot/share/gc/serial/generation.hpp index 2239046a4e9..e4545b56f44 100644 --- a/src/hotspot/share/gc/serial/generation.hpp +++ b/src/hotspot/share/gc/serial/generation.hpp @@ -105,12 +105,6 @@ class Generation: public CHeapObj { // The largest number of contiguous free bytes in this or any higher generation. virtual size_t max_contiguous_available() const; - // Returns true if this generation cannot be expanded further - // without a GC. Override as appropriate. - virtual bool is_maximal_no_gc() const { - return _virtual_space.uncommitted_size() == 0; - } - MemRegion reserved() const { return _reserved; } /* Returns "TRUE" iff "p" points into the reserved area of the generation. */ diff --git a/src/hotspot/share/gc/serial/serialHeap.cpp b/src/hotspot/share/gc/serial/serialHeap.cpp index ee7684c9107..fe0ba9f3e88 100644 --- a/src/hotspot/share/gc/serial/serialHeap.cpp +++ b/src/hotspot/share/gc/serial/serialHeap.cpp @@ -963,7 +963,8 @@ void SerialHeap::generation_iterate(GenClosure* cl, } bool SerialHeap::is_maximal_no_gc() const { - return _young_gen->is_maximal_no_gc() && _old_gen->is_maximal_no_gc(); + // We don't expand young-gen except at a GC. + return _old_gen->is_maximal_no_gc(); } void SerialHeap::save_marks() { diff --git a/src/hotspot/share/gc/serial/tenuredGeneration.hpp b/src/hotspot/share/gc/serial/tenuredGeneration.hpp index a2461540a35..1b7347161e7 100644 --- a/src/hotspot/share/gc/serial/tenuredGeneration.hpp +++ b/src/hotspot/share/gc/serial/tenuredGeneration.hpp @@ -98,6 +98,12 @@ class TenuredGeneration: public Generation { 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* p) const; void scan_old_to_young_refs();