8325551: Remove unused obj_is_alive and block_start in Space

Reviewed-by: stefank
This commit is contained in:
Albert Mingkun Yang 2024-02-09 15:01:12 +00:00
parent 8ef918d667
commit 29d89d48cb
3 changed files with 0 additions and 25 deletions
src/hotspot/share/gc/shared

@ -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()) {

@ -141,25 +141,11 @@ class Space: public CHeapObj<mtGC> {
// 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; }

@ -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);