1 /*
2 * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved.
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 *
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
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 CIntegerField zombieInstructionSizeField;
39 private static sun.jvm.hotspot.types.OopField methodField;
40 /** != InvocationEntryBci if this nmethod is an on-stack replacement method */
41 private static CIntegerField entryBCIField;
42 /** To support simple linked-list chaining of nmethods */
43 private static AddressField osrLinkField;
44 private static AddressField scavengeRootLinkField;
45 private static JByteField scavengeRootStateField;
46
47 /** Offsets for different nmethod parts */
48 private static CIntegerField exceptionOffsetField;
49 private static CIntegerField deoptOffsetField;
50 private static CIntegerField origPCOffsetField;
51 private static CIntegerField stubOffsetField;
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
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 zombieInstructionSizeField = type.getCIntegerField("_zombie_instruction_size");
91 methodField = type.getOopField("_method");
92 entryBCIField = type.getCIntegerField("_entry_bci");
93 osrLinkField = type.getAddressField("_osr_link");
94 scavengeRootLinkField = type.getAddressField("_scavenge_root_link");
95 scavengeRootStateField = type.getJByteField("_scavenge_root_state");
96
97 exceptionOffsetField = type.getCIntegerField("_exception_offset");
98 deoptOffsetField = type.getCIntegerField("_deoptimize_offset");
99 origPCOffsetField = type.getCIntegerField("_orig_pc_offset");
100 stubOffsetField = type.getCIntegerField("_stub_offset");
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
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 */
137 public Address constantsBegin() { return instructionsBegin(); }
138 public Address constantsEnd() { return getEntryPoint(); }
139 public Address codeBegin() { return getEntryPoint(); }
140 public Address codeEnd() { return headerBegin().addOffsetTo(getStubOffset()); }
141 public Address exceptionBegin() { return headerBegin().addOffsetTo(getExceptionOffset()); }
142 public Address deoptBegin() { return headerBegin().addOffsetTo(getDeoptOffset()); }
143 public Address stubBegin() { return headerBegin().addOffsetTo(getStubOffset()); }
144 public Address stubEnd() { return headerBegin().addOffsetTo(getScopesDataOffset()); }
145 public Address scopesDataBegin() { return headerBegin().addOffsetTo(getScopesDataOffset()); }
146 public Address scopesDataEnd() { return headerBegin().addOffsetTo(getScopesPCsOffset()); }
147 public Address scopesPCsBegin() { return headerBegin().addOffsetTo(getScopesPCsOffset()); }
148 public Address scopesPCsEnd() { return headerBegin().addOffsetTo(getDependenciesOffset()); }
149 public Address dependenciesBegin() { return headerBegin().addOffsetTo(getDependenciesOffset()); }
150 public Address dependenciesEnd() { return headerBegin().addOffsetTo(getHandlerTableOffset()); }
151 public Address handlerTableBegin() { return headerBegin().addOffsetTo(getHandlerTableOffset()); }
152 public Address handlerTableEnd() { return headerBegin().addOffsetTo(getNulChkTableOffset()); }
153 public Address nulChkTableBegin() { return headerBegin().addOffsetTo(getNulChkTableOffset()); }
154 public Address nulChkTableEnd() { return headerBegin().addOffsetTo(getNMethodEndOffset()); }
155
156 public int constantsSize() { return (int) constantsEnd() .minus(constantsBegin()); }
157 public int codeSize() { return (int) codeEnd() .minus(codeBegin()); }
158 public int stubSize() { return (int) stubEnd() .minus(stubBegin()); }
159 public int scopesDataSize() { return (int) scopesDataEnd() .minus(scopesDataBegin()); }
160 public int scopesPCsSize() { return (int) scopesPCsEnd() .minus(scopesPCsBegin()); }
161 public int dependenciesSize() { return (int) dependenciesEnd().minus(dependenciesBegin()); }
162 public int handlerTableSize() { return (int) handlerTableEnd().minus(handlerTableBegin()); }
163 public int nulChkTableSize() { return (int) nulChkTableEnd() .minus(nulChkTableBegin()); }
164 public int origPCOffset() { return (int) origPCOffsetField.getValue(addr); }
165
166 public int totalSize() {
167 return
168 constantsSize() +
169 codeSize() +
170 stubSize() +
171 scopesDataSize() +
172 scopesPCsSize() +
173 dependenciesSize() +
174 handlerTableSize() +
175 nulChkTableSize();
176 }
177
178 public boolean constantsContains (Address addr) { return constantsBegin() .lessThanOrEqual(addr) && constantsEnd() .greaterThan(addr); }
179 public boolean codeContains (Address addr) { return codeBegin() .lessThanOrEqual(addr) && codeEnd() .greaterThan(addr); }
180 public boolean stubContains (Address addr) { return stubBegin() .lessThanOrEqual(addr) && stubEnd() .greaterThan(addr); }
181 public boolean scopesDataContains (Address addr) { return scopesDataBegin() .lessThanOrEqual(addr) && scopesDataEnd() .greaterThan(addr); }
182 public boolean scopesPCsContains (Address addr) { return scopesPCsBegin() .lessThanOrEqual(addr) && scopesPCsEnd() .greaterThan(addr); }
183 public boolean handlerTableContains(Address addr) { return handlerTableBegin().lessThanOrEqual(addr) && handlerTableEnd().greaterThan(addr); }
184 public boolean nulChkTableContains (Address addr) { return nulChkTableBegin() .lessThanOrEqual(addr) && nulChkTableEnd() .greaterThan(addr); }
185
186 /** Entry points */
187 public Address getEntryPoint() { return entryPointField.getValue(addr); }
188 public Address getVerifiedEntryPoint() { return verifiedEntryPointField.getValue(addr); }
189
190 // FIXME: add interpreter_entry_point()
191 // FIXME: add lazy_interpreter_entry_point() for C2
192
193 // **********
194 // * FIXME: * ADD ACCESS TO FLAGS!!!!
195 // **********
196 // public boolean isInUse();
197 // public boolean isAlive();
198 // public boolean isNotEntrant();
199 // public boolean isZombie();
200
201 // ********************************
202 // * MAJOR FIXME: MAJOR HACK HERE *
203 // ********************************
204 public boolean isZombie() { return false; }
205
206 // public boolean isUnloaded();
207 // public boolean isYoung();
208 // public boolean isOld();
209 // public int age();
321 return safepoints;
322 }
323
324 // FIXME: add getPCOffsetForBCI()
325 // FIXME: add embeddedOopAt()
326 // FIXME: add isDependentOn()
327 // FIXME: add isPatchableAt()
328
329 /** Support for code generation. Only here for proof-of-concept. */
330 public static int getEntryPointOffset() { return (int) entryPointField.getOffset(); }
331 public static int getVerifiedEntryPointOffset() { return (int) verifiedEntryPointField.getOffset(); }
332 public static int getOSREntryPointOffset() { return (int) osrEntryPointField.getOffset(); }
333 public static int getEntryBCIOffset() { return (int) entryBCIField.getOffset(); }
334 /** NOTE: renamed from "method_offset_in_bytes" */
335 public static int getMethodOffset() { return (int) methodField.getOffset(); }
336
337 public void print() {
338 printOn(System.out);
339 }
340
341 public String toString() {
342 Method method = getMethod();
343 return "NMethod for " +
344 method.getMethodHolder().getName().asString() + "." +
345 method.getName().asString() + method.getSignature().asString() + "==>n" +
346 super.toString();
347 }
348
349 public String flagsToString() {
350 // FIXME need access to flags...
351 return "";
352 }
353
354 public String getName() {
355 Method method = getMethod();
356 return "NMethod for " +
357 method.getMethodHolder().getName().asString() + "." +
358 method.getName().asString() +
359 method.getSignature().asString();
360 }
361
362 //--------------------------------------------------------------------------------
363 // Internals only below this point
364 //
365
366 private int getEntryBCI() { return (int) entryBCIField .getValue(addr); }
367 private int getExceptionOffset() { return (int) exceptionOffsetField .getValue(addr); }
368 private int getDeoptOffset() { return (int) deoptOffsetField .getValue(addr); }
369 private int getStubOffset() { return (int) stubOffsetField .getValue(addr); }
370 private int getScopesDataOffset() { return (int) scopesDataOffsetField .getValue(addr); }
371 private int getScopesPCsOffset() { return (int) scopesPCsOffsetField .getValue(addr); }
372 private int getDependenciesOffset() { return (int) dependenciesOffsetField.getValue(addr); }
373 private int getHandlerTableOffset() { return (int) handlerTableOffsetField.getValue(addr); }
374 private int getNulChkTableOffset() { return (int) nulChkTableOffsetField .getValue(addr); }
375 private int getNMethodEndOffset() { return (int) nmethodEndOffsetField .getValue(addr); }
376 }
|
1 /*
2 * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved.
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 *
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
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 CIntegerField zombieInstructionSizeField;
39 private static sun.jvm.hotspot.types.OopField methodField;
40 /** != InvocationEntryBci if this nmethod is an on-stack replacement method */
41 private static CIntegerField entryBCIField;
42 /** To support simple linked-list chaining of nmethods */
43 private static AddressField osrLinkField;
44 private static AddressField scavengeRootLinkField;
45 private static JByteField scavengeRootStateField;
46
47 /** Offsets for different nmethod parts */
48 private static CIntegerField exceptionOffsetField;
49 private static CIntegerField deoptOffsetField;
50 private static CIntegerField origPCOffsetField;
51 private static CIntegerField stubOffsetField;
52 private static CIntegerField oopsOffsetField;
53 private static CIntegerField scopesDataOffsetField;
54 private static CIntegerField scopesPCsOffsetField;
55 private static CIntegerField dependenciesOffsetField;
56 private static CIntegerField handlerTableOffsetField;
57 private static CIntegerField nulChkTableOffsetField;
58 private static CIntegerField nmethodEndOffsetField;
59
60 /** Offsets for entry points */
61 /** Entry point with class check */
62 private static AddressField entryPointField;
63 /** Entry point without class check */
64 private static AddressField verifiedEntryPointField;
65 /** Entry point for on stack replacement */
66 private static AddressField osrEntryPointField;
67
68 // FIXME: add access to flags (how?)
69
70 /** NMethod Flushing lock (if non-zero, then the nmethod is not removed) */
71 private static JIntField lockCountField;
72
82 public void update(Observable o, Object data) {
83 initialize(VM.getVM().getTypeDataBase());
84 }
85 });
86 }
87
88 private static void initialize(TypeDataBase db) {
89 Type type = db.lookupType("nmethod");
90
91 zombieInstructionSizeField = type.getCIntegerField("_zombie_instruction_size");
92 methodField = type.getOopField("_method");
93 entryBCIField = type.getCIntegerField("_entry_bci");
94 osrLinkField = type.getAddressField("_osr_link");
95 scavengeRootLinkField = type.getAddressField("_scavenge_root_link");
96 scavengeRootStateField = type.getJByteField("_scavenge_root_state");
97
98 exceptionOffsetField = type.getCIntegerField("_exception_offset");
99 deoptOffsetField = type.getCIntegerField("_deoptimize_offset");
100 origPCOffsetField = type.getCIntegerField("_orig_pc_offset");
101 stubOffsetField = type.getCIntegerField("_stub_offset");
102 oopsOffsetField = type.getCIntegerField("_oops_offset");
103 scopesDataOffsetField = type.getCIntegerField("_scopes_data_offset");
104 scopesPCsOffsetField = type.getCIntegerField("_scopes_pcs_offset");
105 dependenciesOffsetField = type.getCIntegerField("_dependencies_offset");
106 handlerTableOffsetField = type.getCIntegerField("_handler_table_offset");
107 nulChkTableOffsetField = type.getCIntegerField("_nul_chk_table_offset");
108 nmethodEndOffsetField = type.getCIntegerField("_nmethod_end_offset");
109 entryPointField = type.getAddressField("_entry_point");
110 verifiedEntryPointField = type.getAddressField("_verified_entry_point");
111 osrEntryPointField = type.getAddressField("_osr_entry_point");
112 lockCountField = type.getJIntField("_lock_count");
113 stackTraversalMarkField = type.getCIntegerField("_stack_traversal_mark");
114
115 pcDescSize = db.lookupType("PcDesc").getSize();
116 }
117
118 public NMethod(Address addr) {
119 super(addr);
120 }
121
122
126 }
127
128 public Method getMethod() {
129 return (Method) VM.getVM().getObjectHeap().newOop(methodField.getValue(addr));
130 }
131
132 // Type info
133 public boolean isNMethod() { return true; }
134 public boolean isJavaMethod() { return !getMethod().isNative(); }
135 public boolean isNativeMethod() { return getMethod().isNative(); }
136 public boolean isOSRMethod() { return getEntryBCI() != VM.getVM().getInvocationEntryBCI(); }
137
138 /** Boundaries for different parts */
139 public Address constantsBegin() { return instructionsBegin(); }
140 public Address constantsEnd() { return getEntryPoint(); }
141 public Address codeBegin() { return getEntryPoint(); }
142 public Address codeEnd() { return headerBegin().addOffsetTo(getStubOffset()); }
143 public Address exceptionBegin() { return headerBegin().addOffsetTo(getExceptionOffset()); }
144 public Address deoptBegin() { return headerBegin().addOffsetTo(getDeoptOffset()); }
145 public Address stubBegin() { return headerBegin().addOffsetTo(getStubOffset()); }
146 public Address stubEnd() { return headerBegin().addOffsetTo(getOopsOffset()); }
147 public Address oopsBegin() { return headerBegin().addOffsetTo(getOopsOffset()); }
148 public Address oopsEnd() { return headerBegin().addOffsetTo(getScopesDataOffset()); }
149 public Address scopesDataBegin() { return headerBegin().addOffsetTo(getScopesDataOffset()); }
150 public Address scopesDataEnd() { return headerBegin().addOffsetTo(getScopesPCsOffset()); }
151 public Address scopesPCsBegin() { return headerBegin().addOffsetTo(getScopesPCsOffset()); }
152 public Address scopesPCsEnd() { return headerBegin().addOffsetTo(getDependenciesOffset()); }
153 public Address dependenciesBegin() { return headerBegin().addOffsetTo(getDependenciesOffset()); }
154 public Address dependenciesEnd() { return headerBegin().addOffsetTo(getHandlerTableOffset()); }
155 public Address handlerTableBegin() { return headerBegin().addOffsetTo(getHandlerTableOffset()); }
156 public Address handlerTableEnd() { return headerBegin().addOffsetTo(getNulChkTableOffset()); }
157 public Address nulChkTableBegin() { return headerBegin().addOffsetTo(getNulChkTableOffset()); }
158 public Address nulChkTableEnd() { return headerBegin().addOffsetTo(getNMethodEndOffset()); }
159
160 public int constantsSize() { return (int) constantsEnd() .minus(constantsBegin()); }
161 public int codeSize() { return (int) codeEnd() .minus(codeBegin()); }
162 public int stubSize() { return (int) stubEnd() .minus(stubBegin()); }
163 public int oopsSize() { return (int) oopsEnd() .minus(oopsBegin()); }
164 public int scopesDataSize() { return (int) scopesDataEnd() .minus(scopesDataBegin()); }
165 public int scopesPCsSize() { return (int) scopesPCsEnd() .minus(scopesPCsBegin()); }
166 public int dependenciesSize() { return (int) dependenciesEnd().minus(dependenciesBegin()); }
167 public int handlerTableSize() { return (int) handlerTableEnd().minus(handlerTableBegin()); }
168 public int nulChkTableSize() { return (int) nulChkTableEnd() .minus(nulChkTableBegin()); }
169 public int origPCOffset() { return (int) origPCOffsetField.getValue(addr); }
170
171 public int totalSize() {
172 return
173 constantsSize() +
174 codeSize() +
175 stubSize() +
176 scopesDataSize() +
177 scopesPCsSize() +
178 dependenciesSize() +
179 handlerTableSize() +
180 nulChkTableSize();
181 }
182
183 public boolean constantsContains (Address addr) { return constantsBegin() .lessThanOrEqual(addr) && constantsEnd() .greaterThan(addr); }
184 public boolean codeContains (Address addr) { return codeBegin() .lessThanOrEqual(addr) && codeEnd() .greaterThan(addr); }
185 public boolean stubContains (Address addr) { return stubBegin() .lessThanOrEqual(addr) && stubEnd() .greaterThan(addr); }
186 public boolean oopsContains (Address addr) { return oopsBegin() .lessThanOrEqual(addr) && oopsEnd() .greaterThan(addr); }
187 public boolean scopesDataContains (Address addr) { return scopesDataBegin() .lessThanOrEqual(addr) && scopesDataEnd() .greaterThan(addr); }
188 public boolean scopesPCsContains (Address addr) { return scopesPCsBegin() .lessThanOrEqual(addr) && scopesPCsEnd() .greaterThan(addr); }
189 public boolean handlerTableContains(Address addr) { return handlerTableBegin().lessThanOrEqual(addr) && handlerTableEnd().greaterThan(addr); }
190 public boolean nulChkTableContains (Address addr) { return nulChkTableBegin() .lessThanOrEqual(addr) && nulChkTableEnd() .greaterThan(addr); }
191
192 /** Entry points */
193 public Address getEntryPoint() { return entryPointField.getValue(addr); }
194 public Address getVerifiedEntryPoint() { return verifiedEntryPointField.getValue(addr); }
195
196 /** Support for oops in scopes and relocs. Note: index 0 is reserved for null. */
197 public OopHandle getOopAt(int index) {
198 if (index == 0) return null;
199 if (Assert.ASSERTS_ENABLED) {
200 Assert.that(index > 0 && index <= oopsSize(), "must be a valid non-zero index");
201 }
202 return oopsBegin().getOopHandleAt((index - 1) * VM.getVM().getOopSize());
203 }
204
205 // FIXME: add interpreter_entry_point()
206 // FIXME: add lazy_interpreter_entry_point() for C2
207
208 // **********
209 // * FIXME: * ADD ACCESS TO FLAGS!!!!
210 // **********
211 // public boolean isInUse();
212 // public boolean isAlive();
213 // public boolean isNotEntrant();
214 // public boolean isZombie();
215
216 // ********************************
217 // * MAJOR FIXME: MAJOR HACK HERE *
218 // ********************************
219 public boolean isZombie() { return false; }
220
221 // public boolean isUnloaded();
222 // public boolean isYoung();
223 // public boolean isOld();
224 // public int age();
336 return safepoints;
337 }
338
339 // FIXME: add getPCOffsetForBCI()
340 // FIXME: add embeddedOopAt()
341 // FIXME: add isDependentOn()
342 // FIXME: add isPatchableAt()
343
344 /** Support for code generation. Only here for proof-of-concept. */
345 public static int getEntryPointOffset() { return (int) entryPointField.getOffset(); }
346 public static int getVerifiedEntryPointOffset() { return (int) verifiedEntryPointField.getOffset(); }
347 public static int getOSREntryPointOffset() { return (int) osrEntryPointField.getOffset(); }
348 public static int getEntryBCIOffset() { return (int) entryBCIField.getOffset(); }
349 /** NOTE: renamed from "method_offset_in_bytes" */
350 public static int getMethodOffset() { return (int) methodField.getOffset(); }
351
352 public void print() {
353 printOn(System.out);
354 }
355
356 protected void printComponentsOn(PrintStream tty) {
357 // FIXME: add relocation information
358 tty.println(" instructions: [" + instructionsBegin() + ", " + instructionsEnd() + "), " +
359 " data: [" + dataBegin() + ", " + dataEnd() + "), " +
360 " oops: [" + oopsBegin() + ", " + oopsEnd() + "), " +
361 " frame size: " + getFrameSize());
362 }
363
364 public String toString() {
365 Method method = getMethod();
366 return "NMethod for " +
367 method.getMethodHolder().getName().asString() + "." +
368 method.getName().asString() + method.getSignature().asString() + "==>n" +
369 super.toString();
370 }
371
372 public String flagsToString() {
373 // FIXME need access to flags...
374 return "";
375 }
376
377 public String getName() {
378 Method method = getMethod();
379 return "NMethod for " +
380 method.getMethodHolder().getName().asString() + "." +
381 method.getName().asString() +
382 method.getSignature().asString();
383 }
384
385 //--------------------------------------------------------------------------------
386 // Internals only below this point
387 //
388
389 private int getEntryBCI() { return (int) entryBCIField .getValue(addr); }
390 private int getExceptionOffset() { return (int) exceptionOffsetField .getValue(addr); }
391 private int getDeoptOffset() { return (int) deoptOffsetField .getValue(addr); }
392 private int getStubOffset() { return (int) stubOffsetField .getValue(addr); }
393 private int getOopsOffset() { return (int) oopsOffsetField .getValue(addr); }
394 private int getScopesDataOffset() { return (int) scopesDataOffsetField .getValue(addr); }
395 private int getScopesPCsOffset() { return (int) scopesPCsOffsetField .getValue(addr); }
396 private int getDependenciesOffset() { return (int) dependenciesOffsetField.getValue(addr); }
397 private int getHandlerTableOffset() { return (int) handlerTableOffsetField.getValue(addr); }
398 private int getNulChkTableOffset() { return (int) nulChkTableOffsetField .getValue(addr); }
399 private int getNMethodEndOffset() { return (int) nmethodEndOffsetField .getValue(addr); }
400 }
|