aboutsummaryrefslogtreecommitdiff
path: root/agent
diff options
context:
space:
mode:
authorjrose <none@none>2009-09-15 21:53:47 -0700
committerjrose <none@none>2009-09-15 21:53:47 -0700
commit1f74851d32708a8af114e72ad7f5a3f9732e1b38 (patch)
tree061d1a4710569eacae84ef937b80acaabe25f844 /agent
parent2c2ffa4ec1a4e1e82fe5569d333d8c1a80ad16b5 (diff)
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
Diffstat (limited to 'agent')
-rw-r--r--agent/src/share/classes/sun/jvm/hotspot/code/CodeCache.java6
-rw-r--r--agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java23
2 files changed, 25 insertions, 4 deletions
diff --git a/agent/src/share/classes/sun/jvm/hotspot/code/CodeCache.java b/agent/src/share/classes/sun/jvm/hotspot/code/CodeCache.java
index 570c5814e..9fc04f5df 100644
--- a/agent/src/share/classes/sun/jvm/hotspot/code/CodeCache.java
+++ b/agent/src/share/classes/sun/jvm/hotspot/code/CodeCache.java
@@ -33,6 +33,7 @@ import sun.jvm.hotspot.utilities.*;
public class CodeCache {
private static AddressField heapField;
+ private static AddressField scavengeRootNMethodsField;
private static VirtualConstructor virtualConstructor;
private CodeHeap heap;
@@ -49,6 +50,7 @@ public class CodeCache {
Type type = db.lookupType("CodeCache");
heapField = type.getAddressField("_heap");
+ scavengeRootNMethodsField = type.getAddressField("_scavenge_root_nmethods");
virtualConstructor = new VirtualConstructor(db);
// Add mappings for all possible CodeBlob subclasses
@@ -67,6 +69,10 @@ public class CodeCache {
heap = (CodeHeap) VMObjectFactory.newObject(CodeHeap.class, heapField.getValue());
}
+ public NMethod scavengeRootMethods() {
+ return (NMethod) VMObjectFactory.newObject(NMethod.class, scavengeRootNMethodsField.getValue());
+ }
+
public boolean contains(Address p) {
return getHeap().contains(p);
}
diff --git a/agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java b/agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java
index 36bcd0260..7f48d5807 100644
--- a/agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java
+++ b/agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java
@@ -40,7 +40,10 @@ public class NMethod extends CodeBlob {
/** != InvocationEntryBci if this nmethod is an on-stack replacement method */
private static CIntegerField entryBCIField;
/** To support simple linked-list chaining of nmethods */
- private static AddressField linkField;
+ private static AddressField osrLinkField;
+ private static AddressField scavengeRootLinkField;
+ private static CIntegerField scavengeRootStateField;
+
/** Offsets for different nmethod parts */
private static CIntegerField exceptionOffsetField;
private static CIntegerField deoptOffsetField;
@@ -87,7 +90,10 @@ public class NMethod extends CodeBlob {
zombieInstructionSizeField = type.getCIntegerField("_zombie_instruction_size");
methodField = type.getOopField("_method");
entryBCIField = type.getCIntegerField("_entry_bci");
- linkField = type.getAddressField("_link");
+ osrLinkField = type.getAddressField("_osr_link");
+ scavengeRootLinkField = type.getAddressField("_scavenge_root_link");
+ scavengeRootStateField = type.getCIntegerField("_scavenge_root_state");
+
exceptionOffsetField = type.getCIntegerField("_exception_offset");
deoptOffsetField = type.getCIntegerField("_deoptimize_offset");
origPCOffsetField = type.getCIntegerField("_orig_pc_offset");
@@ -219,10 +225,19 @@ public class NMethod extends CodeBlob {
return getEntryBCI();
}
- public NMethod getLink() {
- return (NMethod) VMObjectFactory.newObject(NMethod.class, linkField.getValue(addr));
+ public NMethod getOSRLink() {
+ return (NMethod) VMObjectFactory.newObject(NMethod.class, osrLinkField.getValue(addr));
+ }
+
+ public NMethod getScavengeRootLink() {
+ return (NMethod) VMObjectFactory.newObject(NMethod.class, scavengeRootLinkField.getValue(addr));
}
+ public int getScavengeRootState() {
+ return (int) scavengeRootStateField.getValue(addr);
+ }
+
+
/** Tells whether frames described by this nmethod can be
deoptimized. Note: native wrappers cannot be deoptimized. */
public boolean canBeDeoptimized() { return isJavaMethod(); }