Mercurial > hg > truffle
annotate agent/src/share/classes/sun/jvm/hotspot/oops/Method.java @ 6972:bd7a7ce2e264
6830717: replay of compilations would help with debugging
Summary: When java process crashed in compiler thread, repeat the compilation process will help finding root cause. This is done with using SA dump application class data and replay data from core dump, then use debug version of jvm to recompile the problematic java method.
Reviewed-by: kvn, twisti, sspitsyn
Contributed-by: yumin.qi@oracle.com
author | minqi |
---|---|
date | Mon, 12 Nov 2012 14:03:53 -0800 |
parents | 18fb7da42534 |
children | b2dbd323c668 |
rev | line source |
---|---|
0 | 1 /* |
6123
2fe087c3e814
7172967: Eliminate constMethod's _method backpointer to methodOop.
jiangli
parents:
3939
diff
changeset
|
2 * Copyright (c) 2000, 2012, 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 | |
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 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
39 public class Method extends Metadata { |
0 | 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 { | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
49 Type type = db.lookupType("Method"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
50 constMethod = type.getAddressField("_constMethod"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
51 methodData = type.getAddressField("_method_data"); |
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); | |
55 sizeOfParameters = new CIntField(type.getCIntegerField("_size_of_parameters"), 0); | |
56 accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0); | |
57 code = type.getAddressField("_code"); | |
58 vtableIndex = new CIntField(type.getCIntegerField("_vtable_index"), 0); | |
59 if (!VM.getVM().isCore()) { | |
60 invocationCounter = new CIntField(type.getCIntegerField("_invocation_counter"), 0); | |
3939 | 61 backedgeCounter = new CIntField(type.getCIntegerField("_backedge_counter"), 0); |
0 | 62 } |
63 bytecodeOffset = type.getSize(); | |
64 | |
3939 | 65 interpreterThrowoutCountField = new CIntField(type.getCIntegerField("_interpreter_throwout_count"), 0); |
66 interpreterInvocationCountField = new CIntField(type.getCIntegerField("_interpreter_invocation_count"), 0); | |
67 | |
0 | 68 /* |
69 interpreterEntry = type.getAddressField("_interpreter_entry"); | |
70 fromCompiledCodeEntryPoint = type.getAddressField("_from_compiled_code_entry_point"); | |
71 | |
72 */ | |
73 objectInitializerName = null; | |
74 classInitializerName = null; | |
75 } | |
76 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
77 public Method(Address addr) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
78 super(addr); |
0 | 79 } |
80 | |
81 public boolean isMethod() { return true; } | |
82 | |
83 // Fields | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
84 private static AddressField constMethod; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
85 private static AddressField methodData; |
0 | 86 private static CIntField methodSize; |
87 private static CIntField maxStack; | |
88 private static CIntField maxLocals; | |
89 private static CIntField sizeOfParameters; | |
90 private static CIntField accessFlags; | |
91 private static CIntField vtableIndex; | |
92 private static CIntField invocationCounter; | |
3939 | 93 private static CIntField backedgeCounter; |
0 | 94 private static long bytecodeOffset; |
95 | |
96 private static AddressField code; | |
97 | |
3939 | 98 private static CIntField interpreterThrowoutCountField; |
99 private static CIntField interpreterInvocationCountField; | |
100 | |
0 | 101 // constant method names - <init>, <clinit> |
102 // Initialized lazily to avoid initialization ordering dependencies between Method and SymbolTable | |
103 private static Symbol objectInitializerName; | |
104 private static Symbol classInitializerName; | |
105 private static Symbol objectInitializerName() { | |
106 if (objectInitializerName == null) { | |
107 objectInitializerName = VM.getVM().getSymbolTable().probe("<init>"); | |
108 } | |
109 return objectInitializerName; | |
110 } | |
111 private static Symbol classInitializerName() { | |
112 if (classInitializerName == null) { | |
113 classInitializerName = VM.getVM().getSymbolTable().probe("<clinit>"); | |
114 } | |
115 return classInitializerName; | |
116 } | |
117 | |
118 | |
119 /* | |
120 private static AddressCField interpreterEntry; | |
121 private static AddressCField fromCompiledCodeEntryPoint; | |
122 */ | |
123 | |
124 // Accessors for declared fields | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
125 public ConstMethod getConstMethod() { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
126 Address addr = constMethod.getValue(getAddress()); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
127 return (ConstMethod) VMObjectFactory.newObject(ConstMethod.class, addr); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
128 } |
6123
2fe087c3e814
7172967: Eliminate constMethod's _method backpointer to methodOop.
jiangli
parents:
3939
diff
changeset
|
129 public ConstantPool getConstants() { |
2fe087c3e814
7172967: Eliminate constMethod's _method backpointer to methodOop.
jiangli
parents:
3939
diff
changeset
|
130 return getConstMethod().getConstants(); |
2fe087c3e814
7172967: Eliminate constMethod's _method backpointer to methodOop.
jiangli
parents:
3939
diff
changeset
|
131 } |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
132 public MethodData getMethodData() { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
133 Address addr = methodData.getValue(getAddress()); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
134 return (MethodData) VMObjectFactory.newObject(MethodData.class, addr); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
135 } |
0 | 136 /** WARNING: this is in words, not useful in this system; use getObjectSize() instead */ |
137 public long getMethodSize() { return methodSize.getValue(this); } | |
138 public long getMaxStack() { return maxStack.getValue(this); } | |
139 public long getMaxLocals() { return maxLocals.getValue(this); } | |
140 public long getSizeOfParameters() { return sizeOfParameters.getValue(this); } | |
141 public long getNameIndex() { return getConstMethod().getNameIndex(); } | |
142 public long getSignatureIndex() { return getConstMethod().getSignatureIndex(); } | |
143 public long getGenericSignatureIndex() { return getConstMethod().getGenericSignatureIndex(); } | |
144 public long getAccessFlags() { return accessFlags.getValue(this); } | |
145 public long getCodeSize() { return getConstMethod().getCodeSize(); } | |
146 public long getVtableIndex() { return vtableIndex.getValue(this); } | |
147 public long getInvocationCounter() { | |
148 if (Assert.ASSERTS_ENABLED) { | |
149 Assert.that(!VM.getVM().isCore(), "must not be used in core build"); | |
150 } | |
151 return invocationCounter.getValue(this); | |
152 } | |
3939 | 153 public long getBackedgeCounter() { |
154 if (Assert.ASSERTS_ENABLED) { | |
155 Assert.that(!VM.getVM().isCore(), "must not be used in core build"); | |
156 } | |
157 return backedgeCounter.getValue(this); | |
158 } | |
0 | 159 |
160 // get associated compiled native method, if available, else return null. | |
161 public NMethod getNativeMethod() { | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
162 Address addr = code.getValue(getAddress()); |
0 | 163 return (NMethod) VMObjectFactory.newObject(NMethod.class, addr); |
164 } | |
165 | |
166 // Convenience routine | |
167 public AccessFlags getAccessFlagsObj() { | |
168 return new AccessFlags(getAccessFlags()); | |
169 } | |
170 | |
171 /** Get a bytecode or breakpoint at the given bci */ | |
172 public int getBytecodeOrBPAt(int bci) { | |
173 return getConstMethod().getBytecodeOrBPAt(bci); | |
174 } | |
175 | |
176 /** Fetch the original non-breakpoint bytecode at the specified | |
177 bci. It is required that there is currently a bytecode at this | |
178 bci. */ | |
179 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
|
180 BreakpointInfo bp = getMethodHolder().getBreakpoints(); |
0 | 181 for (; bp != null; bp = bp.getNext()) { |
182 if (bp.match(this, bci)) { | |
183 return bp.getOrigBytecode(); | |
184 } | |
185 } | |
186 System.err.println("Requested bci " + bci); | |
187 for (; bp != null; bp = bp.getNext()) { | |
188 System.err.println("Breakpoint at bci " + bp.getBCI() + ", bytecode " + | |
189 bp.getOrigBytecode()); | |
190 } | |
191 Assert.that(false, "Should not reach here"); | |
192 return -1; // not reached | |
193 } | |
194 | |
195 public byte getBytecodeByteArg(int bci) { | |
196 return getConstMethod().getBytecodeByteArg(bci); | |
197 } | |
198 | |
199 /** Fetches a 16-bit big-endian ("Java ordered") value from the | |
200 bytecode stream */ | |
201 public short getBytecodeShortArg(int bci) { | |
202 return getConstMethod().getBytecodeShortArg(bci); | |
203 } | |
204 | |
3838
6a991dcb52bb
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
2426
diff
changeset
|
205 /** 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
|
206 bytecode stream */ |
6a991dcb52bb
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
2426
diff
changeset
|
207 public short getNativeShortArg(int bci) { |
6a991dcb52bb
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
2426
diff
changeset
|
208 return getConstMethod().getNativeShortArg(bci); |
6a991dcb52bb
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
2426
diff
changeset
|
209 } |
6a991dcb52bb
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
2426
diff
changeset
|
210 |
0 | 211 /** Fetches a 32-bit big-endian ("Java ordered") value from the |
212 bytecode stream */ | |
213 public int getBytecodeIntArg(int bci) { | |
214 return getConstMethod().getBytecodeIntArg(bci); | |
215 } | |
216 | |
3838
6a991dcb52bb
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
2426
diff
changeset
|
217 /** 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
|
218 bytecode stream */ |
6a991dcb52bb
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
2426
diff
changeset
|
219 public int getNativeIntArg(int bci) { |
6a991dcb52bb
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
2426
diff
changeset
|
220 return getConstMethod().getNativeIntArg(bci); |
6a991dcb52bb
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
2426
diff
changeset
|
221 } |
6a991dcb52bb
7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries
never
parents:
2426
diff
changeset
|
222 |
0 | 223 public byte[] getByteCode() { |
224 return getConstMethod().getByteCode(); | |
225 } | |
226 | |
227 /* | |
228 public Address getCode() { return codeField.getValue(this); } | |
229 public Address getInterpreterEntry() { return interpreterEntryField.getValue(this); } | |
230 public Address getFromCompiledCodeEntryPoint() { return fromCompiledCodeEntryPointField.getValue(this); } | |
231 */ | |
232 // Accessors | |
2177
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1552
diff
changeset
|
233 public Symbol getName() { return getConstants().getSymbolAt(getNameIndex()); } |
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1552
diff
changeset
|
234 public Symbol getSignature() { return getConstants().getSymbolAt(getSignatureIndex()); } |
0 | 235 public Symbol getGenericSignature() { |
236 long index = getGenericSignatureIndex(); | |
2177
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1552
diff
changeset
|
237 return (index != 0L) ? getConstants().getSymbolAt(index) : null; |
0 | 238 } |
239 | |
240 // 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
|
241 public InstanceKlass getMethodHolder() { return getConstants().getPoolHolder(); } |
0 | 242 |
243 // Access flags | |
244 public boolean isPublic() { return getAccessFlagsObj().isPublic(); } | |
245 public boolean isPrivate() { return getAccessFlagsObj().isPrivate(); } | |
246 public boolean isProtected() { return getAccessFlagsObj().isProtected(); } | |
247 public boolean isPackagePrivate() { AccessFlags af = getAccessFlagsObj(); | |
248 return (!af.isPublic() && !af.isPrivate() && !af.isProtected()); } | |
249 public boolean isStatic() { return getAccessFlagsObj().isStatic(); } | |
250 public boolean isFinal() { return getAccessFlagsObj().isFinal(); } | |
251 public boolean isSynchronized() { return getAccessFlagsObj().isSynchronized(); } | |
252 public boolean isBridge() { return getAccessFlagsObj().isBridge(); } | |
253 public boolean isVarArgs() { return getAccessFlagsObj().isVarArgs(); } | |
254 public boolean isNative() { return getAccessFlagsObj().isNative(); } | |
255 public boolean isAbstract() { return getAccessFlagsObj().isAbstract(); } | |
256 public boolean isStrict() { return getAccessFlagsObj().isStrict(); } | |
257 public boolean isSynthetic() { return getAccessFlagsObj().isSynthetic(); } | |
258 | |
259 public boolean isConstructor() { | |
260 return (!isStatic()) && getName().equals(objectInitializerName()); | |
261 } | |
262 | |
263 public boolean isStaticInitializer() { | |
264 return isStatic() && getName().equals(classInitializerName()); | |
265 } | |
266 | |
267 public boolean isObsolete() { | |
268 return getAccessFlagsObj().isObsolete(); | |
269 } | |
270 | |
271 public OopMapCacheEntry getMaskFor(int bci) { | |
272 OopMapCacheEntry entry = new OopMapCacheEntry(); | |
273 entry.fill(this, bci); | |
274 return entry; | |
275 } | |
276 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
277 public long getSize() { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
278 return getMethodSize(); |
0 | 279 } |
280 | |
281 public void printValueOn(PrintStream tty) { | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
282 tty.print("Method " + getName().asString() + getSignature().asString() + "@" + getAddress()); |
0 | 283 } |
284 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
285 public void iterateFields(MetadataVisitor visitor) { |
0 | 286 visitor.doCInt(methodSize, true); |
287 visitor.doCInt(maxStack, true); | |
288 visitor.doCInt(maxLocals, true); | |
289 visitor.doCInt(sizeOfParameters, true); | |
290 visitor.doCInt(accessFlags, true); | |
291 } | |
292 | |
293 public boolean hasLineNumberTable() { | |
294 return getConstMethod().hasLineNumberTable(); | |
295 } | |
296 | |
297 public int getLineNumberFromBCI(int bci) { | |
298 return getConstMethod().getLineNumberFromBCI(bci); | |
299 } | |
300 | |
301 public LineNumberTableElement[] getLineNumberTable() { | |
302 return getConstMethod().getLineNumberTable(); | |
303 } | |
304 | |
305 public boolean hasLocalVariableTable() { | |
306 return getConstMethod().hasLocalVariableTable(); | |
307 } | |
308 | |
309 /** Should only be called if table is present */ | |
310 public LocalVariableTableElement[] getLocalVariableTable() { | |
311 return getConstMethod().getLocalVariableTable(); | |
312 } | |
313 | |
314 public Symbol getLocalVariableName(int bci, int slot) { | |
315 if (! hasLocalVariableTable()) { | |
316 return null; | |
317 } | |
318 | |
319 LocalVariableTableElement[] locals = getLocalVariableTable(); | |
320 for (int l = 0; l < locals.length; l++) { | |
321 LocalVariableTableElement local = locals[l]; | |
322 if ((bci >= local.getStartBCI()) && | |
323 (bci < (local.getStartBCI() + local.getLength())) && | |
324 slot == local.getSlot()) { | |
325 return getConstants().getSymbolAt(local.getNameCPIndex()); | |
326 } | |
327 } | |
328 | |
329 return null; | |
330 } | |
331 | |
6213
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
332 public boolean hasExceptionTable() { |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
333 return getConstMethod().hasExceptionTable(); |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
334 } |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
335 |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
336 public ExceptionTableElement[] getExceptionTable() { |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
337 return getConstMethod().getExceptionTable(); |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
338 } |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
339 |
0 | 340 public boolean hasCheckedExceptions() { |
341 return getConstMethod().hasCheckedExceptions(); | |
342 } | |
343 | |
344 /** Should only be called if table is present */ | |
345 public CheckedExceptionElement[] getCheckedExceptions() { | |
346 return getConstMethod().getCheckedExceptions(); | |
347 } | |
348 | |
349 /** Returns name and signature in external form for debugging | |
350 purposes */ | |
351 public String externalNameAndSignature() { | |
352 final StringBuffer buf = new StringBuffer(); | |
353 buf.append(getMethodHolder().getName().asString()); | |
354 buf.append("."); | |
355 buf.append(getName().asString()); | |
356 buf.append("("); | |
357 new SignatureConverter(getSignature(), buf).iterateParameters(); | |
358 buf.append(")"); | |
359 return buf.toString().replace('/', '.'); | |
360 } | |
6972
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
361 |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
362 public void dumpReplayData(PrintStream out) { |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
363 NMethod nm = getNativeMethod(); |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
364 int code_size = 0; |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
365 if (nm != null) { |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
366 code_size = (int)nm.codeEnd().minus(nm.getVerifiedEntryPoint()); |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
367 } |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
368 Klass holder = getMethodHolder(); |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
369 out.println("ciMethod " + |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
370 holder.getName().asString() + " " + |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
371 OopUtilities.escapeString(getName().asString()) + " " + |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
372 getSignature().asString() + " " + |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
373 getInvocationCounter() + " " + |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
374 getBackedgeCounter() + " " + |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
375 interpreterInvocationCount() + " " + |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
376 interpreterThrowoutCount() + " " + |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
377 code_size); |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
378 } |
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6940
diff
changeset
|
379 |
3939 | 380 public int interpreterThrowoutCount() { |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
381 return (int) interpreterThrowoutCountField.getValue(this); |
3939 | 382 } |
383 | |
384 public int interpreterInvocationCount() { | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
385 return (int) interpreterInvocationCountField.getValue(this); |
3939 | 386 } |
0 | 387 } |