agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
7031614 Cdiff agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java
agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java
Print this page
*** 239,248 ****
--- 239,252 ----
}
// Byteside of the header
private static long headerSize;
+ public long getObjectSize(Oop object) {
+ return getSizeHelper() * VM.getVM().getAddressSize();
+ }
+
public static long getHeaderSize() { return headerSize; }
// Accessors for declared fields
public Klass getArrayKlasses() { return (Klass) arrayKlasses.getValue(this); }
public ObjArray getMethods() { return (ObjArray) methods.getValue(this); }
*** 457,467 ****
--- 461,486 ----
visitor.doCInt(isMarkedDependent, true);
visitor.doCInt(initState, true);
visitor.doCInt(vtableLen, true);
visitor.doCInt(itableLen, true);
}
+ }
+ /*
+ * Visit the static fields of this InstanceKlass with the obj of
+ * the visitor set to the oop holding the fields, which is
+ * currently the java mirror.
+ */
+ public void iterateStaticFields(OopVisitor visitor) {
+ visitor.setObj(getJavaMirror());
+ visitor.prologue();
+ iterateStaticFieldsInternal(visitor);
+ visitor.epilogue();
+
+ }
+
+ void iterateStaticFieldsInternal(OopVisitor visitor) {
TypeArray fields = getFields();
int length = (int) fields.getLength();
for (int index = 0; index < length; index += NEXT_OFFSET) {
short accessFlags = fields.getShortAt(index + ACCESS_FLAGS_OFFSET);
short signatureIndex = fields.getShortAt(index + SIGNATURE_INDEX_OFFSET);
*** 475,487 ****
public Klass getJavaSuper() {
return getSuper();
}
! public void iterateNonStaticFields(OopVisitor visitor) {
if (getSuper() != null) {
! ((InstanceKlass) getSuper()).iterateNonStaticFields(visitor);
}
TypeArray fields = getFields();
int length = (int) fields.getLength();
for (int index = 0; index < length; index += NEXT_OFFSET) {
--- 494,506 ----
public Klass getJavaSuper() {
return getSuper();
}
! public void iterateNonStaticFields(OopVisitor visitor, Oop obj) {
if (getSuper() != null) {
! ((InstanceKlass) getSuper()).iterateNonStaticFields(visitor, obj);
}
TypeArray fields = getFields();
int length = (int) fields.getLength();
for (int index = 0; index < length; index += NEXT_OFFSET) {
agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File