< prev index next >

src/share/vm/gc/g1/g1EvacFailure.cpp

Print this page
rev 10493 : [mq]: 8077144-concurrent-mark-thread-init-fix

@@ -93,12 +93,10 @@
   // as they have either been dead or evacuated (which are unreferenced now, i.e.
   // dead too) already.
   void do_object(oop obj) {
     HeapWord* obj_addr = (HeapWord*) obj;
     assert(_hr->is_in(obj_addr), "sanity");
-    size_t obj_size = obj->size();
-    HeapWord* obj_end = obj_addr + obj_size;
 
     if (obj->is_forwarded() && obj->forwardee() == obj) {
       // The object failed to move.
 
       zap_dead_objects(_last_forwarded_object_end, obj_addr);

@@ -117,12 +115,14 @@
         // still pointed to be roots. During concurrent marking, and
         // after initial-mark, we don't need to mark any objects
         // explicitly and all objects in the CSet are considered
         // (implicitly) live. So, we won't mark them explicitly and
         // we'll leave them over NTAMS.
-        _cm->grayRoot(obj, obj_size, _worker_id, _hr);
+        _cm->grayRoot(obj, _hr);
       }
+      size_t obj_size = obj->size();
+
       _marked_bytes += (obj_size * HeapWordSize);
       obj->set_mark(markOopDesc::prototype());
 
       // While we were processing RSet buffers during the collection,
       // we actually didn't scan any cards on the collection set,

@@ -136,10 +136,11 @@
       // The problem is that, if evacuation fails, we might have
       // remembered set entries missing given that we skipped cards on
       // the collection set. So, we'll recreate such entries now.
       obj->oop_iterate(_update_rset_cl);
 
+      HeapWord* obj_end = obj_addr + obj_size;
       _last_forwarded_object_end = obj_end;
       _hr->cross_threshold(obj_addr, obj_end);
     }
   }
 
< prev index next >