Mercurial > hg > graal-jvmci-8
annotate agent/src/share/classes/sun/jvm/hotspot/oops/Method.java @ 24234:ea6f94ab283b default tip
Added tag jvmci-0.36 for changeset 8128b98d4736
author | Gilles Duboscq <gilles.m.duboscq@oracle.com> |
---|---|
date | Mon, 18 Sep 2017 18:49:45 +0200 |
parents | cbfe859bd244 |
children |
rev | line source |
---|---|
0 | 1 /* |
10105
aeaca88565e6
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
7402
diff
changeset
|
2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
25 package sun.jvm.hotspot.oops; | |
26 | |
10257
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
27 import java.io.PrintStream; |
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
28 import java.util.Observable; |
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
29 import java.util.Observer; |
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
30 |
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
31 import sun.jvm.hotspot.code.NMethod; |
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
32 import sun.jvm.hotspot.debugger.Address; |
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
33 import sun.jvm.hotspot.interpreter.OopMapCacheEntry; |
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
34 import sun.jvm.hotspot.runtime.SignatureConverter; |
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
35 import sun.jvm.hotspot.runtime.VM; |
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
36 import sun.jvm.hotspot.runtime.VMObjectFactory; |
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
37 import sun.jvm.hotspot.types.AddressField; |
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
38 import sun.jvm.hotspot.types.Type; |
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
39 import sun.jvm.hotspot.types.TypeDataBase; |
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
40 import sun.jvm.hotspot.types.WrongTypeException; |
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
41 import sun.jvm.hotspot.utilities.Assert; |
0 | 42 |
43 // A Method represents a Java method | |
44 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
45 public class Method extends Metadata { |
0 | 46 static { |
47 VM.registerVMInitializedObserver(new Observer() { | |
48 public void update(Observable o, Object data) { | |
49 initialize(VM.getVM().getTypeDataBase()); | |
50 } | |
51 }); | |
52 } | |
53 | |
54 private static synchronized void initialize(TypeDataBase db) throws WrongTypeException { | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
55 Type type = db.lookupType("Method"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
56 constMethod = type.getAddressField("_constMethod"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
57 methodData = type.getAddressField("_method_data"); |
10105
aeaca88565e6
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
7402
diff
changeset
|
58 methodCounters = type.getAddressField("_method_counters"); |
0 | 59 methodSize = new CIntField(type.getCIntegerField("_method_size"), 0); |
60 accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0); | |
61 code = type.getAddressField("_code"); | |
62 vtableIndex = new CIntField(type.getCIntegerField("_vtable_index"), 0); | |
63 bytecodeOffset = type.getSize(); | |
64 | |
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 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
74 public Method(Address addr) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
75 super(addr); |
0 | 76 } |
77 | |
78 public boolean isMethod() { return true; } | |
79 | |
80 // Fields | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
81 private static AddressField constMethod; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
82 private static AddressField methodData; |
10105
aeaca88565e6
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
7402
diff
changeset
|
83 private static AddressField methodCounters; |
0 | 84 private static CIntField methodSize; |
85 private static CIntField accessFlags; | |
86 private static CIntField vtableIndex; | |
87 private static long bytecodeOffset; | |
88 | |
89 private static AddressField code; | |
90 | |
91 // constant method names - <init>, <clinit> | |
92 // Initialized lazily to avoid initialization ordering dependencies between Method and SymbolTable | |
93 private static Symbol objectInitializerName; | |
94 private static Symbol classInitializerName; | |
95 private static Symbol objectInitializerName() { | |
96 if (objectInitializerName == null) { | |
97 objectInitializerName = VM.getVM().getSymbolTable().probe("<init>"); | |
98 } | |
99 return objectInitializerName; | |
100 } | |
101 private static Symbol classInitializerName() { | |
102 if (classInitializerName == null) { | |
103 classInitializerName = VM.getVM().getSymbolTable().probe("<clinit>"); | |
104 } | |
105 return classInitializerName; | |
106 } | |
107 | |
108 | |
109 /* | |
110 private static AddressCField interpreterEntry; | |
111 private static AddressCField fromCompiledCodeEntryPoint; | |
112 */ | |
113 | |
114 // Accessors for declared fields | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
115 public ConstMethod getConstMethod() { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
116 Address addr = constMethod.getValue(getAddress()); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
117 return (ConstMethod) VMObjectFactory.newObject(ConstMethod.class, addr); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
118 } |
6123
2fe087c3e814
7172967: Eliminate constMethod's _method backpointer to methodOop.
jiangli
parents:
3939
diff
changeset
|
119 public ConstantPool getConstants() { |
2fe087c3e814
7172967: Eliminate constMethod's _method backpointer to methodOop.
jiangli
parents:
3939
diff
changeset
|
120 return getConstMethod().getConstants(); |
2fe087c3e814
7172967: Eliminate constMethod's _method backpointer to methodOop.
jiangli
parents:
3939
diff
changeset
|
121 } |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
122 public MethodData getMethodData() { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
123 Address addr = methodData.getValue(getAddress()); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
124 return (MethodData) VMObjectFactory.newObject(MethodData.class, addr); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
125 } |
10105
aeaca88565e6
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
7402
diff
changeset
|
126 public MethodCounters getMethodCounters() { |
aeaca88565e6
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
7402
diff
changeset
|
127 Address addr = methodCounters.getValue(getAddress()); |
aeaca88565e6
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
7402
diff
changeset
|
128 return (MethodCounters) VMObjectFactory.newObject(MethodCounters.class, addr); |
aeaca88565e6
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
7402
diff
changeset
|
129 } |
0 | 130 /** WARNING: this is in words, not useful in this system; use getObjectSize() instead */ |
131 public long getMethodSize() { return methodSize.getValue(this); } | |
7183
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6972
diff
changeset
|
132 public long getMaxStack() { return getConstMethod().getMaxStack(); } |
7402
fd74228fd5ca
8004076: Move _max_locals and _size_of_parameters to ConstMethod for better sharing.
jiangli
parents:
7183
diff
changeset
|
133 public long getMaxLocals() { return getConstMethod().getMaxLocals(); } |
fd74228fd5ca
8004076: Move _max_locals and _size_of_parameters to ConstMethod for better sharing.
jiangli
parents:
7183
diff
changeset
|
134 public long getSizeOfParameters() { return getConstMethod().getSizeOfParameters(); } |
0 | 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); } | |
10257
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
141 public long getInvocationCount() { |
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
142 MethodCounters mc = getMethodCounters(); |
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
143 return mc == null ? 0 : mc.getInvocationCounter(); |
0 | 144 } |
10257
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
145 public long getBackedgeCount() { |
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
146 MethodCounters mc = getMethodCounters(); |
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
147 return mc == null ? 0 : mc.getBackedgeCounter(); |
3939 | 148 } |
0 | 149 |
150 // get associated compiled native method, if available, else return null. | |
151 public NMethod getNativeMethod() { | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
152 Address addr = code.getValue(getAddress()); |
0 | 153 return (NMethod) VMObjectFactory.newObject(NMethod.class, addr); |
154 } | |
155 | |
156 // Convenience routine | |
157 public AccessFlags getAccessFlagsObj() { | |
158 return new AccessFlags(getAccessFlags()); | |
159 } | |
160 | |
161 /** Get a bytecode or breakpoint at the given bci */ | |
162 public int getBytecodeOrBPAt(int bci) { | |
163 return getConstMethod().getBytecodeOrBPAt(bci); | |
164 } | |
165 | |
166 /** Fetch the original non-breakpoint bytecode at the specified | |
167 bci. It is required that there is currently a bytecode at this | |
168 bci. */ | |
169 public int getOrigBytecodeAt(int bci) { | |
6940
18fb7da42534
8000725: NPG: method_holder() and pool_holder() and pool_holder field should be InstanceKlass
coleenp
parents:
6725
diff
changeset
|
170 BreakpointInfo bp = getMethodHolder().getBreakpoints(); |
0 | 171 for (; bp != null; bp = bp.getNext()) { |
172 if (bp.match(this, bci)) { | |
173 return bp.getOrigBytecode(); | |
174 } | |
175 } | |
176 System.err.println("Requested bci " + bci); | |
177 for (; bp != null; bp = bp.getNext()) { | |
178 System.err.println("Breakpoint at bci " + bp.getBCI() + ", bytecode " + | |
179 bp.getOrigBytecode()); | |
180 } | |
181 Assert.that(false, "Should not reach here"); | |
182 return -1; // not reached | |
183 } | |
184 | |
185 public byte getBytecodeByteArg(int bci) { | |
186 return getConstMethod().getBytecodeByteArg(bci); | |
187 } | |
188 | |
189 /** Fetches a 16-bit big-endian ("Java ordered") value from the | |
190 bytecode stream */ | |
191 public short getBytecodeShortArg(int bci) { | |
192 return getConstMethod().getBytecodeShortArg(bci); | |
193 } | |
194 | |
3838
6a991dcb52bb
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
2426
diff
changeset
|
195 /** Fetches a 16-bit native ordered value from the |
6a991dcb52bb
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
2426
diff
changeset
|
196 bytecode stream */ |
6a991dcb52bb
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
2426
diff
changeset
|
197 public short getNativeShortArg(int bci) { |
6a991dcb52bb
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
2426
diff
changeset
|
198 return getConstMethod().getNativeShortArg(bci); |
6a991dcb52bb
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
2426
diff
changeset
|
199 } |
6a991dcb52bb
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
2426
diff
changeset
|
200 |
0 | 201 /** Fetches a 32-bit big-endian ("Java ordered") value from the |
202 bytecode stream */ | |
203 public int getBytecodeIntArg(int bci) { | |
204 return getConstMethod().getBytecodeIntArg(bci); | |
205 } | |
206 | |
3838
6a991dcb52bb
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
2426
diff
changeset
|
207 /** Fetches a 32-bit native ordered value from the |
6a991dcb52bb
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
2426
diff
changeset
|
208 bytecode stream */ |
6a991dcb52bb
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
2426
diff
changeset
|
209 public int getNativeIntArg(int bci) { |
6a991dcb52bb
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
2426
diff
changeset
|
210 return getConstMethod().getNativeIntArg(bci); |
6a991dcb52bb
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
2426
diff
changeset
|
211 } |
6a991dcb52bb
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
2426
diff
changeset
|
212 |
0 | 213 public byte[] getByteCode() { |
214 return getConstMethod().getByteCode(); | |
215 } | |
216 | |
217 /* | |
218 public Address getCode() { return codeField.getValue(this); } | |
219 public Address getInterpreterEntry() { return interpreterEntryField.getValue(this); } | |
220 public Address getFromCompiledCodeEntryPoint() { return fromCompiledCodeEntryPointField.getValue(this); } | |
221 */ | |
222 // Accessors | |
2177
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1552
diff
changeset
|
223 public Symbol getName() { return getConstants().getSymbolAt(getNameIndex()); } |
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1552
diff
changeset
|
224 public Symbol getSignature() { return getConstants().getSymbolAt(getSignatureIndex()); } |
0 | 225 public Symbol getGenericSignature() { |
226 long index = getGenericSignatureIndex(); | |
2177
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1552
diff
changeset
|
227 return (index != 0L) ? getConstants().getSymbolAt(index) : null; |
0 | 228 } |
229 | |
230 // Method holder (the Klass holding this method) | |
6940
18fb7da42534
8000725: NPG: method_holder() and pool_holder() and pool_holder field should be InstanceKlass
coleenp
parents:
6725
diff
changeset
|
231 public InstanceKlass getMethodHolder() { return getConstants().getPoolHolder(); } |
0 | 232 |
233 // Access flags | |
234 public boolean isPublic() { return getAccessFlagsObj().isPublic(); } | |
235 public boolean isPrivate() { return getAccessFlagsObj().isPrivate(); } | |
236 public boolean isProtected() { return getAccessFlagsObj().isProtected(); } | |
237 public boolean isPackagePrivate() { AccessFlags af = getAccessFlagsObj(); | |
238 return (!af.isPublic() && !af.isPrivate() && !af.isProtected()); } | |
239 public boolean isStatic() { return getAccessFlagsObj().isStatic(); } | |
240 public boolean isFinal() { return getAccessFlagsObj().isFinal(); } | |
241 public boolean isSynchronized() { return getAccessFlagsObj().isSynchronized(); } | |
242 public boolean isBridge() { return getAccessFlagsObj().isBridge(); } | |
243 public boolean isVarArgs() { return getAccessFlagsObj().isVarArgs(); } | |
244 public boolean isNative() { return getAccessFlagsObj().isNative(); } | |
245 public boolean isAbstract() { return getAccessFlagsObj().isAbstract(); } | |
246 public boolean isStrict() { return getAccessFlagsObj().isStrict(); } | |
247 public boolean isSynthetic() { return getAccessFlagsObj().isSynthetic(); } | |
248 | |
249 public boolean isConstructor() { | |
250 return (!isStatic()) && getName().equals(objectInitializerName()); | |
251 } | |
252 | |
253 public boolean isStaticInitializer() { | |
254 return isStatic() && getName().equals(classInitializerName()); | |
255 } | |
256 | |
257 public boolean isObsolete() { | |
258 return getAccessFlagsObj().isObsolete(); | |
259 } | |
260 | |
261 public OopMapCacheEntry getMaskFor(int bci) { | |
262 OopMapCacheEntry entry = new OopMapCacheEntry(); | |
263 entry.fill(this, bci); | |
264 return entry; | |
265 } | |
266 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
267 public long getSize() { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
268 return getMethodSize(); |
0 | 269 } |
270 | |
271 public void printValueOn(PrintStream tty) { | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
272 tty.print("Method " + getName().asString() + getSignature().asString() + "@" + getAddress()); |
0 | 273 } |
274 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
275 public void iterateFields(MetadataVisitor visitor) { |
0 | 276 visitor.doCInt(methodSize, true); |
277 visitor.doCInt(accessFlags, true); | |
278 } | |
279 | |
280 public boolean hasLineNumberTable() { | |
281 return getConstMethod().hasLineNumberTable(); | |
282 } | |
283 | |
284 public int getLineNumberFromBCI(int bci) { | |
285 return getConstMethod().getLineNumberFromBCI(bci); | |
286 } | |
287 | |
288 public LineNumberTableElement[] getLineNumberTable() { | |
289 return getConstMethod().getLineNumberTable(); | |
290 } | |
291 | |
292 public boolean hasLocalVariableTable() { | |
293 return getConstMethod().hasLocalVariableTable(); | |
294 } | |
295 | |
296 /** Should only be called if table is present */ | |
297 public LocalVariableTableElement[] getLocalVariableTable() { | |
298 return getConstMethod().getLocalVariableTable(); | |
299 } | |
300 | |
301 public Symbol getLocalVariableName(int bci, int slot) { | |
302 if (! hasLocalVariableTable()) { | |
303 return null; | |
304 } | |
305 | |
306 LocalVariableTableElement[] locals = getLocalVariableTable(); | |
307 for (int l = 0; l < locals.length; l++) { | |
308 LocalVariableTableElement local = locals[l]; | |
309 if ((bci >= local.getStartBCI()) && | |
310 (bci < (local.getStartBCI() + local.getLength())) && | |
311 slot == local.getSlot()) { | |
312 return getConstants().getSymbolAt(local.getNameCPIndex()); | |
313 } | |
314 } | |
315 | |
316 return null; | |
317 } | |
318 | |
6213
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
319 public boolean hasExceptionTable() { |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
320 return getConstMethod().hasExceptionTable(); |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
321 } |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
322 |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
323 public ExceptionTableElement[] getExceptionTable() { |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
324 return getConstMethod().getExceptionTable(); |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
325 } |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
326 |
0 | 327 public boolean hasCheckedExceptions() { |
328 return getConstMethod().hasCheckedExceptions(); | |
329 } | |
330 | |
331 /** Should only be called if table is present */ | |
332 public CheckedExceptionElement[] getCheckedExceptions() { | |
333 return getConstMethod().getCheckedExceptions(); | |
334 } | |
335 | |
336 /** Returns name and signature in external form for debugging | |
337 purposes */ | |
338 public String externalNameAndSignature() { | |
339 final StringBuffer buf = new StringBuffer(); | |
340 buf.append(getMethodHolder().getName().asString()); | |
341 buf.append("."); | |
342 buf.append(getName().asString()); | |
343 buf.append("("); | |
344 new SignatureConverter(getSignature(), buf).iterateParameters(); | |
345 buf.append(")"); | |
346 return buf.toString().replace('/', '.'); | |
347 } | |
6972
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
348 |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
349 public void dumpReplayData(PrintStream out) { |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
350 NMethod nm = getNativeMethod(); |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
351 int code_size = 0; |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
352 if (nm != null) { |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
353 code_size = (int)nm.codeEnd().minus(nm.getVerifiedEntryPoint()); |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
354 } |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
355 Klass holder = getMethodHolder(); |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
356 out.println("ciMethod " + |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
357 holder.getName().asString() + " " + |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
358 OopUtilities.escapeString(getName().asString()) + " " + |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
359 getSignature().asString() + " " + |
10257
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
360 getInvocationCount() + " " + |
cbfe859bd244
8013591: compiler/ciReplay/TestSA.sh fails in nightly
sla
parents:
10105
diff
changeset
|
361 getBackedgeCount() + " " + |
6972
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
362 interpreterInvocationCount() + " " + |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
363 interpreterThrowoutCount() + " " + |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
364 code_size); |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
365 } |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
366 |
3939 | 367 public int interpreterThrowoutCount() { |
10105
aeaca88565e6
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
7402
diff
changeset
|
368 return getMethodCounters().interpreterThrowoutCount(); |
3939 | 369 } |
370 | |
371 public int interpreterInvocationCount() { | |
10105
aeaca88565e6
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
7402
diff
changeset
|
372 return getMethodCounters().interpreterInvocationCount(); |
3939 | 373 } |
0 | 374 } |