comparison agent/src/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java @ 3938:e6b1331a51d2

7086585: make Java field injection more flexible Reviewed-by: jrose, twisti, kvn, coleenp
author never
date Sat, 10 Sep 2011 17:29:02 -0700
parents 63997f575155
children da91efe96a93
comparison
equal deleted inserted replaced
3937:c565834fb592 3938:e6b1331a51d2
53 53
54 private static synchronized void initialize(TypeDataBase db) { 54 private static synchronized void initialize(TypeDataBase db) {
55 // klass and oop_size are HotSpot magic fields and hence we can't 55 // klass and oop_size are HotSpot magic fields and hence we can't
56 // find them from InstanceKlass for java.lang.Class. 56 // find them from InstanceKlass for java.lang.Class.
57 Type jlc = db.lookupType("java_lang_Class"); 57 Type jlc = db.lookupType("java_lang_Class");
58 int klassOffset = (int) jlc.getCIntegerField("klass_offset").getValue(); 58 int klassOffset = (int) jlc.getCIntegerField("_klass_offset").getValue();
59 if (VM.getVM().isCompressedOopsEnabled()) { 59 if (VM.getVM().isCompressedOopsEnabled()) {
60 klassField = new NarrowOopField(new NamedFieldIdentifier("klass"), klassOffset, true); 60 klassField = new NarrowOopField(new NamedFieldIdentifier("klass"), klassOffset, true);
61 } else { 61 } else {
62 klassField = new OopField(new NamedFieldIdentifier("klass"), klassOffset, true); 62 klassField = new OopField(new NamedFieldIdentifier("klass"), klassOffset, true);
63 } 63 }
64 int oopSizeOffset = (int) jlc.getCIntegerField("oop_size_offset").getValue(); 64 int oopSizeOffset = (int) jlc.getCIntegerField("_oop_size_offset").getValue();
65 oopSizeField = new IntField(new NamedFieldIdentifier("oop_size"), oopSizeOffset, true); 65 oopSizeField = new IntField(new NamedFieldIdentifier("oop_size"), oopSizeOffset, true);
66 } 66 }
67 67
68 /** get klassOop field at offset hc_klass_offset from a java.lang.Class object */ 68 /** get klassOop field at offset hc_klass_offset from a java.lang.Class object */
69 public static Klass asKlass(Oop aClass) { 69 public static Klass asKlass(Oop aClass) {