diff --git a/src/hotspot/share/gc/serial/generation.hpp b/src/hotspot/share/gc/serial/generation.hpp index 9236af1801bfc..8d5f2c3dcef75 100644 --- a/src/hotspot/share/gc/serial/generation.hpp +++ b/src/hotspot/share/gc/serial/generation.hpp @@ -50,7 +50,6 @@ class DefNewGeneration; class GCMemoryManager; -class GenerationSpec; class ContiguousSpace; class CompactPoint; class OopClosure; diff --git a/src/hotspot/share/gc/serial/serialHeap.cpp b/src/hotspot/share/gc/serial/serialHeap.cpp index b672a23d49077..01f09863395ba 100644 --- a/src/hotspot/share/gc/serial/serialHeap.cpp +++ b/src/hotspot/share/gc/serial/serialHeap.cpp @@ -94,14 +94,6 @@ SerialHeap::SerialHeap() : CollectedHeap(), _young_gen(nullptr), _old_gen(nullptr), - _young_gen_spec(new GenerationSpec(Generation::DefNew, - NewSize, - MaxNewSize, - GenAlignment)), - _old_gen_spec(new GenerationSpec(Generation::MarkSweepCompact, - OldSize, - MaxOldSize, - GenAlignment)), _rem_set(nullptr), _soft_ref_policy(), _gc_policy_counters(new GCPolicyCounters("Copy:MSC", 2, 2)), @@ -302,14 +294,6 @@ PreGenGCValues SerialHeap::get_pre_gc_values() const { old_gen()->capacity()); } -GenerationSpec* SerialHeap::young_gen_spec() const { - return _young_gen_spec; -} - -GenerationSpec* SerialHeap::old_gen_spec() const { - return _old_gen_spec; -} - size_t SerialHeap::capacity() const { return _young_gen->capacity() + _old_gen->capacity(); } diff --git a/src/hotspot/share/gc/serial/serialHeap.hpp b/src/hotspot/share/gc/serial/serialHeap.hpp index 8780738a0e8d4..6cce1d9e8e7eb 100644 --- a/src/hotspot/share/gc/serial/serialHeap.hpp +++ b/src/hotspot/share/gc/serial/serialHeap.hpp @@ -36,7 +36,6 @@ class CardTableRS; class GCPolicyCounters; -class GenerationSpec; class GCMemoryManager; class MemoryPool; @@ -86,9 +85,6 @@ class SerialHeap : public CollectedHeap { TenuredGeneration* _old_gen; private: - GenerationSpec* _young_gen_spec; - GenerationSpec* _old_gen_spec; - // The singleton CardTable Remembered Set. CardTableRS* _rem_set; @@ -159,9 +155,6 @@ class SerialHeap : public CollectedHeap { MemRegion reserved_region() const { return _reserved; } bool is_in_reserved(const void* addr) const { return _reserved.contains(addr); } - GenerationSpec* young_gen_spec() const; - GenerationSpec* old_gen_spec() const; - SoftRefPolicy* soft_ref_policy() override { return &_soft_ref_policy; } // Performance Counter support diff --git a/src/hotspot/share/gc/serial/vmStructs_serial.hpp b/src/hotspot/share/gc/serial/vmStructs_serial.hpp index 3419430a2c9af..cc3e69133a54e 100644 --- a/src/hotspot/share/gc/serial/vmStructs_serial.hpp +++ b/src/hotspot/share/gc/serial/vmStructs_serial.hpp @@ -57,8 +57,6 @@ \ nonstatic_field(SerialHeap, _young_gen, DefNewGeneration*) \ nonstatic_field(SerialHeap, _old_gen, TenuredGeneration*) \ - nonstatic_field(SerialHeap, _young_gen_spec, GenerationSpec*) \ - nonstatic_field(SerialHeap, _old_gen_spec, GenerationSpec*) \ #define VM_TYPES_SERIALGC(declare_type, \ declare_toplevel_type, \ diff --git a/src/hotspot/share/gc/shared/generationSpec.cpp b/src/hotspot/share/gc/shared/generationSpec.cpp deleted file mode 100644 index 422bea62ae37f..0000000000000 --- a/src/hotspot/share/gc/shared/generationSpec.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "gc/serial/cardTableRS.hpp" -#include "gc/shared/generationSpec.hpp" -#include "runtime/java.hpp" -#include "utilities/macros.hpp" -#if INCLUDE_SERIALGC -#include "gc/serial/defNewGeneration.hpp" -#include "gc/serial/tenuredGeneration.hpp" -#endif - -Generation* GenerationSpec::init(ReservedSpace rs, CardTableRS* remset) { - switch (name()) { -#if INCLUDE_SERIALGC - case Generation::DefNew: - return new DefNewGeneration(rs, _init_size, _min_size, _max_size); - - case Generation::MarkSweepCompact: - return new TenuredGeneration(rs, _init_size, _min_size, _max_size, remset); -#endif - - default: - guarantee(false, "unrecognized GenerationName"); - return nullptr; - } -} diff --git a/src/hotspot/share/gc/shared/generationSpec.hpp b/src/hotspot/share/gc/shared/generationSpec.hpp deleted file mode 100644 index 03593b8f6752e..0000000000000 --- a/src/hotspot/share/gc/shared/generationSpec.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef SHARE_GC_SHARED_GENERATIONSPEC_HPP -#define SHARE_GC_SHARED_GENERATIONSPEC_HPP - -#include "gc/serial/generation.hpp" -#include "utilities/align.hpp" - -class CardTableRS; - -// The specification of a generation. This class also encapsulates -// some generation-specific behavior. This is done here rather than as a -// virtual function of Generation because these methods are needed in -// initialization of the Generations. -class GenerationSpec : public CHeapObj { - friend class VMStructs; -private: - Generation::Name _name; - size_t _init_size; - size_t _min_size; - size_t _max_size; - -public: - GenerationSpec(Generation::Name name, size_t init_size, size_t max_size, size_t alignment) : - _name(name), - _init_size(align_up(init_size, alignment)), - _min_size(_init_size), - _max_size(align_up(max_size, alignment)) - { } - - Generation* init(ReservedSpace rs, CardTableRS* remset); - - Generation::Name name() const { return _name; } - size_t init_size() const { return _init_size; } - size_t min_size() const { return _min_size; } - size_t max_size() const { return _max_size; } -}; - -typedef GenerationSpec* GenerationSpecPtr; - -#endif // SHARE_GC_SHARED_GENERATIONSPEC_HPP diff --git a/src/hotspot/share/gc/shared/vmStructs_gc.hpp b/src/hotspot/share/gc/shared/vmStructs_gc.hpp index fc306f34b90f3..c0f8c671d5f38 100644 --- a/src/hotspot/share/gc/shared/vmStructs_gc.hpp +++ b/src/hotspot/share/gc/shared/vmStructs_gc.hpp @@ -28,7 +28,6 @@ #include "gc/shared/ageTable.hpp" #include "gc/shared/cardTable.hpp" #include "gc/shared/collectedHeap.hpp" -#include "gc/shared/generationSpec.hpp" #include "gc/shared/oopStorage.hpp" #include "gc/shared/space.hpp" #if INCLUDE_EPSILONGC @@ -113,10 +112,6 @@ nonstatic_field(Generation::StatRecord, invocations, int) \ nonstatic_field(Generation::StatRecord, accumulated_time, elapsedTimer) \ \ - nonstatic_field(GenerationSpec, _name, Generation::Name) \ - nonstatic_field(GenerationSpec, _init_size, size_t) \ - nonstatic_field(GenerationSpec, _max_size, size_t) \ - \ nonstatic_field(MemRegion, _start, HeapWord*) \ nonstatic_field(MemRegion, _word_size, size_t) \ \ @@ -165,7 +160,6 @@ declare_toplevel_type(AgeTable) \ declare_toplevel_type(CardTable::CardValue) \ declare_toplevel_type(Generation::StatRecord) \ - declare_toplevel_type(GenerationSpec) \ declare_toplevel_type(HeapWord) \ declare_toplevel_type(MemRegion) \ declare_toplevel_type(ThreadLocalAllocBuffer) \ @@ -182,7 +176,6 @@ declare_toplevel_type(ContiguousSpace*) \ declare_toplevel_type(DefNewGeneration*) \ declare_toplevel_type(Generation*) \ - declare_toplevel_type(GenerationSpec**) \ declare_toplevel_type(HeapWord*) \ declare_toplevel_type(HeapWord* volatile) \ declare_toplevel_type(MemRegion*) \