Mercurial > hg > graal-compiler
comparison agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java @ 2411:63997f575155
7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
Reviewed-by: kvn, dcubed
author | never |
---|---|
date | Wed, 30 Mar 2011 07:47:19 -0700 |
parents | c7f3d0b4570f |
children | f6f3bb0ee072 |
comparison
equal
deleted
inserted
replaced
2410:fe1dbd98e18f | 2411:63997f575155 |
---|---|
72 private static int THREAD_STATUS_PARKED_TIMED; | 72 private static int THREAD_STATUS_PARKED_TIMED; |
73 private static int THREAD_STATUS_BLOCKED_ON_MONITOR_ENTER; | 73 private static int THREAD_STATUS_BLOCKED_ON_MONITOR_ENTER; |
74 private static int THREAD_STATUS_TERMINATED; | 74 private static int THREAD_STATUS_TERMINATED; |
75 */ | 75 */ |
76 | 76 |
77 // java.lang.Class fields | |
78 private static OopField hcKlassField; | |
79 | |
80 // java.util.concurrent.locks.AbstractOwnableSynchronizer fields | 77 // java.util.concurrent.locks.AbstractOwnableSynchronizer fields |
81 private static OopField absOwnSyncOwnerThreadField; | 78 private static OopField absOwnSyncOwnerThreadField; |
82 | 79 |
83 static { | 80 static { |
84 VM.registerVMInitializedObserver(new Observer() { | 81 VM.registerVMInitializedObserver(new Observer() { |
266 return threadParkBlockerField.getValue(threadOop); | 263 return threadParkBlockerField.getValue(threadOop); |
267 } | 264 } |
268 return null; | 265 return null; |
269 } | 266 } |
270 | 267 |
271 // initialize fields for java.lang.Class | |
272 private static void initClassFields() { | |
273 if (hcKlassField == null) { | |
274 // hc_klass is a HotSpot magic field and hence we can't | |
275 // find it from InstanceKlass for java.lang.Class. | |
276 TypeDataBase db = VM.getVM().getTypeDataBase(); | |
277 int hcKlassOffset = (int) db.lookupType("java_lang_Class").getCIntegerField("klass_offset").getValue(); | |
278 if (VM.getVM().isCompressedOopsEnabled()) { | |
279 hcKlassField = new NarrowOopField(new NamedFieldIdentifier("hc_klass"), hcKlassOffset, true); | |
280 } else { | |
281 hcKlassField = new OopField(new NamedFieldIdentifier("hc_klass"), hcKlassOffset, true); | |
282 } | |
283 } | |
284 } | |
285 | |
286 /** get klassOop field at offset hc_klass_offset from a java.lang.Class object */ | |
287 public static Klass classOopToKlass(Oop aClass) { | |
288 initClassFields(); | |
289 return (Klass) hcKlassField.getValue(aClass); | |
290 } | |
291 | |
292 // initialize fields for j.u.c.l AbstractOwnableSynchornizer class | 268 // initialize fields for j.u.c.l AbstractOwnableSynchornizer class |
293 private static void initAbsOwnSyncFields() { | 269 private static void initAbsOwnSyncFields() { |
294 if (absOwnSyncOwnerThreadField == null) { | 270 if (absOwnSyncOwnerThreadField == null) { |
295 SystemDictionary sysDict = VM.getVM().getSystemDictionary(); | 271 SystemDictionary sysDict = VM.getVM().getSystemDictionary(); |
296 InstanceKlass k = sysDict.getAbstractOwnableSynchronizerKlass(); | 272 InstanceKlass k = sysDict.getAbstractOwnableSynchronizerKlass(); |