author | jiangli |
Tue, 11 Dec 2012 12:41:31 -0500 | |
changeset 14745 | 03904dd8649b |
parent 14586 | 1262473e8fc1 |
child 17000 | 11bf92e571a2 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
12937
0032fb2caff6
7172967: Eliminate constMethod's _method backpointer to methodOop.
jiangli
parents:
10547
diff
changeset
|
2 |
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
25 |
package sun.jvm.hotspot.oops; |
|
26 |
||
27 |
import java.io.*; |
|
28 |
import java.util.*; |
|
29 |
import sun.jvm.hotspot.code.*; |
|
30 |
import sun.jvm.hotspot.debugger.*; |
|
31 |
import sun.jvm.hotspot.interpreter.*; |
|
32 |
import sun.jvm.hotspot.memory.*; |
|
33 |
import sun.jvm.hotspot.runtime.*; |
|
34 |
import sun.jvm.hotspot.types.*; |
|
35 |
import sun.jvm.hotspot.utilities.*; |
|
36 |
||
37 |
// A Method represents a Java method |
|
38 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
39 |
public class Method extends Metadata { |
1 | 40 |
static { |
41 |
VM.registerVMInitializedObserver(new Observer() { |
|
42 |
public void update(Observable o, Object data) { |
|
43 |
initialize(VM.getVM().getTypeDataBase()); |
|
44 |
} |
|
45 |
}); |
|
46 |
} |
|
47 |
||
48 |
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException { |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
49 |
Type type = db.lookupType("Method"); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
50 |
constMethod = type.getAddressField("_constMethod"); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
51 |
methodData = type.getAddressField("_method_data"); |
1 | 52 |
methodSize = new CIntField(type.getCIntegerField("_method_size"), 0); |
53 |
accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0); |
|
54 |
code = type.getAddressField("_code"); |
|
55 |
vtableIndex = new CIntField(type.getCIntegerField("_vtable_index"), 0); |
|
56 |
if (!VM.getVM().isCore()) { |
|
57 |
invocationCounter = new CIntField(type.getCIntegerField("_invocation_counter"), 0); |
|
10547 | 58 |
backedgeCounter = new CIntField(type.getCIntegerField("_backedge_counter"), 0); |
1 | 59 |
} |
60 |
bytecodeOffset = type.getSize(); |
|
61 |
||
10547 | 62 |
interpreterThrowoutCountField = new CIntField(type.getCIntegerField("_interpreter_throwout_count"), 0); |
63 |
interpreterInvocationCountField = new CIntField(type.getCIntegerField("_interpreter_invocation_count"), 0); |
|
64 |
||
1 | 65 |
/* |
66 |
interpreterEntry = type.getAddressField("_interpreter_entry"); |
|
67 |
fromCompiledCodeEntryPoint = type.getAddressField("_from_compiled_code_entry_point"); |
|
68 |
||
69 |
*/ |
|
70 |
objectInitializerName = null; |
|
71 |
classInitializerName = null; |
|
72 |
} |
|
73 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
74 |
public Method(Address addr) { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
75 |
super(addr); |
1 | 76 |
} |
77 |
||
78 |
public boolean isMethod() { return true; } |
|
79 |
||
80 |
// Fields |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
81 |
private static AddressField constMethod; |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
82 |
private static AddressField methodData; |
1 | 83 |
private static CIntField methodSize; |
84 |
private static CIntField accessFlags; |
|
85 |
private static CIntField vtableIndex; |
|
86 |
private static CIntField invocationCounter; |
|
10547 | 87 |
private static CIntField backedgeCounter; |
1 | 88 |
private static long bytecodeOffset; |
89 |
||
90 |
private static AddressField code; |
|
91 |
||
10547 | 92 |
private static CIntField interpreterThrowoutCountField; |
93 |
private static CIntField interpreterInvocationCountField; |
|
94 |
||
1 | 95 |
// constant method names - <init>, <clinit> |
96 |
// Initialized lazily to avoid initialization ordering dependencies between Method and SymbolTable |
|
97 |
private static Symbol objectInitializerName; |
|
98 |
private static Symbol classInitializerName; |
|
99 |
private static Symbol objectInitializerName() { |
|
100 |
if (objectInitializerName == null) { |
|
101 |
objectInitializerName = VM.getVM().getSymbolTable().probe("<init>"); |
|
102 |
} |
|
103 |
return objectInitializerName; |
|
104 |
} |
|
105 |
private static Symbol classInitializerName() { |
|
106 |
if (classInitializerName == null) { |
|
107 |
classInitializerName = VM.getVM().getSymbolTable().probe("<clinit>"); |
|
108 |
} |
|
109 |
return classInitializerName; |
|
110 |
} |
|
111 |
||
112 |
||
113 |
/* |
|
114 |
private static AddressCField interpreterEntry; |
|
115 |
private static AddressCField fromCompiledCodeEntryPoint; |
|
116 |
*/ |
|
117 |
||
118 |
// Accessors for declared fields |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
119 |
public ConstMethod getConstMethod() { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
120 |
Address addr = constMethod.getValue(getAddress()); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
121 |
return (ConstMethod) VMObjectFactory.newObject(ConstMethod.class, addr); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
122 |
} |
12937
0032fb2caff6
7172967: Eliminate constMethod's _method backpointer to methodOop.
jiangli
parents:
10547
diff
changeset
|
123 |
public ConstantPool getConstants() { |
0032fb2caff6
7172967: Eliminate constMethod's _method backpointer to methodOop.
jiangli
parents:
10547
diff
changeset
|
124 |
return getConstMethod().getConstants(); |
0032fb2caff6
7172967: Eliminate constMethod's _method backpointer to methodOop.
jiangli
parents:
10547
diff
changeset
|
125 |
} |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
126 |
public MethodData getMethodData() { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
127 |
Address addr = methodData.getValue(getAddress()); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
128 |
return (MethodData) VMObjectFactory.newObject(MethodData.class, addr); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
129 |
} |
1 | 130 |
/** WARNING: this is in words, not useful in this system; use getObjectSize() instead */ |
131 |
public long getMethodSize() { return methodSize.getValue(this); } |
|
14586
1262473e8fc1
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
14477
diff
changeset
|
132 |
public long getMaxStack() { return getConstMethod().getMaxStack(); } |
14745
03904dd8649b
8004076: Move _max_locals and _size_of_parameters to ConstMethod for better sharing.
jiangli
parents:
14586
diff
changeset
|
133 |
public long getMaxLocals() { return getConstMethod().getMaxLocals(); } |
03904dd8649b
8004076: Move _max_locals and _size_of_parameters to ConstMethod for better sharing.
jiangli
parents:
14586
diff
changeset
|
134 |
public long getSizeOfParameters() { return getConstMethod().getSizeOfParameters(); } |
1 | 135 |
public long getNameIndex() { return getConstMethod().getNameIndex(); } |
136 |
public long getSignatureIndex() { return getConstMethod().getSignatureIndex(); } |
|
137 |
public long getGenericSignatureIndex() { return getConstMethod().getGenericSignatureIndex(); } |
|
138 |
public long getAccessFlags() { return accessFlags.getValue(this); } |
|
139 |
public long getCodeSize() { return getConstMethod().getCodeSize(); } |
|
140 |
public long getVtableIndex() { return vtableIndex.getValue(this); } |
|
141 |
public long getInvocationCounter() { |
|
142 |
if (Assert.ASSERTS_ENABLED) { |
|
143 |
Assert.that(!VM.getVM().isCore(), "must not be used in core build"); |
|
144 |
} |
|
145 |
return invocationCounter.getValue(this); |
|
146 |
} |
|
10547 | 147 |
public long getBackedgeCounter() { |
148 |
if (Assert.ASSERTS_ENABLED) { |
|
149 |
Assert.that(!VM.getVM().isCore(), "must not be used in core build"); |
|
150 |
} |
|
151 |
return backedgeCounter.getValue(this); |
|
152 |
} |
|
1 | 153 |
|
154 |
// get associated compiled native method, if available, else return null. |
|
155 |
public NMethod getNativeMethod() { |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
156 |
Address addr = code.getValue(getAddress()); |
1 | 157 |
return (NMethod) VMObjectFactory.newObject(NMethod.class, addr); |
158 |
} |
|
159 |
||
160 |
// Convenience routine |
|
161 |
public AccessFlags getAccessFlagsObj() { |
|
162 |
return new AccessFlags(getAccessFlags()); |
|
163 |
} |
|
164 |
||
165 |
/** Get a bytecode or breakpoint at the given bci */ |
|
166 |
public int getBytecodeOrBPAt(int bci) { |
|
167 |
return getConstMethod().getBytecodeOrBPAt(bci); |
|
168 |
} |
|
169 |
||
170 |
/** Fetch the original non-breakpoint bytecode at the specified |
|
171 |
bci. It is required that there is currently a bytecode at this |
|
172 |
bci. */ |
|
173 |
public int getOrigBytecodeAt(int bci) { |
|
14391
df0a1573d5bd
8000725: NPG: method_holder() and pool_holder() and pool_holder field should be InstanceKlass
coleenp
parents:
13728
diff
changeset
|
174 |
BreakpointInfo bp = getMethodHolder().getBreakpoints(); |
1 | 175 |
for (; bp != null; bp = bp.getNext()) { |
176 |
if (bp.match(this, bci)) { |
|
177 |
return bp.getOrigBytecode(); |
|
178 |
} |
|
179 |
} |
|
180 |
System.err.println("Requested bci " + bci); |
|
181 |
for (; bp != null; bp = bp.getNext()) { |
|
182 |
System.err.println("Breakpoint at bci " + bp.getBCI() + ", bytecode " + |
|
183 |
bp.getOrigBytecode()); |
|
184 |
} |
|
185 |
Assert.that(false, "Should not reach here"); |
|
186 |
return -1; // not reached |
|
187 |
} |
|
188 |
||
189 |
public byte getBytecodeByteArg(int bci) { |
|
190 |
return getConstMethod().getBytecodeByteArg(bci); |
|
191 |
} |
|
192 |
||
193 |
/** Fetches a 16-bit big-endian ("Java ordered") value from the |
|
194 |
bytecode stream */ |
|
195 |
public short getBytecodeShortArg(int bci) { |
|
196 |
return getConstMethod().getBytecodeShortArg(bci); |
|
197 |
} |
|
198 |
||
10251
71b8938a2821
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
8921
diff
changeset
|
199 |
/** Fetches a 16-bit native ordered value from the |
71b8938a2821
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
8921
diff
changeset
|
200 |
bytecode stream */ |
71b8938a2821
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
8921
diff
changeset
|
201 |
public short getNativeShortArg(int bci) { |
71b8938a2821
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
8921
diff
changeset
|
202 |
return getConstMethod().getNativeShortArg(bci); |
71b8938a2821
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
8921
diff
changeset
|
203 |
} |
71b8938a2821
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
8921
diff
changeset
|
204 |
|
1 | 205 |
/** Fetches a 32-bit big-endian ("Java ordered") value from the |
206 |
bytecode stream */ |
|
207 |
public int getBytecodeIntArg(int bci) { |
|
208 |
return getConstMethod().getBytecodeIntArg(bci); |
|
209 |
} |
|
210 |
||
10251
71b8938a2821
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
8921
diff
changeset
|
211 |
/** Fetches a 32-bit native ordered value from the |
71b8938a2821
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
8921
diff
changeset
|
212 |
bytecode stream */ |
71b8938a2821
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
8921
diff
changeset
|
213 |
public int getNativeIntArg(int bci) { |
71b8938a2821
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
8921
diff
changeset
|
214 |
return getConstMethod().getNativeIntArg(bci); |
71b8938a2821
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
8921
diff
changeset
|
215 |
} |
71b8938a2821
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
8921
diff
changeset
|
216 |
|
1 | 217 |
public byte[] getByteCode() { |
218 |
return getConstMethod().getByteCode(); |
|
219 |
} |
|
220 |
||
221 |
/* |
|
222 |
public Address getCode() { return codeField.getValue(this); } |
|
223 |
public Address getInterpreterEntry() { return interpreterEntryField.getValue(this); } |
|
224 |
public Address getFromCompiledCodeEntryPoint() { return fromCompiledCodeEntryPointField.getValue(this); } |
|
225 |
*/ |
|
226 |
// Accessors |
|
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
5547
diff
changeset
|
227 |
public Symbol getName() { return getConstants().getSymbolAt(getNameIndex()); } |
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
5547
diff
changeset
|
228 |
public Symbol getSignature() { return getConstants().getSymbolAt(getSignatureIndex()); } |
1 | 229 |
public Symbol getGenericSignature() { |
230 |
long index = getGenericSignatureIndex(); |
|
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
5547
diff
changeset
|
231 |
return (index != 0L) ? getConstants().getSymbolAt(index) : null; |
1 | 232 |
} |
233 |
||
234 |
// Method holder (the Klass holding this method) |
|
14391
df0a1573d5bd
8000725: NPG: method_holder() and pool_holder() and pool_holder field should be InstanceKlass
coleenp
parents:
13728
diff
changeset
|
235 |
public InstanceKlass getMethodHolder() { return getConstants().getPoolHolder(); } |
1 | 236 |
|
237 |
// Access flags |
|
238 |
public boolean isPublic() { return getAccessFlagsObj().isPublic(); } |
|
239 |
public boolean isPrivate() { return getAccessFlagsObj().isPrivate(); } |
|
240 |
public boolean isProtected() { return getAccessFlagsObj().isProtected(); } |
|
241 |
public boolean isPackagePrivate() { AccessFlags af = getAccessFlagsObj(); |
|
242 |
return (!af.isPublic() && !af.isPrivate() && !af.isProtected()); } |
|
243 |
public boolean isStatic() { return getAccessFlagsObj().isStatic(); } |
|
244 |
public boolean isFinal() { return getAccessFlagsObj().isFinal(); } |
|
245 |
public boolean isSynchronized() { return getAccessFlagsObj().isSynchronized(); } |
|
246 |
public boolean isBridge() { return getAccessFlagsObj().isBridge(); } |
|
247 |
public boolean isVarArgs() { return getAccessFlagsObj().isVarArgs(); } |
|
248 |
public boolean isNative() { return getAccessFlagsObj().isNative(); } |
|
249 |
public boolean isAbstract() { return getAccessFlagsObj().isAbstract(); } |
|
250 |
public boolean isStrict() { return getAccessFlagsObj().isStrict(); } |
|
251 |
public boolean isSynthetic() { return getAccessFlagsObj().isSynthetic(); } |
|
252 |
||
253 |
public boolean isConstructor() { |
|
254 |
return (!isStatic()) && getName().equals(objectInitializerName()); |
|
255 |
} |
|
256 |
||
257 |
public boolean isStaticInitializer() { |
|
258 |
return isStatic() && getName().equals(classInitializerName()); |
|
259 |
} |
|
260 |
||
261 |
public boolean isObsolete() { |
|
262 |
return getAccessFlagsObj().isObsolete(); |
|
263 |
} |
|
264 |
||
265 |
public OopMapCacheEntry getMaskFor(int bci) { |
|
266 |
OopMapCacheEntry entry = new OopMapCacheEntry(); |
|
267 |
entry.fill(this, bci); |
|
268 |
return entry; |
|
269 |
} |
|
270 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
271 |
public long getSize() { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
272 |
return getMethodSize(); |
1 | 273 |
} |
274 |
||
275 |
public void printValueOn(PrintStream tty) { |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
276 |
tty.print("Method " + getName().asString() + getSignature().asString() + "@" + getAddress()); |
1 | 277 |
} |
278 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
279 |
public void iterateFields(MetadataVisitor visitor) { |
1 | 280 |
visitor.doCInt(methodSize, true); |
281 |
visitor.doCInt(accessFlags, true); |
|
282 |
} |
|
283 |
||
284 |
public boolean hasLineNumberTable() { |
|
285 |
return getConstMethod().hasLineNumberTable(); |
|
286 |
} |
|
287 |
||
288 |
public int getLineNumberFromBCI(int bci) { |
|
289 |
return getConstMethod().getLineNumberFromBCI(bci); |
|
290 |
} |
|
291 |
||
292 |
public LineNumberTableElement[] getLineNumberTable() { |
|
293 |
return getConstMethod().getLineNumberTable(); |
|
294 |
} |
|
295 |
||
296 |
public boolean hasLocalVariableTable() { |
|
297 |
return getConstMethod().hasLocalVariableTable(); |
|
298 |
} |
|
299 |
||
300 |
/** Should only be called if table is present */ |
|
301 |
public LocalVariableTableElement[] getLocalVariableTable() { |
|
302 |
return getConstMethod().getLocalVariableTable(); |
|
303 |
} |
|
304 |
||
305 |
public Symbol getLocalVariableName(int bci, int slot) { |
|
306 |
if (! hasLocalVariableTable()) { |
|
307 |
return null; |
|
308 |
} |
|
309 |
||
310 |
LocalVariableTableElement[] locals = getLocalVariableTable(); |
|
311 |
for (int l = 0; l < locals.length; l++) { |
|
312 |
LocalVariableTableElement local = locals[l]; |
|
313 |
if ((bci >= local.getStartBCI()) && |
|
314 |
(bci < (local.getStartBCI() + local.getLength())) && |
|
315 |
slot == local.getSlot()) { |
|
316 |
return getConstants().getSymbolAt(local.getNameCPIndex()); |
|
317 |
} |
|
318 |
} |
|
319 |
||
320 |
return null; |
|
321 |
} |
|
322 |
||
13282
9872915dd78d
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
12937
diff
changeset
|
323 |
public boolean hasExceptionTable() { |
9872915dd78d
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
12937
diff
changeset
|
324 |
return getConstMethod().hasExceptionTable(); |
9872915dd78d
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
12937
diff
changeset
|
325 |
} |
9872915dd78d
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
12937
diff
changeset
|
326 |
|
9872915dd78d
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
12937
diff
changeset
|
327 |
public ExceptionTableElement[] getExceptionTable() { |
9872915dd78d
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
12937
diff
changeset
|
328 |
return getConstMethod().getExceptionTable(); |
9872915dd78d
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
12937
diff
changeset
|
329 |
} |
9872915dd78d
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
12937
diff
changeset
|
330 |
|
1 | 331 |
public boolean hasCheckedExceptions() { |
332 |
return getConstMethod().hasCheckedExceptions(); |
|
333 |
} |
|
334 |
||
335 |
/** Should only be called if table is present */ |
|
336 |
public CheckedExceptionElement[] getCheckedExceptions() { |
|
337 |
return getConstMethod().getCheckedExceptions(); |
|
338 |
} |
|
339 |
||
340 |
/** Returns name and signature in external form for debugging |
|
341 |
purposes */ |
|
342 |
public String externalNameAndSignature() { |
|
343 |
final StringBuffer buf = new StringBuffer(); |
|
344 |
buf.append(getMethodHolder().getName().asString()); |
|
345 |
buf.append("."); |
|
346 |
buf.append(getName().asString()); |
|
347 |
buf.append("("); |
|
348 |
new SignatureConverter(getSignature(), buf).iterateParameters(); |
|
349 |
buf.append(")"); |
|
350 |
return buf.toString().replace('/', '.'); |
|
351 |
} |
|
14477
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
14391
diff
changeset
|
352 |
|
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
14391
diff
changeset
|
353 |
public void dumpReplayData(PrintStream out) { |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
14391
diff
changeset
|
354 |
NMethod nm = getNativeMethod(); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
14391
diff
changeset
|
355 |
int code_size = 0; |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
14391
diff
changeset
|
356 |
if (nm != null) { |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
14391
diff
changeset
|
357 |
code_size = (int)nm.codeEnd().minus(nm.getVerifiedEntryPoint()); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
14391
diff
changeset
|
358 |
} |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
14391
diff
changeset
|
359 |
Klass holder = getMethodHolder(); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
14391
diff
changeset
|
360 |
out.println("ciMethod " + |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
14391
diff
changeset
|
361 |
holder.getName().asString() + " " + |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
14391
diff
changeset
|
362 |
OopUtilities.escapeString(getName().asString()) + " " + |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
14391
diff
changeset
|
363 |
getSignature().asString() + " " + |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
14391
diff
changeset
|
364 |
getInvocationCounter() + " " + |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
14391
diff
changeset
|
365 |
getBackedgeCounter() + " " + |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
14391
diff
changeset
|
366 |
interpreterInvocationCount() + " " + |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
14391
diff
changeset
|
367 |
interpreterThrowoutCount() + " " + |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
14391
diff
changeset
|
368 |
code_size); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
14391
diff
changeset
|
369 |
} |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
14391
diff
changeset
|
370 |
|
10547 | 371 |
public int interpreterThrowoutCount() { |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
372 |
return (int) interpreterThrowoutCountField.getValue(this); |
10547 | 373 |
} |
374 |
||
375 |
public int interpreterInvocationCount() { |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13282
diff
changeset
|
376 |
return (int) interpreterInvocationCountField.getValue(this); |
10547 | 377 |
} |
1 | 378 |
} |