Mercurial > hg > graal-compiler
comparison agent/src/share/classes/sun/jvm/hotspot/oops/Method.java @ 7402:fd74228fd5ca
8004076: Move _max_locals and _size_of_parameters to ConstMethod for better sharing.
Summary: Move _max_locals and _size_of_parameters to ConstMethod for better sharing.
Reviewed-by: coleenp, minqi, jrose
author | jiangli |
---|---|
date | Tue, 11 Dec 2012 12:41:31 -0500 |
parents | b2dbd323c668 |
children | aeaca88565e6 |
comparison
equal
deleted
inserted
replaced
7396:4a2ed49abd51 | 7402:fd74228fd5ca |
---|---|
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 maxLocals = new CIntField(type.getCIntegerField("_max_locals"), 0); | |
54 sizeOfParameters = new CIntField(type.getCIntegerField("_size_of_parameters"), 0); | |
55 accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0); | 53 accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0); |
56 code = type.getAddressField("_code"); | 54 code = type.getAddressField("_code"); |
57 vtableIndex = new CIntField(type.getCIntegerField("_vtable_index"), 0); | 55 vtableIndex = new CIntField(type.getCIntegerField("_vtable_index"), 0); |
58 if (!VM.getVM().isCore()) { | 56 if (!VM.getVM().isCore()) { |
59 invocationCounter = new CIntField(type.getCIntegerField("_invocation_counter"), 0); | 57 invocationCounter = new CIntField(type.getCIntegerField("_invocation_counter"), 0); |
81 | 79 |
82 // Fields | 80 // Fields |
83 private static AddressField constMethod; | 81 private static AddressField constMethod; |
84 private static AddressField methodData; | 82 private static AddressField methodData; |
85 private static CIntField methodSize; | 83 private static CIntField methodSize; |
86 private static CIntField maxLocals; | |
87 private static CIntField sizeOfParameters; | |
88 private static CIntField accessFlags; | 84 private static CIntField accessFlags; |
89 private static CIntField vtableIndex; | 85 private static CIntField vtableIndex; |
90 private static CIntField invocationCounter; | 86 private static CIntField invocationCounter; |
91 private static CIntField backedgeCounter; | 87 private static CIntField backedgeCounter; |
92 private static long bytecodeOffset; | 88 private static long bytecodeOffset; |
132 return (MethodData) VMObjectFactory.newObject(MethodData.class, addr); | 128 return (MethodData) VMObjectFactory.newObject(MethodData.class, addr); |
133 } | 129 } |
134 /** WARNING: this is in words, not useful in this system; use getObjectSize() instead */ | 130 /** WARNING: this is in words, not useful in this system; use getObjectSize() instead */ |
135 public long getMethodSize() { return methodSize.getValue(this); } | 131 public long getMethodSize() { return methodSize.getValue(this); } |
136 public long getMaxStack() { return getConstMethod().getMaxStack(); } | 132 public long getMaxStack() { return getConstMethod().getMaxStack(); } |
137 public long getMaxLocals() { return maxLocals.getValue(this); } | 133 public long getMaxLocals() { return getConstMethod().getMaxLocals(); } |
138 public long getSizeOfParameters() { return sizeOfParameters.getValue(this); } | 134 public long getSizeOfParameters() { return getConstMethod().getSizeOfParameters(); } |
139 public long getNameIndex() { return getConstMethod().getNameIndex(); } | 135 public long getNameIndex() { return getConstMethod().getNameIndex(); } |
140 public long getSignatureIndex() { return getConstMethod().getSignatureIndex(); } | 136 public long getSignatureIndex() { return getConstMethod().getSignatureIndex(); } |
141 public long getGenericSignatureIndex() { return getConstMethod().getGenericSignatureIndex(); } | 137 public long getGenericSignatureIndex() { return getConstMethod().getGenericSignatureIndex(); } |
142 public long getAccessFlags() { return accessFlags.getValue(this); } | 138 public long getAccessFlags() { return accessFlags.getValue(this); } |
143 public long getCodeSize() { return getConstMethod().getCodeSize(); } | 139 public long getCodeSize() { return getConstMethod().getCodeSize(); } |
280 tty.print("Method " + getName().asString() + getSignature().asString() + "@" + getAddress()); | 276 tty.print("Method " + getName().asString() + getSignature().asString() + "@" + getAddress()); |
281 } | 277 } |
282 | 278 |
283 public void iterateFields(MetadataVisitor visitor) { | 279 public void iterateFields(MetadataVisitor visitor) { |
284 visitor.doCInt(methodSize, true); | 280 visitor.doCInt(methodSize, true); |
285 visitor.doCInt(maxLocals, true); | |
286 visitor.doCInt(sizeOfParameters, true); | |
287 visitor.doCInt(accessFlags, true); | 281 visitor.doCInt(accessFlags, true); |
288 } | 282 } |
289 | 283 |
290 public boolean hasLineNumberTable() { | 284 public boolean hasLineNumberTable() { |
291 return getConstMethod().hasLineNumberTable(); | 285 return getConstMethod().hasLineNumberTable(); |