From a86ee2a02c507dd149f330e2bb07ba7e4226d709 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 21 Aug 2024 16:10:41 +0000 Subject: [PATCH] Backport e297e8817f486e4af850c97fcff859c3e9a9e21c --- src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp | 2 +- src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp b/src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp index 1edfff0ec4c..4a06d6a487b 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp @@ -257,7 +257,7 @@ void ShenandoahAsserts::assert_correct(void* interior_loc, oop obj, const char* // Do additional checks for special objects: their fields can hold metadata as well. // We want to check class loading/unloading did not corrupt them. - if (java_lang_Class::is_instance(obj)) { + if (obj_klass == vmClasses::Class_klass()) { Metadata* klass = obj->metadata_field(java_lang_Class::klass_offset()); if (klass != nullptr && !Metaspace::contains(klass)) { print_failure(_safe_all, obj, interior_loc, nullptr, "Shenandoah assert_correct failed", diff --git a/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp b/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp index 1fa470013cf..62a81e640bb 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp @@ -239,7 +239,7 @@ class ShenandoahVerifyOopClosure : public BasicOopIterateClosure { // Do additional checks for special objects: their fields can hold metadata as well. // We want to check class loading/unloading did not corrupt them. - if (java_lang_Class::is_instance(obj)) { + if (obj_klass == vmClasses::Class_klass()) { Metadata* klass = obj->metadata_field(java_lang_Class::klass_offset()); check(ShenandoahAsserts::_safe_oop, obj, klass == nullptr || Metaspace::contains(klass),