comparison agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java @ 989:148e5441d916

6863023: need non-perm oops in code cache for JSR 292 Summary: Make a special root-list for those few nmethods which might contain non-perm oops. Reviewed-by: twisti, kvn, never, jmasa, ysr
author jrose
date Tue, 15 Sep 2009 21:53:47 -0700
parents 72088be4b386
children 873ec3787992
comparison
equal deleted inserted replaced
987:00977607da34 989:148e5441d916
38 private static CIntegerField zombieInstructionSizeField; 38 private static CIntegerField zombieInstructionSizeField;
39 private static sun.jvm.hotspot.types.OopField methodField; 39 private static sun.jvm.hotspot.types.OopField methodField;
40 /** != InvocationEntryBci if this nmethod is an on-stack replacement method */ 40 /** != InvocationEntryBci if this nmethod is an on-stack replacement method */
41 private static CIntegerField entryBCIField; 41 private static CIntegerField entryBCIField;
42 /** To support simple linked-list chaining of nmethods */ 42 /** To support simple linked-list chaining of nmethods */
43 private static AddressField linkField; 43 private static AddressField osrLinkField;
44 private static AddressField scavengeRootLinkField;
45 private static CIntegerField scavengeRootStateField;
46
44 /** Offsets for different nmethod parts */ 47 /** Offsets for different nmethod parts */
45 private static CIntegerField exceptionOffsetField; 48 private static CIntegerField exceptionOffsetField;
46 private static CIntegerField deoptOffsetField; 49 private static CIntegerField deoptOffsetField;
47 private static CIntegerField origPCOffsetField; 50 private static CIntegerField origPCOffsetField;
48 private static CIntegerField stubOffsetField; 51 private static CIntegerField stubOffsetField;
85 Type type = db.lookupType("nmethod"); 88 Type type = db.lookupType("nmethod");
86 89
87 zombieInstructionSizeField = type.getCIntegerField("_zombie_instruction_size"); 90 zombieInstructionSizeField = type.getCIntegerField("_zombie_instruction_size");
88 methodField = type.getOopField("_method"); 91 methodField = type.getOopField("_method");
89 entryBCIField = type.getCIntegerField("_entry_bci"); 92 entryBCIField = type.getCIntegerField("_entry_bci");
90 linkField = type.getAddressField("_link"); 93 osrLinkField = type.getAddressField("_osr_link");
94 scavengeRootLinkField = type.getAddressField("_scavenge_root_link");
95 scavengeRootStateField = type.getCIntegerField("_scavenge_root_state");
96
91 exceptionOffsetField = type.getCIntegerField("_exception_offset"); 97 exceptionOffsetField = type.getCIntegerField("_exception_offset");
92 deoptOffsetField = type.getCIntegerField("_deoptimize_offset"); 98 deoptOffsetField = type.getCIntegerField("_deoptimize_offset");
93 origPCOffsetField = type.getCIntegerField("_orig_pc_offset"); 99 origPCOffsetField = type.getCIntegerField("_orig_pc_offset");
94 stubOffsetField = type.getCIntegerField("_stub_offset"); 100 stubOffsetField = type.getCIntegerField("_stub_offset");
95 scopesDataOffsetField = type.getCIntegerField("_scopes_data_offset"); 101 scopesDataOffsetField = type.getCIntegerField("_scopes_data_offset");
217 Assert.that(getEntryBCI() != VM.getVM().getInvocationEntryBCI(), "wrong kind of nmethod"); 223 Assert.that(getEntryBCI() != VM.getVM().getInvocationEntryBCI(), "wrong kind of nmethod");
218 } 224 }
219 return getEntryBCI(); 225 return getEntryBCI();
220 } 226 }
221 227
222 public NMethod getLink() { 228 public NMethod getOSRLink() {
223 return (NMethod) VMObjectFactory.newObject(NMethod.class, linkField.getValue(addr)); 229 return (NMethod) VMObjectFactory.newObject(NMethod.class, osrLinkField.getValue(addr));
224 } 230 }
231
232 public NMethod getScavengeRootLink() {
233 return (NMethod) VMObjectFactory.newObject(NMethod.class, scavengeRootLinkField.getValue(addr));
234 }
235
236 public int getScavengeRootState() {
237 return (int) scavengeRootStateField.getValue(addr);
238 }
239
225 240
226 /** Tells whether frames described by this nmethod can be 241 /** Tells whether frames described by this nmethod can be
227 deoptimized. Note: native wrappers cannot be deoptimized. */ 242 deoptimized. Note: native wrappers cannot be deoptimized. */
228 public boolean canBeDeoptimized() { return isJavaMethod(); } 243 public boolean canBeDeoptimized() { return isJavaMethod(); }
229 244