Skip to content

Commit 63b1f4c

Browse files
committed
wip
1 parent b186aa3 commit 63b1f4c

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,6 @@ void ShenandoahAsserts::assert_generations_reconciled(const char* file, int line
549549
report_vm_error(file, line, msg.buffer());
550550
}
551551

552-
// Given a possibly invalid oop, extract narrowKlass (if UCCP) and Klass* from it safely, with checks.
553552
bool ShenandoahAsserts::extract_klass_safely(oop obj, narrowKlass& nk, const Klass*& k) {
554553
nk = 0;
555554
k = nullptr;

src/hotspot/share/gc/shenandoah/shenandoahAsserts.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,6 @@ class ShenandoahAsserts {
8080

8181
// Given a possibly invalid oop, extract narrowKlass (if UCCP) and Klass*
8282
// from it safely.
83-
// Returns:
84-
// - false, nk=0 && k=0 if oop is unreadable or (+COH) is forwarded and forwardee is unreadable
85-
// or oop's narrowKlass was 0
86-
// - false, nk>0 && k=0 if narrowKlass is garbage
87-
// - true, nk>0 && k!=0 if Klass* was successfully extracted. No further validity checks are done on the Klass*.
8883
// Note: For -UCCP, returned nk is always 0.
8984
static bool extract_klass_safely(oop obj, narrowKlass& nk, const Klass*& k);
9085

test/hotspot/gtest/oops/test_compressedKlass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,7 @@ TEST_VM(CompressedKlass, test_is_valid_narrow_klass) {
116116
ASSERT_FALSE(CompressedKlassPointers::is_valid_narrow_klass_id(0));
117117
narrowKlass nk_jlC = CompressedKlassPointers::encode((Klass*)vmClasses::Class_klass());
118118
ASSERT_TRUE(CompressedKlassPointers::is_valid_narrow_klass_id(nk_jlC));
119+
if (CompressedClassSpaceSize < 4 * G && CompressedKlassPointers::base() != nullptr) {
120+
ASSERT_FALSE(CompressedKlassPointers::is_valid_narrow_klass_id(0xFFFFFFFF));
121+
}
119122
}

0 commit comments

Comments
 (0)