From cd9719bc1d5266faa6c3a0009fb5881a2016e7e1 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Wed, 8 Nov 2023 11:55:47 +0000 Subject: [PATCH] 8319306: Serial: Remove TenuredSpace::verify Reviewed-by: iwalulya, tschatzl --- src/hotspot/share/gc/shared/space.cpp | 41 --------------------------- src/hotspot/share/gc/shared/space.hpp | 8 +----- 2 files changed, 1 insertion(+), 48 deletions(-) diff --git a/src/hotspot/share/gc/shared/space.cpp b/src/hotspot/share/gc/shared/space.cpp index 0745141e950..1c2afaa8b70 100644 --- a/src/hotspot/share/gc/shared/space.cpp +++ b/src/hotspot/share/gc/shared/space.cpp @@ -371,18 +371,11 @@ void TenuredSpace::print_on(outputStream* st) const { void ContiguousSpace::verify() const { HeapWord* p = bottom(); HeapWord* t = top(); - HeapWord* prev_p = nullptr; while (p < t) { oopDesc::verify(cast_to_oop(p)); - prev_p = p; p += cast_to_oop(p)->size(); } guarantee(p == top(), "end of last object must match end of space"); - if (top() != end()) { - guarantee(top() == block_start_const(end()-1) && - top() == block_start_const(top()), - "top should be start of unallocated block, if it exists"); - } } bool Space::obj_is_alive(const HeapWord* p) const { @@ -515,40 +508,6 @@ TenuredSpace::TenuredSpace(SerialBlockOffsetSharedArray* sharedOffsetArray, initialize(mr, SpaceDecorator::Clear, SpaceDecorator::Mangle); } -#define OBJ_SAMPLE_INTERVAL 0 -#define BLOCK_SAMPLE_INTERVAL 100 - -void TenuredSpace::verify() const { - HeapWord* p = bottom(); - HeapWord* prev_p = nullptr; - int objs = 0; - int blocks = 0; - - while (p < top()) { - size_t size = cast_to_oop(p)->size(); - // For a sampling of objects in the space, find it using the - // block offset table. - if (blocks == BLOCK_SAMPLE_INTERVAL) { - guarantee(p == block_start_const(p + (size/2)), - "check offset computation"); - blocks = 0; - } else { - blocks++; - } - - if (objs == OBJ_SAMPLE_INTERVAL) { - oopDesc::verify(cast_to_oop(p)); - objs = 0; - } else { - objs++; - } - prev_p = p; - p += size; - } - guarantee(p == top(), "end of last object must match end of space"); -} - - size_t TenuredSpace::allowed_dead_ratio() const { return MarkSweepDeadRatio; } diff --git a/src/hotspot/share/gc/shared/space.hpp b/src/hotspot/share/gc/shared/space.hpp index f609c7bad43..5d559f74f5e 100644 --- a/src/hotspot/share/gc/shared/space.hpp +++ b/src/hotspot/share/gc/shared/space.hpp @@ -194,9 +194,6 @@ class Space: public CHeapObj { virtual void print_on(outputStream* st) const; void print_short() const; void print_short_on(outputStream* st) const; - - // Debugging - virtual void verify() const = 0; }; // A structure to represent a point at which objects are being copied @@ -396,7 +393,7 @@ private: void print_on(outputStream* st) const override; // Debugging - void verify() const override; + void verify() const; }; #if INCLUDE_SERIALGC @@ -426,9 +423,6 @@ class TenuredSpace: public ContiguousSpace { void update_for_block(HeapWord* start, HeapWord* end) override; void print_on(outputStream* st) const override; - - // Debugging - void verify() const override; }; #endif //INCLUDE_SERIALGC