comparison agent/src/share/classes/sun/jvm/hotspot/oops/Method.java @ 7183:b2dbd323c668

8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod. Summary: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod. Reviewed-by: bdelsart, sspitsyn, coleenp
author jiangli
date Tue, 27 Nov 2012 17:03:56 -0500
parents bd7a7ce2e264
children fd74228fd5ca
comparison
equal deleted inserted replaced
7165:e1d42ba865de 7183:b2dbd323c668
48 private static synchronized void initialize(TypeDataBase db) throws WrongTypeException { 48 private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
49 Type type = db.lookupType("Method"); 49 Type type = db.lookupType("Method");
50 constMethod = type.getAddressField("_constMethod"); 50 constMethod = type.getAddressField("_constMethod");
51 methodData = type.getAddressField("_method_data"); 51 methodData = type.getAddressField("_method_data");
52 methodSize = new CIntField(type.getCIntegerField("_method_size"), 0); 52 methodSize = new CIntField(type.getCIntegerField("_method_size"), 0);
53 maxStack = new CIntField(type.getCIntegerField("_max_stack"), 0);
54 maxLocals = new CIntField(type.getCIntegerField("_max_locals"), 0); 53 maxLocals = new CIntField(type.getCIntegerField("_max_locals"), 0);
55 sizeOfParameters = new CIntField(type.getCIntegerField("_size_of_parameters"), 0); 54 sizeOfParameters = new CIntField(type.getCIntegerField("_size_of_parameters"), 0);
56 accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0); 55 accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0);
57 code = type.getAddressField("_code"); 56 code = type.getAddressField("_code");
58 vtableIndex = new CIntField(type.getCIntegerField("_vtable_index"), 0); 57 vtableIndex = new CIntField(type.getCIntegerField("_vtable_index"), 0);
82 81
83 // Fields 82 // Fields
84 private static AddressField constMethod; 83 private static AddressField constMethod;
85 private static AddressField methodData; 84 private static AddressField methodData;
86 private static CIntField methodSize; 85 private static CIntField methodSize;
87 private static CIntField maxStack;
88 private static CIntField maxLocals; 86 private static CIntField maxLocals;
89 private static CIntField sizeOfParameters; 87 private static CIntField sizeOfParameters;
90 private static CIntField accessFlags; 88 private static CIntField accessFlags;
91 private static CIntField vtableIndex; 89 private static CIntField vtableIndex;
92 private static CIntField invocationCounter; 90 private static CIntField invocationCounter;
133 Address addr = methodData.getValue(getAddress()); 131 Address addr = methodData.getValue(getAddress());
134 return (MethodData) VMObjectFactory.newObject(MethodData.class, addr); 132 return (MethodData) VMObjectFactory.newObject(MethodData.class, addr);
135 } 133 }
136 /** WARNING: this is in words, not useful in this system; use getObjectSize() instead */ 134 /** WARNING: this is in words, not useful in this system; use getObjectSize() instead */
137 public long getMethodSize() { return methodSize.getValue(this); } 135 public long getMethodSize() { return methodSize.getValue(this); }
138 public long getMaxStack() { return maxStack.getValue(this); } 136 public long getMaxStack() { return getConstMethod().getMaxStack(); }
139 public long getMaxLocals() { return maxLocals.getValue(this); } 137 public long getMaxLocals() { return maxLocals.getValue(this); }
140 public long getSizeOfParameters() { return sizeOfParameters.getValue(this); } 138 public long getSizeOfParameters() { return sizeOfParameters.getValue(this); }
141 public long getNameIndex() { return getConstMethod().getNameIndex(); } 139 public long getNameIndex() { return getConstMethod().getNameIndex(); }
142 public long getSignatureIndex() { return getConstMethod().getSignatureIndex(); } 140 public long getSignatureIndex() { return getConstMethod().getSignatureIndex(); }
143 public long getGenericSignatureIndex() { return getConstMethod().getGenericSignatureIndex(); } 141 public long getGenericSignatureIndex() { return getConstMethod().getGenericSignatureIndex(); }
282 tty.print("Method " + getName().asString() + getSignature().asString() + "@" + getAddress()); 280 tty.print("Method " + getName().asString() + getSignature().asString() + "@" + getAddress());
283 } 281 }
284 282
285 public void iterateFields(MetadataVisitor visitor) { 283 public void iterateFields(MetadataVisitor visitor) {
286 visitor.doCInt(methodSize, true); 284 visitor.doCInt(methodSize, true);
287 visitor.doCInt(maxStack, true);
288 visitor.doCInt(maxLocals, true); 285 visitor.doCInt(maxLocals, true);
289 visitor.doCInt(sizeOfParameters, true); 286 visitor.doCInt(sizeOfParameters, true);
290 visitor.doCInt(accessFlags, true); 287 visitor.doCInt(accessFlags, true);
291 } 288 }
292 289