diff agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java @ 113:ba764ed4b6f2

6420645: Create a vm that uses compressed oops for up to 32gb heapsizes Summary: Compressed oops in instances, arrays, and headers. Code contributors are coleenp, phh, never, swamyv Reviewed-by: jmasa, kamg, acorn, tbell, kvn, rasbold
author coleenp
date Sun, 13 Apr 2008 17:43:42 -0400
parents a61af66fc99e
children d1605aabd0a1
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java	Fri Apr 11 09:56:35 2008 -0400
+++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java	Sun Apr 13 17:43:42 2008 -0400
@@ -37,6 +37,7 @@
     DbxDebugger interfaces. </P> */
 
 public abstract class DebuggerBase implements Debugger {
+
   // May be set lazily, but must be set before calling any of the read
   // routines below
   protected MachineDescription machDesc;
@@ -52,6 +53,11 @@
   protected long jlongSize;
   protected long jshortSize;
   protected boolean javaPrimitiveTypesConfigured;
+  // heap data.
+  protected long oopSize;
+  protected long heapOopSize;
+  protected long heapBase;                 // heap base for compressed oops.
+  protected long logMinObjAlignmentInBytes; // Used to decode compressed oops.
   // Should be initialized if desired by calling initCache()
   private PageCache cache;
 
@@ -153,6 +159,12 @@
     javaPrimitiveTypesConfigured = true;
   }
 
+  public void putHeapConst(long heapBase, long heapOopSize, long logMinObjAlignmentInBytes) {
+    this.heapBase = heapBase;
+    this.heapOopSize = heapOopSize;
+    this.logMinObjAlignmentInBytes = logMinObjAlignmentInBytes;
+  }
+
   /** May be called by subclasses if desired to initialize the page
       cache but may not be overridden */
   protected final void initCache(long pageSize, long maxNumPages) {
@@ -442,6 +454,16 @@
     return readCInteger(address, machDesc.getAddressSize(), true);
   }
 
+  protected long readCompOopAddressValue(long address)
+    throws UnmappedAddressException, UnalignedAddressException {
+    long value = readCInteger(address, getHeapOopSize(), true);
+    if (value != 0) {
+      // See oop.inline.hpp decode_heap_oop
+      value = (long)(heapBase + (long)(value << logMinObjAlignmentInBytes));
+    }
+    return value;
+  }
+
   protected void writeAddressValue(long address, long value)
     throws UnmappedAddressException, UnalignedAddressException {
     writeCInteger(address, machDesc.getAddressSize(), value);
@@ -518,4 +540,15 @@
   public long getJShortSize() {
     return jshortSize;
   }
+
+  public long getHeapOopSize() {
+    return heapOopSize;
+  }
+
+  public long getHeapBase() {
+    return heapBase;
+  }
+  public long getLogMinObjAlignmentInBytes() {
+    return logMinObjAlignmentInBytes;
+  }
 }