diff agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java @ 931:72088be4b386

6873116: Modify reexecute implementation to use pcDesc to record the reexecute bit Summary: use PcDesc to keep record of the reexecute bit instead of using DebugInfoStreams Reviewed-by: kvn, never, twisti
author cfang
date Thu, 20 Aug 2009 12:42:57 -0700
parents 15bbd3f505c0
children 873ec3787992
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java	Wed Aug 19 19:05:18 2009 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java	Thu Aug 20 12:42:57 2009 -0700
@@ -52,44 +52,46 @@
   private List    objects; // ArrayList<ScopeValue>
 
 
-  public ScopeDesc(NMethod code, int decodeOffset) {
+  public ScopeDesc(NMethod code, int decodeOffset, boolean reexecute) {
     this.code = code;
     this.decodeOffset = decodeOffset;
     this.objects      = decodeObjectValues(DebugInformationRecorder.SERIALIZED_NULL);
+    this.reexecute    = reexecute;
 
     // Decode header
     DebugInfoReadStream stream  = streamAt(decodeOffset);
 
     senderDecodeOffset = stream.readInt();
     method = (Method) VM.getVM().getObjectHeap().newOop(stream.readOopHandle());
-    setBCIAndReexecute(stream.readInt());
+    bci    = stream.readBCI();
     // Decode offsets for body and sender
     localsDecodeOffset      = stream.readInt();
     expressionsDecodeOffset = stream.readInt();
     monitorsDecodeOffset    = stream.readInt();
   }
 
-  public ScopeDesc(NMethod code, int decodeOffset, int objectDecodeOffset) {
+  public ScopeDesc(NMethod code, int decodeOffset, int objectDecodeOffset, boolean reexecute) {
     this.code = code;
     this.decodeOffset = decodeOffset;
     this.objects      = decodeObjectValues(objectDecodeOffset);
+    this.reexecute    = reexecute;
 
     // Decode header
     DebugInfoReadStream stream  = streamAt(decodeOffset);
 
     senderDecodeOffset = stream.readInt();
     method = (Method) VM.getVM().getObjectHeap().newOop(stream.readOopHandle());
-    setBCIAndReexecute(stream.readInt());
+    bci    = stream.readBCI();
     // Decode offsets for body and sender
     localsDecodeOffset      = stream.readInt();
     expressionsDecodeOffset = stream.readInt();
     monitorsDecodeOffset    = stream.readInt();
   }
 
-  public NMethod getNMethod() { return code; }
-  public Method getMethod() { return method; }
-  public int    getBCI()    { return bci;    }
-  public boolean getReexecute() {return reexecute;}
+  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() {
@@ -117,7 +119,7 @@
       return null;
     }
 
-    return new ScopeDesc(code, senderDecodeOffset);
+    return new ScopeDesc(code, senderDecodeOffset, false);
   }
 
   /** Returns where the scope was decoded */
@@ -151,8 +153,8 @@
   public void printValueOn(PrintStream tty) {
     tty.print("ScopeDesc for ");
     method.printValueOn(tty);
-    tty.println(" @bci " + bci);
-    tty.println(" reexecute: " + reexecute);
+    tty.print(" @bci " + bci);
+    tty.println(" reexecute=" + reexecute);
   }
 
   // FIXME: add more accessors
@@ -160,12 +162,6 @@
   //--------------------------------------------------------------------------------
   // 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);
   }