Merge
authorjrose
Thu, 06 Aug 2009 16:15:16 -0700
changeset 3606 e09e901a7601
parent 3605 1540652a8156 (current diff)
parent 3604 30fbd94d4963 (diff)
child 3608 6b6768abef45
Merge
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java	Thu Aug 06 14:28:54 2009 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java	Thu Aug 06 16:15:16 2009 -0700
@@ -176,19 +176,6 @@
 
       for (; cur.lessThan(limit);) {
          Address klassOop = cur.getAddressAt(addressSize);
-         // FIXME: need to do a better job here.
-         // can I use bitMap here?
-         if (klassOop == null) {
-            //Find the object size using Printezis bits and skip over
-            System.err.println("Finding object size using Printezis bits and skipping over...");
-            long size = collector().blockSizeUsingPrintezisBits(cur);
-            if (size == -1) {
-              System.err.println("Printezis bits not set...");
-              break;
-            }
-            cur = cur.addOffsetTo(adjustObjectSizeInBytes(size));
-         }
-
          if (FreeChunk.indicatesFreeChunk(cur)) {
             if (! cur.equals(regionStart)) {
                res.add(new MemRegion(regionStart, cur));
@@ -200,12 +187,21 @@
             }
             // note that fc.size() gives chunk size in heap words
             cur = cur.addOffsetTo(chunkSize * addressSize);
-            System.err.println("Free chunk in CMS heap, size="+chunkSize * addressSize);
             regionStart = cur;
          } else if (klassOop != null) {
             Oop obj = heap.newOop(cur.addOffsetToAsOopHandle(0));
             long objectSize = obj.getObjectSize();
             cur = cur.addOffsetTo(adjustObjectSizeInBytes(objectSize));
+         } else {
+            // FIXME: need to do a better job here.
+            // can I use bitMap here?
+            //Find the object size using Printezis bits and skip over
+            long size = collector().blockSizeUsingPrintezisBits(cur);
+            if (size == -1) {
+              System.err.println("Printezis bits not set...");
+              break;
+            }
+            cur = cur.addOffsetTo(adjustObjectSizeInBytes(size));
          }
       }
       return res;
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/FreeChunk.java	Thu Aug 06 14:28:54 2009 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/FreeChunk.java	Thu Aug 06 16:15:16 2009 -0700
@@ -63,7 +63,7 @@
 
    public long size() {
       if (VM.getVM().isCompressedOopsEnabled()) {
-        Mark mark = new Mark(sizeField.getValue(addr));
+        Mark mark = new Mark(addr.addOffsetTo(sizeField.getOffset()));
         return mark.getSize();
       } else {
         Address size = sizeField.getValue(addr);
@@ -83,7 +83,7 @@
 
    public boolean isFree() {
       if (VM.getVM().isCompressedOopsEnabled()) {
-        Mark mark = new Mark(sizeField.getValue(addr));
+        Mark mark = new Mark(addr.addOffsetTo(sizeField.getOffset()));
         return mark.isCmsFreeChunk();
       } else {
         Address prev = prevField.getValue(addr);