From f71a0237c32071fda391cf4e9b0041d4886bde72 Mon Sep 17 00:00:00 2001 From: kvn Date: Wed, 4 Jun 2008 14:03:48 -0700 Subject: [PATCH] 6710654: SAJDI failures with Compressed Oops Summary: Use correct offset for the java.lang.Class _klass field in SA. Reviewed-by: jrose, never --- .../src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java b/agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java index 1613da85b..cbb432af5 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java +++ b/agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java @@ -274,10 +274,10 @@ public class OopUtilities implements /* imports */ JVMTIThreadState { // hc_klass is a HotSpot magic field and hence we can't // find it from InstanceKlass for java.lang.Class. TypeDataBase db = VM.getVM().getTypeDataBase(); - int hcKlassOffset = (int) Oop.getHeaderSize(); + int hcKlassOffset = (int) Instance.getHeaderSize(); try { hcKlassOffset += (db.lookupIntConstant("java_lang_Class::hc_klass_offset").intValue() * - db.getAddressSize()); + VM.getVM().getHeapOopSize()); } catch (RuntimeException re) { // ignore, currently java_lang_Class::hc_klass_offset is zero } -- GitLab