aboutsummaryrefslogtreecommitdiff
path: root/agent
diff options
context:
space:
mode:
authorcfang <none@none>2009-07-31 17:12:33 -0700
committercfang <none@none>2009-07-31 17:12:33 -0700
commit75461d045b0701090b9e0d3c77e5784c6f7f70f6 (patch)
tree237c92bf08214fd6aaec9ad1a4004ff072a1b2fe /agent
parentc99523898df7f76db1c6a26b29616a42fe12f6ae (diff)
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
Summary: developed a reexecute logic for the interpreter to reexecute the bytecode when deopt happens Reviewed-by: kvn, never, jrose, twisti
Diffstat (limited to 'agent')
-rw-r--r--agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java4
-rw-r--r--agent/src/share/classes/sun/jvm/hotspot/code/PCDesc.java1
-rw-r--r--agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java12
3 files changed, 11 insertions, 6 deletions
diff --git a/agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java b/agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java
index fa60c4983..dd0d781c4 100644
--- a/agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java
+++ b/agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java
@@ -81,8 +81,4 @@ public class DebugInfoReadStream extends CompressedReadStream {
Assert.that(false, "should not reach here");
return null;
}
-
- public int readBCI() {
- return readInt() + InvocationEntryBCI;
- }
}
diff --git a/agent/src/share/classes/sun/jvm/hotspot/code/PCDesc.java b/agent/src/share/classes/sun/jvm/hotspot/code/PCDesc.java
index fe0388bb6..6883b6791 100644
--- a/agent/src/share/classes/sun/jvm/hotspot/code/PCDesc.java
+++ b/agent/src/share/classes/sun/jvm/hotspot/code/PCDesc.java
@@ -82,6 +82,7 @@ public class PCDesc extends VMObject {
tty.print(" ");
sd.getMethod().printValueOn(tty);
tty.print(" @" + sd.getBCI());
+ tty.print(" reexecute=" + sd.getReexecute());
tty.println();
}
}
diff --git a/agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java b/agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java
index e75365ae2..2c8c2557c 100644
--- a/agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java
+++ b/agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java
@@ -41,6 +41,7 @@ public class ScopeDesc {
private NMethod code;
private Method method;
private int bci;
+ private boolean reexecute;
/** Decoding offsets */
private int decodeOffset;
private int senderDecodeOffset;
@@ -61,7 +62,7 @@ public class ScopeDesc {
senderDecodeOffset = stream.readInt();
method = (Method) VM.getVM().getObjectHeap().newOop(stream.readOopHandle());
- bci = stream.readBCI();
+ setBCIAndReexecute(stream.readInt());
// Decode offsets for body and sender
localsDecodeOffset = stream.readInt();
expressionsDecodeOffset = stream.readInt();
@@ -78,7 +79,7 @@ public class ScopeDesc {
senderDecodeOffset = stream.readInt();
method = (Method) VM.getVM().getObjectHeap().newOop(stream.readOopHandle());
- bci = stream.readBCI();
+ setBCIAndReexecute(stream.readInt());
// Decode offsets for body and sender
localsDecodeOffset = stream.readInt();
expressionsDecodeOffset = stream.readInt();
@@ -88,6 +89,7 @@ public class ScopeDesc {
public NMethod getNMethod() { return code; }
public Method getMethod() { return method; }
public int getBCI() { return bci; }
+ public boolean getReexecute() {return reexecute;}
/** Returns a List&lt;ScopeValue&gt; */
public List getLocals() {
@@ -150,6 +152,7 @@ public class ScopeDesc {
tty.print("ScopeDesc for ");
method.printValueOn(tty);
tty.println(" @bci " + bci);
+ tty.println(" reexecute: " + reexecute);
}
// FIXME: add more accessors
@@ -157,6 +160,11 @@ public class ScopeDesc {
//--------------------------------------------------------------------------------
// Internals only below this point
//
+ private void setBCIAndReexecute(int combination) {
+ int InvocationEntryBci = VM.getVM().getInvocationEntryBCI();
+ bci = (combination >> 1) + InvocationEntryBci;
+ reexecute = (combination & 1)==1 ? true : false;
+ }
private DebugInfoReadStream streamAt(int decodeOffset) {
return new DebugInfoReadStream(code, decodeOffset, objects);