diff --git a/src/hotspot/share/gc/shared/space.cpp b/src/hotspot/share/gc/shared/space.cpp index 82e32a17b43..31ff8a447c7 100644 --- a/src/hotspot/share/gc/shared/space.cpp +++ b/src/hotspot/share/gc/shared/space.cpp @@ -168,26 +168,6 @@ HeapWord* ContiguousSpace::block_start_const(const void* p) const { } } -size_t ContiguousSpace::block_size(const HeapWord* p) const { - assert(MemRegion(bottom(), end()).contains(p), - "p (" PTR_FORMAT ") not in space [" PTR_FORMAT ", " PTR_FORMAT ")", - p2i(p), p2i(bottom()), p2i(end())); - HeapWord* current_top = top(); - assert(p <= current_top, - "p > current top - p: " PTR_FORMAT ", current top: " PTR_FORMAT, - p2i(p), p2i(current_top)); - assert(p == current_top || oopDesc::is_oop(cast_to_oop(p)), - "p (" PTR_FORMAT ") is not a block start - " - "current_top: " PTR_FORMAT ", is_oop: %s", - p2i(p), p2i(current_top), BOOL_TO_STR(oopDesc::is_oop(cast_to_oop(p)))); - if (p < current_top) { - return cast_to_oop(p)->size(); - } else { - assert(p == current_top, "just checking"); - return pointer_delta(end(), (HeapWord*) p); - } -} - // This version requires locking. inline HeapWord* ContiguousSpace::allocate_impl(size_t size) { assert(Heap_lock->owned_by_self() || diff --git a/src/hotspot/share/gc/shared/space.hpp b/src/hotspot/share/gc/shared/space.hpp index 41c1d2a0d75..c60952d7b38 100644 --- a/src/hotspot/share/gc/shared/space.hpp +++ b/src/hotspot/share/gc/shared/space.hpp @@ -133,11 +133,6 @@ 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; - // 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; - // Allocation (return null if full). Assumes the caller has established // mutually exclusive access to the space. virtual HeapWord* allocate(size_t word_size) = 0; @@ -258,7 +253,6 @@ protected: // Very inefficient implementation. HeapWord* block_start_const(const void* p) const override; - size_t block_size(const HeapWord* p) const override; // Addresses for inlined allocation HeapWord** top_addr() { return &_top; }