From dd0b6418191c765a92bfd03ec4d4206e0da7ee45 Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Thu, 2 May 2024 13:48:36 +0000 Subject: [PATCH] 8330813: Don't call methods from Compressed(Oops|Klass) if the associated mode is inactive Reviewed-by: stefank, asmehra --- .../share/jvmci/jvmciCompilerToVMInit.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp index 8822aed0cbe00..a2ba0f2b3e578 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp @@ -175,10 +175,20 @@ void CompilerToVM::Data::initialize(JVMCI_TRAPS) { Universe_collectedHeap = Universe::heap(); Universe_base_vtable_size = Universe::base_vtable_size(); - Universe_narrow_oop_base = CompressedOops::base(); - Universe_narrow_oop_shift = CompressedOops::shift(); - Universe_narrow_klass_base = CompressedKlassPointers::base(); - Universe_narrow_klass_shift = CompressedKlassPointers::shift(); + if (UseCompressedOops) { + Universe_narrow_oop_base = CompressedOops::base(); + Universe_narrow_oop_shift = CompressedOops::shift(); + } else { + Universe_narrow_oop_base = nullptr; + Universe_narrow_oop_shift = 0; + } + if (UseCompressedClassPointers) { + Universe_narrow_klass_base = CompressedKlassPointers::base(); + Universe_narrow_klass_shift = CompressedKlassPointers::shift(); + } else { + Universe_narrow_klass_base = nullptr; + Universe_narrow_klass_shift = 0; + } Universe_non_oop_bits = Universe::non_oop_word(); Universe_verify_oop_mask = Universe::verify_oop_mask(); Universe_verify_oop_bits = Universe::verify_oop_bits();