diff --git a/src/hotspot/share/gc/serial/vmStructs_serial.hpp b/src/hotspot/share/gc/serial/vmStructs_serial.hpp index 30bd21d40a48e..2fb7404f3e862 100644 --- a/src/hotspot/share/gc/serial/vmStructs_serial.hpp +++ b/src/hotspot/share/gc/serial/vmStructs_serial.hpp @@ -59,15 +59,14 @@ nonstatic_field(BlockOffsetArrayContigSpace, _next_offset_threshold, HeapWord*) \ nonstatic_field(BlockOffsetArrayContigSpace, _next_offset_index, size_t) \ \ - nonstatic_field(OffsetTableContigSpace, _offsets, BlockOffsetArray) + nonstatic_field(TenuredSpace, _offsets, BlockOffsetArray) #define VM_TYPES_SERIALGC(declare_type, \ declare_toplevel_type, \ declare_integer_type) \ declare_type(SerialHeap, GenCollectedHeap) \ declare_type(TenuredGeneration, Generation) \ - declare_type(TenuredSpace, OffsetTableContigSpace) \ - declare_type(OffsetTableContigSpace, ContiguousSpace) \ + declare_type(TenuredSpace, ContiguousSpace) \ \ declare_type(DefNewGeneration, Generation) \ \ @@ -76,8 +75,7 @@ declare_toplevel_type(BlockOffsetTable) \ declare_type(BlockOffsetArray, BlockOffsetTable) \ declare_type(BlockOffsetArrayContigSpace, BlockOffsetArray) \ - declare_toplevel_type(BlockOffsetSharedArray*) \ - declare_toplevel_type(OffsetTableContigSpace*) + declare_toplevel_type(BlockOffsetSharedArray*) #define VM_INT_CONSTANTS_SERIALGC(declare_constant, \ declare_constant_with_value) diff --git a/src/hotspot/share/gc/shared/space.cpp b/src/hotspot/share/gc/shared/space.cpp index 84925eb499dd9..cbd9c873d69c5 100644 --- a/src/hotspot/share/gc/shared/space.cpp +++ b/src/hotspot/share/gc/shared/space.cpp @@ -290,17 +290,17 @@ bool ContiguousSpace::is_free_block(const HeapWord* p) const { } #if INCLUDE_SERIALGC -void OffsetTableContigSpace::clear(bool mangle_space) { +void TenuredSpace::clear(bool mangle_space) { ContiguousSpace::clear(mangle_space); _offsets.initialize_threshold(); } -void OffsetTableContigSpace::set_bottom(HeapWord* new_bottom) { +void TenuredSpace::set_bottom(HeapWord* new_bottom) { Space::set_bottom(new_bottom); _offsets.set_bottom(new_bottom); } -void OffsetTableContigSpace::set_end(HeapWord* new_end) { +void TenuredSpace::set_end(HeapWord* new_end) { // Space should not advertise an increase in size // until after the underlying offset table has been enlarged. _offsets.resize(pointer_delta(new_end, bottom())); @@ -596,7 +596,7 @@ void ContiguousSpace::print_on(outputStream* st) const { } #if INCLUDE_SERIALGC -void OffsetTableContigSpace::print_on(outputStream* st) const { +void TenuredSpace::print_on(outputStream* st) const { print_short_on(st); st->print_cr(" [" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT ")", @@ -739,18 +739,18 @@ HeapWord* ContiguousSpace::par_allocate(size_t size) { } #if INCLUDE_SERIALGC -void OffsetTableContigSpace::initialize_threshold() { +void TenuredSpace::initialize_threshold() { _offsets.initialize_threshold(); } -void OffsetTableContigSpace::alloc_block(HeapWord* start, HeapWord* end) { +void TenuredSpace::alloc_block(HeapWord* start, HeapWord* end) { _offsets.alloc_block(start, end); } -OffsetTableContigSpace::OffsetTableContigSpace(BlockOffsetSharedArray* sharedOffsetArray, - MemRegion mr) : +TenuredSpace::TenuredSpace(BlockOffsetSharedArray* sharedOffsetArray, + MemRegion mr) : _offsets(sharedOffsetArray, mr), - _par_alloc_lock(Mutex::safepoint, "OffsetTableContigSpaceParAlloc_lock", true) + _par_alloc_lock(Mutex::safepoint, "TenuredSpaceParAlloc_lock", true) { _offsets.set_contig_space(this); initialize(mr, SpaceDecorator::Clear, SpaceDecorator::Mangle); @@ -759,7 +759,7 @@ OffsetTableContigSpace::OffsetTableContigSpace(BlockOffsetSharedArray* sharedOff #define OBJ_SAMPLE_INTERVAL 0 #define BLOCK_SAMPLE_INTERVAL 100 -void OffsetTableContigSpace::verify() const { +void TenuredSpace::verify() const { HeapWord* p = bottom(); HeapWord* prev_p = NULL; int objs = 0; diff --git a/src/hotspot/share/gc/shared/space.hpp b/src/hotspot/share/gc/shared/space.hpp index 211dc51125c09..f8bfe0c029eb0 100644 --- a/src/hotspot/share/gc/shared/space.hpp +++ b/src/hotspot/share/gc/shared/space.hpp @@ -559,22 +559,25 @@ class ContiguousSpaceDCTOC : public DirtyCardToOopClosure { {} }; -// A ContigSpace that Supports an efficient "block_start" operation via -// a BlockOffsetArray (whose BlockOffsetSharedArray may be shared with -// other spaces.) This is the abstract base class for old generation -// (tenured) spaces. #if INCLUDE_SERIALGC -class OffsetTableContigSpace: public ContiguousSpace { + +// Class TenuredSpace is used by TenuredGeneration; it supports an efficient +// "block_start" operation via a BlockOffsetArray (whose BlockOffsetSharedArray +// may be shared with other spaces.) + +class TenuredSpace: public ContiguousSpace { friend class VMStructs; protected: BlockOffsetArrayContigSpace _offsets; Mutex _par_alloc_lock; + // Mark sweep support + size_t allowed_dead_ratio() const override; public: // Constructor - OffsetTableContigSpace(BlockOffsetSharedArray* sharedOffsetArray, - MemRegion mr); + TenuredSpace(BlockOffsetSharedArray* sharedOffsetArray, + MemRegion mr); void set_bottom(HeapWord* value) override; void set_end(HeapWord* value) override; @@ -596,21 +599,6 @@ class OffsetTableContigSpace: public ContiguousSpace { // Debugging void verify() const override; }; - - -// Class TenuredSpace is used by TenuredGeneration - -class TenuredSpace: public OffsetTableContigSpace { - friend class VMStructs; - protected: - // Mark sweep support - size_t allowed_dead_ratio() const override; - public: - // Constructor - TenuredSpace(BlockOffsetSharedArray* sharedOffsetArray, - MemRegion mr) : - OffsetTableContigSpace(sharedOffsetArray, mr) {} -}; #endif //INCLUDE_SERIALGC #endif // SHARE_GC_SHARED_SPACE_HPP diff --git a/src/hotspot/share/gc/shared/space.inline.hpp b/src/hotspot/share/gc/shared/space.inline.hpp index 963b9a2d9cb6c..a2b3b67ed5752 100644 --- a/src/hotspot/share/gc/shared/space.inline.hpp +++ b/src/hotspot/share/gc/shared/space.inline.hpp @@ -44,7 +44,7 @@ inline HeapWord* Space::block_start(const void* p) { } #if INCLUDE_SERIALGC -inline HeapWord* OffsetTableContigSpace::allocate(size_t size) { +inline HeapWord* TenuredSpace::allocate(size_t size) { HeapWord* res = ContiguousSpace::allocate(size); if (res != NULL) { _offsets.alloc_block(res, size); @@ -55,7 +55,7 @@ inline HeapWord* OffsetTableContigSpace::allocate(size_t size) { // Because of the requirement of keeping "_offsets" up to date with the // allocations, we sequentialize these with a lock. Therefore, best if // this is used for larger LAB allocations only. -inline HeapWord* OffsetTableContigSpace::par_allocate(size_t size) { +inline HeapWord* TenuredSpace::par_allocate(size_t size) { MutexLocker x(&_par_alloc_lock); // This ought to be just "allocate", because of the lock above, but that // ContiguousSpace::allocate asserts that either the allocating thread @@ -73,7 +73,7 @@ inline HeapWord* OffsetTableContigSpace::par_allocate(size_t size) { } inline HeapWord* -OffsetTableContigSpace::block_start_const(const void* p) const { +TenuredSpace::block_start_const(const void* p) const { return _offsets.block_start(p); } @@ -156,7 +156,7 @@ inline void CompactibleSpace::clear_empty_region(SpaceType* space) { // Reset space after compaction is complete space->reset_after_compaction(); // We do this clear, below, since it has overloaded meanings for some - // space subtypes. For example, OffsetTableContigSpace's that were + // space subtypes. For example, TenuredSpace's that were // compacted into will have had their offset table thresholds updated // continuously, but those that weren't need to have their thresholds // re-initialized. Also mangles unused area for debugging. diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/OffsetTableContigSpace.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/OffsetTableContigSpace.java deleted file mode 100644 index 305642382873f..0000000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/OffsetTableContigSpace.java +++ /dev/null @@ -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 OffsetTableContigSpace extends ContiguousSpace { - public OffsetTableContigSpace(Address addr) { - super(addr); - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/TenuredSpace.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/TenuredSpace.java index 7a5b46ddff6c9..02d855822dab9 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/TenuredSpace.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/TenuredSpace.java @@ -28,7 +28,7 @@ /** No additional functionality for now */ -public class TenuredSpace extends OffsetTableContigSpace { +public class TenuredSpace extends ContiguousSpace { public TenuredSpace(Address addr) { super(addr); }