< prev index next >

src/share/vm/gc/shared/space.inline.hpp

Print this page

        

@@ -187,45 +187,16 @@
   HeapWord* const end_of_live = space->_end_of_live;  // Established by "scan_and_forward".
   HeapWord* const first_dead = space->_first_dead;    // Established by "scan_and_forward".
 
   assert(first_dead <= end_of_live, "Stands to reason, no?");
 
-  if (cur_obj < end_of_live && first_dead > cur_obj && !oop(cur_obj)->is_gc_marked()) {
-    // we have a chunk of the space which hasn't moved and we've
-    // reinitialized the mark word during the previous pass, so we can't
-    // use is_gc_marked for the traversal.
-
-    while (cur_obj < first_dead) {
-      // I originally tried to conjoin "block_start(cur_obj) == cur_obj" to the
-      // assertion below, but that doesn't work, because you can't
-      // accurately traverse previous objects to get to the current one
-      // after their pointers have been
-      // updated, until the actual compaction is done.  dld, 4/00
-      assert(space->block_is_obj(cur_obj), "should be at block boundaries, and should be looking at objs");
-
-      // point all the oops to the new location
-      size_t size = MarkSweep::adjust_pointers(oop(cur_obj));
-      size = space->adjust_obj_size(size);
-
-      cur_obj += size;
-    }
-
-    if (first_dead == end_of_live) {
-      cur_obj = end_of_live;
-    } else {
-      // The first dead object is no longer an object. At that memory address,
-      // there is a pointer to the first live object that the previous phase found.
-      cur_obj = *(HeapWord**)first_dead;
-    }
-  }
-
   const intx interval = PrefetchScanIntervalInBytes;
 
   debug_only(HeapWord* prev_obj = NULL);
   while (cur_obj < end_of_live) {
     Prefetch::write(cur_obj, interval);
-    if (oop(cur_obj)->is_gc_marked()) {
+    if (cur_obj < first_dead || oop(cur_obj)->is_gc_marked()) {
       // cur_obj is alive
       // point all the oops to the new location
       size_t size = MarkSweep::adjust_pointers(oop(cur_obj));
       size = space->adjust_obj_size(size);
       debug_only(prev_obj = cur_obj);
< prev index next >