Mercurial > hg > truffle
annotate agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java @ 1917:f42a2f0c16bb
6996563: 6984311 changes forgot to update vmStructs.cpp for new field _operands
Summary: Add missing line to vmStructs. Also fix bug with class dumper.
Reviewed-by: twisti, kvn
author | jrose |
---|---|
date | Fri, 05 Nov 2010 12:18:30 -0700 |
parents | 3e8fbc61cee8 |
children | 7588156f5cf9 |
rev | line source |
---|---|
0 | 1 /* |
1579 | 2 * Copyright (c) 2000, 2010, 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:
1040
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1040
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:
1040
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
25 package sun.jvm.hotspot.code; | |
26 | |
27 import java.io.*; | |
28 import java.util.*; | |
29 import sun.jvm.hotspot.debugger.*; | |
30 import sun.jvm.hotspot.memory.*; | |
31 import sun.jvm.hotspot.oops.*; | |
32 import sun.jvm.hotspot.runtime.*; | |
33 import sun.jvm.hotspot.types.*; | |
34 import sun.jvm.hotspot.utilities.*; | |
35 | |
36 public class NMethod extends CodeBlob { | |
37 private static long pcDescSize; | |
38 private static sun.jvm.hotspot.types.OopField methodField; | |
39 /** != InvocationEntryBci if this nmethod is an on-stack replacement method */ | |
40 private static CIntegerField entryBCIField; | |
41 /** To support simple linked-list chaining of nmethods */ | |
989
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
931
diff
changeset
|
42 private static AddressField osrLinkField; |
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
931
diff
changeset
|
43 private static AddressField scavengeRootLinkField; |
1040
873ec3787992
6892186: SA does not dump debug info for scalar replaced objects
kvn
parents:
989
diff
changeset
|
44 private static JByteField scavengeRootStateField; |
989
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
931
diff
changeset
|
45 |
0 | 46 /** Offsets for different nmethod parts */ |
47 private static CIntegerField exceptionOffsetField; | |
48 private static CIntegerField deoptOffsetField; | |
49 private static CIntegerField origPCOffsetField; | |
50 private static CIntegerField stubOffsetField; | |
1563
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
51 private static CIntegerField oopsOffsetField; |
0 | 52 private static CIntegerField scopesDataOffsetField; |
53 private static CIntegerField scopesPCsOffsetField; | |
54 private static CIntegerField dependenciesOffsetField; | |
55 private static CIntegerField handlerTableOffsetField; | |
56 private static CIntegerField nulChkTableOffsetField; | |
57 private static CIntegerField nmethodEndOffsetField; | |
58 | |
59 /** Offsets for entry points */ | |
60 /** Entry point with class check */ | |
61 private static AddressField entryPointField; | |
62 /** Entry point without class check */ | |
63 private static AddressField verifiedEntryPointField; | |
64 /** Entry point for on stack replacement */ | |
65 private static AddressField osrEntryPointField; | |
66 | |
67 // FIXME: add access to flags (how?) | |
68 | |
69 /** NMethod Flushing lock (if non-zero, then the nmethod is not removed) */ | |
70 private static JIntField lockCountField; | |
71 | |
72 /** not_entrant method removal. Each mark_sweep pass will update | |
73 this mark to current sweep invocation count if it is seen on the | |
74 stack. An not_entrant method can be removed when there is no | |
75 more activations, i.e., when the _stack_traversal_mark is less than | |
76 current sweep traversal index. */ | |
77 private static CIntegerField stackTraversalMarkField; | |
78 | |
79 static { | |
80 VM.registerVMInitializedObserver(new Observer() { | |
81 public void update(Observable o, Object data) { | |
82 initialize(VM.getVM().getTypeDataBase()); | |
83 } | |
84 }); | |
85 } | |
86 | |
87 private static void initialize(TypeDataBase db) { | |
88 Type type = db.lookupType("nmethod"); | |
89 | |
90 methodField = type.getOopField("_method"); | |
91 entryBCIField = type.getCIntegerField("_entry_bci"); | |
989
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
931
diff
changeset
|
92 osrLinkField = type.getAddressField("_osr_link"); |
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
931
diff
changeset
|
93 scavengeRootLinkField = type.getAddressField("_scavenge_root_link"); |
1040
873ec3787992
6892186: SA does not dump debug info for scalar replaced objects
kvn
parents:
989
diff
changeset
|
94 scavengeRootStateField = type.getJByteField("_scavenge_root_state"); |
989
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
931
diff
changeset
|
95 |
0 | 96 exceptionOffsetField = type.getCIntegerField("_exception_offset"); |
97 deoptOffsetField = type.getCIntegerField("_deoptimize_offset"); | |
98 origPCOffsetField = type.getCIntegerField("_orig_pc_offset"); | |
99 stubOffsetField = type.getCIntegerField("_stub_offset"); | |
1563
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
100 oopsOffsetField = type.getCIntegerField("_oops_offset"); |
0 | 101 scopesDataOffsetField = type.getCIntegerField("_scopes_data_offset"); |
102 scopesPCsOffsetField = type.getCIntegerField("_scopes_pcs_offset"); | |
103 dependenciesOffsetField = type.getCIntegerField("_dependencies_offset"); | |
104 handlerTableOffsetField = type.getCIntegerField("_handler_table_offset"); | |
105 nulChkTableOffsetField = type.getCIntegerField("_nul_chk_table_offset"); | |
106 nmethodEndOffsetField = type.getCIntegerField("_nmethod_end_offset"); | |
107 entryPointField = type.getAddressField("_entry_point"); | |
108 verifiedEntryPointField = type.getAddressField("_verified_entry_point"); | |
109 osrEntryPointField = type.getAddressField("_osr_entry_point"); | |
110 lockCountField = type.getJIntField("_lock_count"); | |
111 stackTraversalMarkField = type.getCIntegerField("_stack_traversal_mark"); | |
112 | |
113 pcDescSize = db.lookupType("PcDesc").getSize(); | |
114 } | |
115 | |
116 public NMethod(Address addr) { | |
117 super(addr); | |
118 } | |
119 | |
120 | |
121 // Accessors | |
122 public Address getAddress() { | |
123 return addr; | |
124 } | |
125 | |
126 public Method getMethod() { | |
127 return (Method) VM.getVM().getObjectHeap().newOop(methodField.getValue(addr)); | |
128 } | |
129 | |
130 // Type info | |
131 public boolean isNMethod() { return true; } | |
132 public boolean isJavaMethod() { return !getMethod().isNative(); } | |
133 public boolean isNativeMethod() { return getMethod().isNative(); } | |
134 public boolean isOSRMethod() { return getEntryBCI() != VM.getVM().getInvocationEntryBCI(); } | |
135 | |
136 /** Boundaries for different parts */ | |
1748 | 137 public Address constantsBegin() { return contentBegin(); } |
0 | 138 public Address constantsEnd() { return getEntryPoint(); } |
1748 | 139 public Address instsBegin() { return codeBegin(); } |
140 public Address instsEnd() { return headerBegin().addOffsetTo(getStubOffset()); } | |
0 | 141 public Address exceptionBegin() { return headerBegin().addOffsetTo(getExceptionOffset()); } |
142 public Address deoptBegin() { return headerBegin().addOffsetTo(getDeoptOffset()); } | |
143 public Address stubBegin() { return headerBegin().addOffsetTo(getStubOffset()); } | |
1563
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
144 public Address stubEnd() { return headerBegin().addOffsetTo(getOopsOffset()); } |
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
145 public Address oopsBegin() { return headerBegin().addOffsetTo(getOopsOffset()); } |
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
146 public Address oopsEnd() { return headerBegin().addOffsetTo(getScopesDataOffset()); } |
0 | 147 public Address scopesDataBegin() { return headerBegin().addOffsetTo(getScopesDataOffset()); } |
148 public Address scopesDataEnd() { return headerBegin().addOffsetTo(getScopesPCsOffset()); } | |
149 public Address scopesPCsBegin() { return headerBegin().addOffsetTo(getScopesPCsOffset()); } | |
150 public Address scopesPCsEnd() { return headerBegin().addOffsetTo(getDependenciesOffset()); } | |
151 public Address dependenciesBegin() { return headerBegin().addOffsetTo(getDependenciesOffset()); } | |
152 public Address dependenciesEnd() { return headerBegin().addOffsetTo(getHandlerTableOffset()); } | |
153 public Address handlerTableBegin() { return headerBegin().addOffsetTo(getHandlerTableOffset()); } | |
154 public Address handlerTableEnd() { return headerBegin().addOffsetTo(getNulChkTableOffset()); } | |
155 public Address nulChkTableBegin() { return headerBegin().addOffsetTo(getNulChkTableOffset()); } | |
156 public Address nulChkTableEnd() { return headerBegin().addOffsetTo(getNMethodEndOffset()); } | |
157 | |
158 public int constantsSize() { return (int) constantsEnd() .minus(constantsBegin()); } | |
1748 | 159 public int instsSize() { return (int) instsEnd() .minus(instsBegin()); } |
0 | 160 public int stubSize() { return (int) stubEnd() .minus(stubBegin()); } |
1563
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
161 public int oopsSize() { return (int) oopsEnd() .minus(oopsBegin()); } |
0 | 162 public int scopesDataSize() { return (int) scopesDataEnd() .minus(scopesDataBegin()); } |
163 public int scopesPCsSize() { return (int) scopesPCsEnd() .minus(scopesPCsBegin()); } | |
164 public int dependenciesSize() { return (int) dependenciesEnd().minus(dependenciesBegin()); } | |
165 public int handlerTableSize() { return (int) handlerTableEnd().minus(handlerTableBegin()); } | |
166 public int nulChkTableSize() { return (int) nulChkTableEnd() .minus(nulChkTableBegin()); } | |
167 public int origPCOffset() { return (int) origPCOffsetField.getValue(addr); } | |
168 | |
169 public int totalSize() { | |
170 return | |
171 constantsSize() + | |
1748 | 172 instsSize() + |
0 | 173 stubSize() + |
174 scopesDataSize() + | |
175 scopesPCsSize() + | |
176 dependenciesSize() + | |
177 handlerTableSize() + | |
178 nulChkTableSize(); | |
179 } | |
180 | |
181 public boolean constantsContains (Address addr) { return constantsBegin() .lessThanOrEqual(addr) && constantsEnd() .greaterThan(addr); } | |
1748 | 182 public boolean instsContains (Address addr) { return instsBegin() .lessThanOrEqual(addr) && instsEnd() .greaterThan(addr); } |
0 | 183 public boolean stubContains (Address addr) { return stubBegin() .lessThanOrEqual(addr) && stubEnd() .greaterThan(addr); } |
1563
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
184 public boolean oopsContains (Address addr) { return oopsBegin() .lessThanOrEqual(addr) && oopsEnd() .greaterThan(addr); } |
0 | 185 public boolean scopesDataContains (Address addr) { return scopesDataBegin() .lessThanOrEqual(addr) && scopesDataEnd() .greaterThan(addr); } |
186 public boolean scopesPCsContains (Address addr) { return scopesPCsBegin() .lessThanOrEqual(addr) && scopesPCsEnd() .greaterThan(addr); } | |
187 public boolean handlerTableContains(Address addr) { return handlerTableBegin().lessThanOrEqual(addr) && handlerTableEnd().greaterThan(addr); } | |
188 public boolean nulChkTableContains (Address addr) { return nulChkTableBegin() .lessThanOrEqual(addr) && nulChkTableEnd() .greaterThan(addr); } | |
189 | |
190 /** Entry points */ | |
191 public Address getEntryPoint() { return entryPointField.getValue(addr); } | |
192 public Address getVerifiedEntryPoint() { return verifiedEntryPointField.getValue(addr); } | |
193 | |
1563
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
194 /** Support for oops in scopes and relocs. Note: index 0 is reserved for null. */ |
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
195 public OopHandle getOopAt(int index) { |
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
196 if (index == 0) return null; |
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
197 if (Assert.ASSERTS_ENABLED) { |
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
198 Assert.that(index > 0 && index <= oopsSize(), "must be a valid non-zero index"); |
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
199 } |
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
200 return oopsBegin().getOopHandleAt((index - 1) * VM.getVM().getOopSize()); |
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
201 } |
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
202 |
0 | 203 // FIXME: add interpreter_entry_point() |
204 // FIXME: add lazy_interpreter_entry_point() for C2 | |
205 | |
206 // ********** | |
207 // * FIXME: * ADD ACCESS TO FLAGS!!!! | |
208 // ********** | |
209 // public boolean isInUse(); | |
210 // public boolean isAlive(); | |
211 // public boolean isNotEntrant(); | |
212 // public boolean isZombie(); | |
213 | |
214 // ******************************** | |
215 // * MAJOR FIXME: MAJOR HACK HERE * | |
216 // ******************************** | |
217 public boolean isZombie() { return false; } | |
218 | |
219 // public boolean isUnloaded(); | |
220 // public boolean isYoung(); | |
221 // public boolean isOld(); | |
222 // public int age(); | |
223 // public boolean isMarkedForDeoptimization(); | |
224 // public boolean isMarkedForUnloading(); | |
225 // public boolean isMarkedForReclamation(); | |
226 // public int level(); | |
227 // public int version(); | |
228 | |
229 // FIXME: add mutators for above | |
230 // FIXME: add exception cache access? | |
231 | |
232 /** On-stack replacement support */ | |
233 // FIXME: add mutators | |
234 public int getOSREntryBCI() { | |
235 if (Assert.ASSERTS_ENABLED) { | |
236 Assert.that(getEntryBCI() != VM.getVM().getInvocationEntryBCI(), "wrong kind of nmethod"); | |
237 } | |
238 return getEntryBCI(); | |
239 } | |
240 | |
989
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
931
diff
changeset
|
241 public NMethod getOSRLink() { |
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
931
diff
changeset
|
242 return (NMethod) VMObjectFactory.newObject(NMethod.class, osrLinkField.getValue(addr)); |
0 | 243 } |
244 | |
989
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
931
diff
changeset
|
245 public NMethod getScavengeRootLink() { |
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
931
diff
changeset
|
246 return (NMethod) VMObjectFactory.newObject(NMethod.class, scavengeRootLinkField.getValue(addr)); |
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
931
diff
changeset
|
247 } |
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
931
diff
changeset
|
248 |
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
931
diff
changeset
|
249 public int getScavengeRootState() { |
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
931
diff
changeset
|
250 return (int) scavengeRootStateField.getValue(addr); |
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
931
diff
changeset
|
251 } |
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
931
diff
changeset
|
252 |
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
931
diff
changeset
|
253 |
0 | 254 /** Tells whether frames described by this nmethod can be |
255 deoptimized. Note: native wrappers cannot be deoptimized. */ | |
256 public boolean canBeDeoptimized() { return isJavaMethod(); } | |
257 | |
258 // FIXME: add inline cache support | |
259 // FIXME: add flush() | |
260 | |
261 public boolean isLockedByVM() { return lockCountField.getValue(addr) > 0; } | |
262 | |
263 // FIXME: add mark_as_seen_on_stack | |
264 // FIXME: add can_not_entrant_be_converted | |
265 | |
266 // FIXME: add GC support | |
267 // void follow_roots_or_mark_for_unloading(bool unloading_occurred, bool& marked_for_unloading); | |
268 // void follow_root_or_mark_for_unloading(oop* root, bool unloading_occurred, bool& marked_for_unloading); | |
269 // void preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, void f(oop*)); | |
270 // void adjust_pointers(); | |
271 | |
272 /** Finds a PCDesc with real-pc equal to "pc" */ | |
273 public PCDesc getPCDescAt(Address pc) { | |
274 // FIXME: consider adding cache like the one down in the VM | |
275 for (Address p = scopesPCsBegin(); p.lessThan(scopesPCsEnd()); p = p.addOffsetTo(pcDescSize)) { | |
276 PCDesc pcDesc = new PCDesc(p); | |
277 if (pcDesc.getRealPC(this).equals(pc)) { | |
278 return pcDesc; | |
279 } | |
280 } | |
281 return null; | |
282 } | |
283 | |
284 /** ScopeDesc for an instruction */ | |
285 public ScopeDesc getScopeDescAt(Address pc) { | |
286 PCDesc pd = getPCDescAt(pc); | |
287 if (Assert.ASSERTS_ENABLED) { | |
288 Assert.that(pd != null, "scope must be present"); | |
289 } | |
1040
873ec3787992
6892186: SA does not dump debug info for scalar replaced objects
kvn
parents:
989
diff
changeset
|
290 return new ScopeDesc(this, pd.getScopeDecodeOffset(), pd.getObjDecodeOffset(), pd.getReexecute()); |
0 | 291 } |
292 | |
293 /** This is only for use by the debugging system, and is only | |
294 intended for use in the topmost frame, where we are not | |
295 guaranteed to be at a PC for which we have a PCDesc. It finds | |
296 the PCDesc with realPC closest to the current PC. */ | |
297 public PCDesc getPCDescNearDbg(Address pc) { | |
298 PCDesc bestGuessPCDesc = null; | |
299 long bestDistance = 0; | |
300 for (Address p = scopesPCsBegin(); p.lessThan(scopesPCsEnd()); p = p.addOffsetTo(pcDescSize)) { | |
301 PCDesc pcDesc = new PCDesc(p); | |
302 // In case pc is null | |
303 long distance = -pcDesc.getRealPC(this).minus(pc); | |
304 if ((bestGuessPCDesc == null) || | |
305 ((distance >= 0) && (distance < bestDistance))) { | |
306 bestGuessPCDesc = pcDesc; | |
307 bestDistance = distance; | |
308 } | |
309 } | |
310 return bestGuessPCDesc; | |
311 } | |
312 | |
313 /** This is only for use by the debugging system, and is only | |
314 intended for use in the topmost frame, where we are not | |
315 guaranteed to be at a PC for which we have a PCDesc. It finds | |
316 the ScopeDesc closest to the current PC. NOTE that this may | |
317 return NULL for compiled methods which don't have any | |
318 ScopeDescs! */ | |
319 public ScopeDesc getScopeDescNearDbg(Address pc) { | |
320 PCDesc pd = getPCDescNearDbg(pc); | |
321 if (pd == null) return null; | |
1040
873ec3787992
6892186: SA does not dump debug info for scalar replaced objects
kvn
parents:
989
diff
changeset
|
322 return new ScopeDesc(this, pd.getScopeDecodeOffset(), pd.getObjDecodeOffset(), pd.getReexecute()); |
0 | 323 } |
324 | |
1040
873ec3787992
6892186: SA does not dump debug info for scalar replaced objects
kvn
parents:
989
diff
changeset
|
325 public Map/*<Address, PCDesc>*/ getSafepoints() { |
873ec3787992
6892186: SA does not dump debug info for scalar replaced objects
kvn
parents:
989
diff
changeset
|
326 Map safepoints = new HashMap(); // Map<Address, PCDesc> |
0 | 327 sun.jvm.hotspot.debugger.Address p = null; |
328 for (p = scopesPCsBegin(); p.lessThan(scopesPCsEnd()); | |
329 p = p.addOffsetTo(pcDescSize)) { | |
330 PCDesc pcDesc = new PCDesc(p); | |
331 sun.jvm.hotspot.debugger.Address pc = pcDesc.getRealPC(this); | |
332 safepoints.put(pc, pcDesc); | |
333 } | |
334 return safepoints; | |
335 } | |
336 | |
337 // FIXME: add getPCOffsetForBCI() | |
338 // FIXME: add embeddedOopAt() | |
339 // FIXME: add isDependentOn() | |
340 // FIXME: add isPatchableAt() | |
341 | |
342 /** Support for code generation. Only here for proof-of-concept. */ | |
343 public static int getEntryPointOffset() { return (int) entryPointField.getOffset(); } | |
344 public static int getVerifiedEntryPointOffset() { return (int) verifiedEntryPointField.getOffset(); } | |
345 public static int getOSREntryPointOffset() { return (int) osrEntryPointField.getOffset(); } | |
346 public static int getEntryBCIOffset() { return (int) entryBCIField.getOffset(); } | |
347 /** NOTE: renamed from "method_offset_in_bytes" */ | |
348 public static int getMethodOffset() { return (int) methodField.getOffset(); } | |
349 | |
350 public void print() { | |
351 printOn(System.out); | |
352 } | |
353 | |
1563
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
354 protected void printComponentsOn(PrintStream tty) { |
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
355 // FIXME: add relocation information |
1748 | 356 tty.println(" content: [" + contentBegin() + ", " + contentEnd() + "), " + |
357 " code: [" + codeBegin() + ", " + codeEnd() + "), " + | |
1563
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
358 " data: [" + dataBegin() + ", " + dataEnd() + "), " + |
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
359 " oops: [" + oopsBegin() + ", " + oopsEnd() + "), " + |
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
360 " frame size: " + getFrameSize()); |
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
361 } |
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
362 |
0 | 363 public String toString() { |
364 Method method = getMethod(); | |
365 return "NMethod for " + | |
366 method.getMethodHolder().getName().asString() + "." + | |
367 method.getName().asString() + method.getSignature().asString() + "==>n" + | |
368 super.toString(); | |
369 } | |
370 | |
371 public String flagsToString() { | |
372 // FIXME need access to flags... | |
373 return ""; | |
374 } | |
375 | |
376 public String getName() { | |
377 Method method = getMethod(); | |
378 return "NMethod for " + | |
379 method.getMethodHolder().getName().asString() + "." + | |
380 method.getName().asString() + | |
381 method.getSignature().asString(); | |
382 } | |
383 | |
384 //-------------------------------------------------------------------------------- | |
385 // Internals only below this point | |
386 // | |
387 | |
388 private int getEntryBCI() { return (int) entryBCIField .getValue(addr); } | |
389 private int getExceptionOffset() { return (int) exceptionOffsetField .getValue(addr); } | |
390 private int getDeoptOffset() { return (int) deoptOffsetField .getValue(addr); } | |
391 private int getStubOffset() { return (int) stubOffsetField .getValue(addr); } | |
1563
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
1040
diff
changeset
|
392 private int getOopsOffset() { return (int) oopsOffsetField .getValue(addr); } |
0 | 393 private int getScopesDataOffset() { return (int) scopesDataOffsetField .getValue(addr); } |
394 private int getScopesPCsOffset() { return (int) scopesPCsOffsetField .getValue(addr); } | |
395 private int getDependenciesOffset() { return (int) dependenciesOffsetField.getValue(addr); } | |
396 private int getHandlerTableOffset() { return (int) handlerTableOffsetField.getValue(addr); } | |
397 private int getNulChkTableOffset() { return (int) nulChkTableOffsetField .getValue(addr); } | |
398 private int getNMethodEndOffset() { return (int) nmethodEndOffsetField .getValue(addr); } | |
399 } |