< prev index next >

src/share/vm/gc/parallel/psMarkSweepDecorator.cpp

Print this page

        

@@ -27,11 +27,10 @@
 #include "gc/parallel/objectStartArray.hpp"
 #include "gc/parallel/parallelScavengeHeap.hpp"
 #include "gc/parallel/psMarkSweep.hpp"
 #include "gc/parallel/psMarkSweepDecorator.hpp"
 #include "gc/serial/markSweep.inline.hpp"
-#include "gc/shared/liveRange.hpp"
 #include "gc/shared/spaceDecorator.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/prefetch.inline.hpp"
 
 PSMarkSweepDecorator* PSMarkSweepDecorator::_destination_decorator = NULL;

@@ -105,13 +104,10 @@
   HeapWord* t = space()->top();
 
   HeapWord*  end_of_live= q;    /* One byte beyond the last byte of the last
                                    live object. */
   HeapWord*  first_dead = space()->end(); /* The first dead object. */
-  LiveRange* liveRange  = NULL; /* The current live range, recorded in the
-                                   first header of preceding free area. */
-  _first_dead = first_dead;
 
   const intx interval = PrefetchScanIntervalInBytes;
 
   while (q < t) {
     assert(oop(q)->mark()->is_marked() || oop(q)->mark()->is_unlocked() ||

@@ -229,21 +225,12 @@
           end_of_live = end;
           continue;
         }
       }
 
-      /* for the previous LiveRange, record the end of the live objects. */
-      if (liveRange) {
-        liveRange->set_end(q);
-      }
-
-      /* record the current LiveRange object.
-       * liveRange->start() is overlaid on the mark word.
-       */
-      liveRange = (LiveRange*)q;
-      liveRange->set_start(end);
-      liveRange->set_end(end);
+      // q is a pointer to a dead object. Use this dead memory to store a pointer to the next live object.
+      (*(HeapWord**)q) = end;
 
       /* see if this is the first dead region. */
       if (q < first_dead) {
         first_dead = q;
       }

@@ -252,13 +239,10 @@
       q = end;
     }
   }
 
   assert(q == t, "just checking");
-  if (liveRange != NULL) {
-    liveRange->set_end(q);
-  }
   _end_of_live = end_of_live;
   if (end_of_live < first_dead) {
     first_dead = end_of_live;
   }
   _first_dead = first_dead;

@@ -305,13 +289,12 @@
     }
 
     if (_first_dead == t) {
       q = t;
     } else {
-      // $$$ This is funky.  Using this to read the previously written
-      // LiveRange.  See also use below.
-      q = (HeapWord*)oop(_first_dead)->mark()->decode_pointer();
+      // The first dead object should contain a pointer to the first live object
+      q = *(HeapWord**)_first_dead;
     }
   }
   const intx interval = PrefetchScanIntervalInBytes;
 
   debug_only(HeapWord* prev_q = NULL);

@@ -323,15 +306,14 @@
       // point all the oops to the new location
       size_t size = MarkSweep::adjust_pointers(oop(q));
       debug_only(prev_q = q);
       q += size;
     } else {
-      // q is not a live object, so its mark should point at the next
-      // live object
       debug_only(prev_q = q);
-      q = (HeapWord*) oop(q)->mark()->decode_pointer();
-      assert(q > prev_q, "we should be moving forward through memory");
+      // q is not a live object, instead it points at the next live object
+      q = *(HeapWord**)q;
+      assert(q > prev_q, "we should be moving forward through memory, q: " PTR_FORMAT ", prev_q: " PTR_FORMAT, p2i(q), p2i(prev_q));
     }
   }
 
   assert(q == t, "just checking");
 }
< prev index next >