From 711cddd899048236bbc3c0aa7e4ac0fc8aebe4d2 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 4 Jul 2023 09:01:47 +0000 Subject: [PATCH] 8311249: Remove unused MemAllocator::obj_memory_range Reviewed-by: tschatzl --- src/hotspot/share/gc/shared/memAllocator.cpp | 9 --------- src/hotspot/share/gc/shared/memAllocator.hpp | 6 ------ 2 files changed, 15 deletions(-) diff --git a/src/hotspot/share/gc/shared/memAllocator.cpp b/src/hotspot/share/gc/shared/memAllocator.cpp index e5189abed57..ed54128d34a 100644 --- a/src/hotspot/share/gc/shared/memAllocator.cpp +++ b/src/hotspot/share/gc/shared/memAllocator.cpp @@ -400,15 +400,6 @@ oop ObjAllocator::initialize(HeapWord* mem) const { return finish(mem); } -MemRegion ObjArrayAllocator::obj_memory_range(oop obj) const { - if (_do_zero) { - return MemAllocator::obj_memory_range(obj); - } - ArrayKlass* array_klass = ArrayKlass::cast(_klass); - const size_t hs = arrayOopDesc::header_size(array_klass->element_type()); - return MemRegion(cast_from_oop(obj) + hs, _word_size - hs); -} - oop ObjArrayAllocator::initialize(HeapWord* mem) const { // Set array length before setting the _klass field because a // non-null klass field indicates that the object is parsable by diff --git a/src/hotspot/share/gc/shared/memAllocator.hpp b/src/hotspot/share/gc/shared/memAllocator.hpp index e42399cdffd..48faded1337 100644 --- a/src/hotspot/share/gc/shared/memAllocator.hpp +++ b/src/hotspot/share/gc/shared/memAllocator.hpp @@ -78,10 +78,6 @@ protected: // back to calling CollectedHeap::mem_allocate(). HeapWord* mem_allocate(Allocation& allocation) const; - virtual MemRegion obj_memory_range(oop obj) const { - return MemRegion(cast_from_oop(obj), _word_size); - } - public: // Allocate and fully construct the object, and perform various instrumentation. Could safepoint. oop allocate() const; @@ -100,8 +96,6 @@ protected: const int _length; const bool _do_zero; - virtual MemRegion obj_memory_range(oop obj) const; - public: ObjArrayAllocator(Klass* klass, size_t word_size, int length, bool do_zero, Thread* thread = Thread::current())