8330155: Serial: Remove TenuredSpace

Reviewed-by: ayang, cjplummer, tschatzl
This commit is contained in:
Guoxiong Li 2024-04-24 11:41:21 +00:00
parent 7bb59dc8da
commit 2bb5cf5f33
21 changed files with 35 additions and 151 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2024, 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
@ -27,7 +27,7 @@
#include "gc/g1/g1CollectionSetCandidates.hpp"
#include "gc/g1/g1CollectionSetChooser.hpp"
#include "gc/g1/g1HeapRegionRemSet.inline.hpp"
#include "gc/shared/space.inline.hpp"
#include "gc/shared/space.hpp"
#include "runtime/atomic.hpp"
#include "utilities/quickSort.hpp"

View File

@ -27,7 +27,7 @@
#include "gc/serial/cardTableRS.hpp"
#include "gc/serial/generation.hpp"
#include "gc/serial/serialHeap.inline.hpp"
#include "gc/shared/space.inline.hpp"
#include "gc/shared/space.hpp"
#include "memory/iterator.inline.hpp"
#include "utilities/align.hpp"

View File

@ -31,7 +31,6 @@
class OldGenScanClosure;
class TenuredGeneration;
class TenuredSpace;
// This RemSet uses a card table both as shared data structure
// for a mod ref barrier set and for the rem set information.

View File

@ -42,7 +42,7 @@
#include "gc/shared/preservedMarks.inline.hpp"
#include "gc/shared/referencePolicy.hpp"
#include "gc/shared/referenceProcessorPhaseTimes.hpp"
#include "gc/shared/space.inline.hpp"
#include "gc/shared/space.hpp"
#include "gc/shared/spaceDecorator.inline.hpp"
#include "gc/shared/strongRootsScope.hpp"
#include "gc/shared/weakProcessor.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, 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
@ -30,7 +30,7 @@
#include "gc/shared/gcLocker.hpp"
#include "gc/shared/gcTimer.hpp"
#include "gc/shared/gcTrace.hpp"
#include "gc/shared/space.inline.hpp"
#include "gc/shared/space.hpp"
#include "gc/shared/spaceDecorator.inline.hpp"
#include "logging/log.hpp"
#include "memory/allocation.inline.hpp"

View File

@ -27,7 +27,7 @@
#include "gc/shared/collectorCounters.hpp"
#include "gc/shared/referenceProcessor.hpp"
#include "gc/shared/space.inline.hpp"
#include "gc/shared/space.hpp"
#include "logging/log.hpp"
#include "memory/allocation.hpp"
#include "memory/memRegion.hpp"

View File

@ -52,7 +52,7 @@
#include "gc/shared/preservedMarks.inline.hpp"
#include "gc/shared/referencePolicy.hpp"
#include "gc/shared/referenceProcessorPhaseTimes.hpp"
#include "gc/shared/space.inline.hpp"
#include "gc/shared/space.hpp"
#include "gc/shared/strongRootsScope.hpp"
#include "gc/shared/weakProcessor.hpp"
#include "memory/iterator.inline.hpp"

View File

