From 29d89d48cb32a225f94b2ed45d2a1467add33b68 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Fri, 9 Feb 2024 15:01:12 +0000 Subject: [PATCH] 8325551: Remove unused obj_is_alive and block_start in Space Reviewed-by: stefank --- src/hotspot/share/gc/shared/space.cpp | 5 ----- src/hotspot/share/gc/shared/space.hpp | 16 ---------------- src/hotspot/share/gc/shared/space.inline.hpp | 4 ---- 3 files changed, 25 deletions(-) diff --git a/src/hotspot/share/gc/shared/space.cpp b/src/hotspot/share/gc/shared/space.cpp index d99784cf029..069b672b544 100644 --- a/src/hotspot/share/gc/shared/space.cpp +++ b/src/hotspot/share/gc/shared/space.cpp @@ -140,11 +140,6 @@ void ContiguousSpace::verify() const { guarantee(p == top(), "end of last object must match end of space"); } -bool Space::obj_is_alive(const HeapWord* p) const { - assert (block_is_obj(p), "The address should point to an object"); - return true; -} - void ContiguousSpace::object_iterate(ObjectClosure* blk) { HeapWord* addr = bottom(); while (addr < top()) { diff --git a/src/hotspot/share/gc/shared/space.hpp b/src/hotspot/share/gc/shared/space.hpp index 4621c28e8a9..2d592bf726b 100644 --- a/src/hotspot/share/gc/shared/space.hpp +++ b/src/hotspot/share/gc/shared/space.hpp @@ -141,25 +141,11 @@ class Space: public CHeapObj { // object or a non-object. If "p" is not in the space, return null. virtual HeapWord* block_start_const(const void* p) const = 0; - // The non-const version may have benevolent side effects on the data - // structure supporting these calls, possibly speeding up future calls. - // The default implementation, however, is simply to call the const - // version. - HeapWord* block_start(const void* p); - // Requires "addr" to be the start of a chunk, and returns its size. // "addr + size" is required to be the start of a new chunk, or the end // of the active area of the heap. virtual size_t block_size(const HeapWord* addr) const = 0; - // Requires "addr" to be the start of a block, and returns "TRUE" iff - // the block is an object. - virtual bool block_is_obj(const HeapWord* addr) const = 0; - - // Requires "addr" to be the start of a block, and returns "TRUE" iff - // the block is an object and the object is alive. - bool obj_is_alive(const HeapWord* addr) const; - // Allocation (return null if full). Assumes the caller has established // mutually exclusive access to the space. virtual HeapWord* allocate(size_t word_size) = 0; @@ -281,8 +267,6 @@ protected: // Very inefficient implementation. HeapWord* block_start_const(const void* p) const override; size_t block_size(const HeapWord* p) const override; - // If a block is in the allocated area, it is an object. - bool block_is_obj(const HeapWord* p) const override { return p < top(); } // Addresses for inlined allocation HeapWord** top_addr() { return &_top; } diff --git a/src/hotspot/share/gc/shared/space.inline.hpp b/src/hotspot/share/gc/shared/space.inline.hpp index 924a8630f72..e34f833775a 100644 --- a/src/hotspot/share/gc/shared/space.inline.hpp +++ b/src/hotspot/share/gc/shared/space.inline.hpp @@ -34,10 +34,6 @@ #include "runtime/prefetch.inline.hpp" #include "runtime/safepoint.hpp" -inline HeapWord* Space::block_start(const void* p) { - return block_start_const(p); -} - #if INCLUDE_SERIALGC inline HeapWord* TenuredSpace::allocate(size_t size) { HeapWord* res = ContiguousSpace::allocate(size);