From 7834662ca35aeb202d177fde1044add611240ecd Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Tue, 17 Sep 2024 08:11:22 +0000 Subject: [PATCH] 8340119: Remove oopDesc::size_might_change() Reviewed-by: stefank, iwalulya --- src/hotspot/share/oops/oop.cpp | 11 ----------- src/hotspot/share/oops/oop.hpp | 2 -- src/hotspot/share/oops/oop.inline.hpp | 2 +- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/hotspot/share/oops/oop.cpp b/src/hotspot/share/oops/oop.cpp index fde91969ea5..38dee491a10 100644 --- a/src/hotspot/share/oops/oop.cpp +++ b/src/hotspot/share/oops/oop.cpp @@ -218,14 +218,3 @@ void oopDesc::release_float_field_put(int offset, jfloat value) { Atomic:: jdouble oopDesc::double_field_acquire(int offset) const { return Atomic::load_acquire(field_addr(offset)); } void oopDesc::release_double_field_put(int offset, jdouble value) { Atomic::release_store(field_addr(offset), value); } - -#ifdef ASSERT -bool oopDesc::size_might_change() { - // UseParallelGC and UseG1GC can change the length field - // of an "old copy" of an object array in the young gen so it indicates - // the grey portion of an already copied array. This will cause the first - // disjunct below to fail if the two comparands are computed across such - // a concurrent change. - return Universe::heap()->is_stw_gc_active() && is_objArray() && is_forwarded() && (UseParallelGC || UseG1GC); -} -#endif diff --git a/src/hotspot/share/oops/oop.hpp b/src/hotspot/share/oops/oop.hpp index 2d827699b41..a330b3df529 100644 --- a/src/hotspot/share/oops/oop.hpp +++ b/src/hotspot/share/oops/oop.hpp @@ -319,8 +319,6 @@ class oopDesc { // for error reporting static void* load_oop_raw(oop obj, int offset); - - DEBUG_ONLY(bool size_might_change();) }; // An oopDesc is not initialized via a constructor. Space is allocated in diff --git a/src/hotspot/share/oops/oop.inline.hpp b/src/hotspot/share/oops/oop.inline.hpp index ffcc9af24c3..95b99b215fa 100644 --- a/src/hotspot/share/oops/oop.inline.hpp +++ b/src/hotspot/share/oops/oop.inline.hpp @@ -190,7 +190,7 @@ size_t oopDesc::size_given_klass(Klass* klass) { // skipping the intermediate round to HeapWordSize. s = align_up(size_in_bytes, MinObjAlignmentInBytes) / HeapWordSize; - assert(s == klass->oop_size(this) || size_might_change(), "wrong array object size"); + assert(s == klass->oop_size(this), "wrong array object size"); } else { // Must be zero, so bite the bullet and take the virtual call. s = klass->oop_size(this);