@ -28,6 +28,7 @@
#include "gc/serial/serialHeap.hpp"
#include "gc/serial/tenuredGeneration.inline.hpp"
#include "oops/oop.inline.hpp"
class ScavengeHelper {
DefNewGeneration* _young_gen;

View File

@ -33,6 +33,7 @@
#include "gc/shared/gcTimer.hpp"
#include "gc/shared/gcTrace.hpp"
#include "gc/shared/space.hpp"
#include "gc/shared/spaceDecorator.hpp"
#include "logging/log.hpp"
#include "memory/allocation.inline.hpp"
#include "oops/oop.inline.hpp"
@ -316,7 +317,8 @@ TenuredGeneration::TenuredGeneration(ReservedSpace rs,
_used_at_prologue = 0;
HeapWord* bottom = (HeapWord*) _virtual_space.low();
HeapWord* end = (HeapWord*) _virtual_space.high();
_the_space = new TenuredSpace(_bts, MemRegion(bottom, end));
_the_space = new ContiguousSpace();
_the_space->initialize(MemRegion(bottom, end), SpaceDecorator::Clear, SpaceDecorator::Mangle);
// If we don't shrink the heap in steps, '_shrink_factor' is always 100%.
_shrink_factor = ShrinkHeapInSteps ? 0 : 100;
_capacity_at_prologue = 0;
@ -495,7 +497,6 @@ void TenuredGeneration::object_iterate(ObjectClosure* blk) {
void TenuredGeneration::complete_loaded_archive_space(MemRegion archive_space) {
// Create the BOT for the archive space.
TenuredSpace* space = _the_space;
HeapWord* start = archive_space.start();
while (start < archive_space.end()) {
size_t word_size = cast_to_oop(start)->size();;

View File

@ -65,7 +65,7 @@ class TenuredGeneration: public Generation {
void assert_correct_size_change_locking();
TenuredSpace* _the_space; // Actual space holding objects
ContiguousSpace* _the_space; // Actual space holding objects
HeapWord* _saved_mark_word;
GenerationCounters* _gen_counters;
@ -88,7 +88,7 @@ class TenuredGeneration: public Generation {
public:
void compute_new_size();
TenuredSpace* space() const { return _the_space; }
ContiguousSpace* space() const { return _the_space; }
HeapWord* saved_mark_word() const { return _saved_mark_word; }
// Grow generation with specified size (returns false if unable to grow)

View File

@ -27,7 +27,7 @@
#include "gc/serial/tenuredGeneration.hpp"
#include "gc/shared/space.inline.hpp"
#include "gc/shared/space.hpp"
inline size_t TenuredGeneration::capacity() const {
return space()->capacity();
@ -50,15 +50,23 @@ inline void TenuredGeneration::update_for_block(HeapWord* start, HeapWord* end)
}
HeapWord* TenuredGeneration::allocate(size_t word_size,
bool is_tlab) {
bool is_tlab) {
assert(!is_tlab, "TenuredGeneration does not support TLAB allocation");
return _the_space->allocate(word_size);
HeapWord* res = _the_space->allocate(word_size);
if (res != nullptr) {
_bts->update_for_block(res, res + word_size);
}
return res;
}
HeapWord* TenuredGeneration::par_allocate(size_t word_size,
bool is_tlab) {
bool is_tlab) {
assert(!is_tlab, "TenuredGeneration does not support TLAB allocation");
return _the_space->par_allocate(word_size);
HeapWord* res = _the_space->par_allocate(word_size);
if (res != nullptr) {
_bts->update_for_block(res, res + word_size);
}
return res;
}
#endif // SHARE_GC_SERIAL_TENUREDGENERATION_INLINE_HPP

View File

@ -47,7 +47,7 @@
nonstatic_field(TenuredGeneration, _capacity_at_prologue, size_t) \
nonstatic_field(TenuredGeneration, _used_at_prologue, size_t) \
nonstatic_field(TenuredGeneration, _min_heap_delta_bytes, size_t) \
nonstatic_field(TenuredGeneration, _the_space, TenuredSpace*) \
nonstatic_field(TenuredGeneration, _the_space, ContiguousSpace*) \
\
nonstatic_field(DefNewGeneration, _old_gen, TenuredGeneration*) \
nonstatic_field(DefNewGeneration, _tenuring_threshold, uint) \
@ -60,8 +60,6 @@
nonstatic_field(SerialBlockOffsetTable, _vs, VirtualSpace) \
nonstatic_field(SerialBlockOffsetTable, _offset_base, u_char*) \
\
nonstatic_field(TenuredSpace, _offsets, SerialBlockOffsetTable*) \
\
nonstatic_field(SerialHeap, _young_gen, DefNewGeneration*) \
nonstatic_field(SerialHeap, _old_gen, TenuredGeneration*) \
@ -72,7 +70,6 @@
declare_toplevel_type(Generation::StatRecord) \
declare_type(SerialHeap, CollectedHeap) \
declare_type(TenuredGeneration, Generation) \
declare_type(TenuredSpace, ContiguousSpace) \
\
declare_type(DefNewGeneration, Generation) \
declare_type(CardTableRS, CardTable) \

View File

@ -27,7 +27,7 @@
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shared/space.inline.hpp"
#include "gc/shared/space.hpp"
#include "logging/log.hpp"
#include "memory/virtualspace.hpp"
#include "nmt/memTracker.hpp"

View File

@ -28,7 +28,7 @@
#include "gc/shared/cardTableBarrierSet.inline.hpp"
#include "gc/shared/cardTableBarrierSetAssembler.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/space.inline.hpp"
#include "gc/shared/space.hpp"
#include "logging/log.hpp"
#include "memory/virtualspace.hpp"
#include "nmt/memTracker.hpp"

View File

@ -27,7 +27,6 @@
#include "classfile/vmSymbols.hpp"
#include "gc/shared/collectedHeap.inline.hpp"
#include "gc/shared/space.hpp"
#include "gc/shared/space.inline.hpp"
#include "gc/shared/spaceDecorator.inline.hpp"
#include "memory/iterator.inline.hpp"
#include "memory/universe.hpp"
@ -168,12 +167,3 @@ HeapWord* ContiguousSpace::allocate(size_t size) {
HeapWord* ContiguousSpace::par_allocate(size_t size) {
return par_allocate_impl(size);
}
#if INCLUDE_SERIALGC
TenuredSpace::TenuredSpace(SerialBlockOffsetTable* offsets,
MemRegion mr) :
_offsets(offsets)
{
initialize(mr, SpaceDecorator::Clear, SpaceDecorator::Mangle);
}
#endif // INCLUDE_SERIALGC

View File

@ -161,25 +161,4 @@ public:
void verify() const;
};
#if INCLUDE_SERIALGC
// Class TenuredSpace is used by TenuredGeneration; it supports an efficient
// "block_start" operation via a SerialBlockOffsetTable.
class TenuredSpace: public ContiguousSpace {
friend class VMStructs;
protected:
SerialBlockOffsetTable* _offsets;
public:
// Constructor
TenuredSpace(SerialBlockOffsetTable* offsets,
MemRegion mr);
// Add offset table update.
inline HeapWord* allocate(size_t word_size) override;
inline HeapWord* par_allocate(size_t word_size) override;
};
#endif //INCLUDE_SERIALGC
#endif // SHARE_GC_SHARED_SPACE_HPP

View File

@ -1,56 +0,0 @@
/*
* Copyright (c) 2000, 2024, 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_SPACE_INLINE_HPP
#define SHARE_GC_SHARED_SPACE_INLINE_HPP
#include "gc/shared/space.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/spaceDecorator.hpp"
#include "oops/oop.inline.hpp"
#include "oops/oopsHierarchy.hpp"
#include "runtime/prefetch.inline.hpp"
#include "runtime/safepoint.hpp"
#if INCLUDE_SERIALGC
inline HeapWord* TenuredSpace::allocate(size_t size) {
HeapWord* res = ContiguousSpace::allocate(size);
if (res != nullptr) {
_offsets->update_for_block(res, res + size);
}
return res;
}
inline HeapWord* TenuredSpace::par_allocate(size_t size) {
HeapWord* res = ContiguousSpace::par_allocate(size);
if (res != nullptr) {
_offsets->update_for_block(res, res + size);
}
return res;
}
#endif // INCLUDE_SERIALGC
#endif // SHARE_GC_SHARED_SPACE_INLINE_HPP

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2024, 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
@ -24,7 +24,7 @@
#include "precompiled.hpp"
#include "gc/parallel/mutableSpace.hpp"
#include "gc/shared/space.inline.hpp"
#include "gc/shared/space.hpp"
#include "gc/shared/spaceDecorator.inline.hpp"
#include "logging/log.hpp"
#include "utilities/copy.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2019, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -24,7 +24,7 @@
*/
#include "precompiled.hpp"
#include "gc/shared/space.inline.hpp"
#include "gc/shared/space.hpp"
#include "gc/shared/tlab_globals.hpp"
#include "gc/shenandoah/shenandoahHeapRegionSet.inline.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"

View File

@ -1,35 +0,0 @@
/*
* Copyright (c) 2000, 2015, 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.
*
*/
package sun.jvm.hotspot.gc.shared;
import sun.jvm.hotspot.debugger.*;
/** No additional functionality for now */
public class TenuredSpace extends ContiguousSpace {
public TenuredSpace(Address addr) {
super(addr);
}
}

View File

@ -56,7 +56,7 @@ public class ClhsdbField {
"field InstanceKlass _constants ConstantPool*",
"field Klass _name Symbol*",
"field JavaThread _osthread OSThread*",
"field TenuredGeneration _the_space TenuredSpace*",
"field TenuredGeneration _the_space ContiguousSpace*",
"field VirtualSpace _low_boundary char*",
"field MethodCounters _backedge_counter InvocationCounter",
"field nmethod _entry_bci int",