Mercurial > hg > truffle
comparison agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java @ 180:b9ebd46331d2
6710654: SAJDI failures with Compressed Oops
Summary: Use correct offset for the java.lang.Class _klass field in SA.
Reviewed-by: jrose, never
author | kvn |
---|---|
date | Wed, 04 Jun 2008 14:03:48 -0700 |
parents | ba764ed4b6f2 |
children | d1605aabd0a1 |
comparison
equal
deleted
inserted
replaced
174:510f98a80563 | 180:b9ebd46331d2 |
---|---|
272 private static void initClassFields() { | 272 private static void initClassFields() { |
273 if (hcKlassField == null) { | 273 if (hcKlassField == null) { |
274 // hc_klass is a HotSpot magic field and hence we can't | 274 // hc_klass is a HotSpot magic field and hence we can't |
275 // find it from InstanceKlass for java.lang.Class. | 275 // find it from InstanceKlass for java.lang.Class. |
276 TypeDataBase db = VM.getVM().getTypeDataBase(); | 276 TypeDataBase db = VM.getVM().getTypeDataBase(); |
277 int hcKlassOffset = (int) Oop.getHeaderSize(); | 277 int hcKlassOffset = (int) Instance.getHeaderSize(); |
278 try { | 278 try { |
279 hcKlassOffset += (db.lookupIntConstant("java_lang_Class::hc_klass_offset").intValue() * | 279 hcKlassOffset += (db.lookupIntConstant("java_lang_Class::hc_klass_offset").intValue() * |
280 db.getAddressSize()); | 280 VM.getVM().getHeapOopSize()); |
281 } catch (RuntimeException re) { | 281 } catch (RuntimeException re) { |
282 // ignore, currently java_lang_Class::hc_klass_offset is zero | 282 // ignore, currently java_lang_Class::hc_klass_offset is zero |
283 } | 283 } |
284 if (VM.getVM().isCompressedOopsEnabled()) { | 284 if (VM.getVM().isCompressedOopsEnabled()) { |
285 hcKlassField = new NarrowOopField(new NamedFieldIdentifier("hc_klass"), hcKlassOffset, true); | 285 hcKlassField = new NarrowOopField(new NamedFieldIdentifier("hc_klass"), hcKlassOffset, true); |