src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp

Print this page
rev 2724 : 6484965: G1: piggy-back liveness accounting phase on marking
Summary: Remove the separate counting phase of concurrent marking by tracking the amount of marked bytes and the cards spanned by marked objects in marking task/worker thread local data structures, which are updated as individual objects are marked.
Reviewed-by:


  82 
  83   ++_refs_reached;
  84 
  85   HeapWord* objAddr = (HeapWord*) obj;
  86   assert(obj->is_oop_or_null(true /* ignore mark word */), "Error");
  87  if (_g1h->is_in_g1_reserved(objAddr)) {
  88     assert(obj != NULL, "null check is implicit");
  89     if (!_nextMarkBitMap->isMarked(objAddr)) {
  90       // Only get the containing region if the object is not marked on the
  91       // bitmap (otherwise, it's a waste of time since we won't do
  92       // anything with it).
  93       HeapRegion* hr = _g1h->heap_region_containing_raw(obj);
  94       if (!hr->obj_allocated_since_next_marking(obj)) {
  95         if (_cm->verbose_high()) {
  96           gclog_or_tty->print_cr("[%d] "PTR_FORMAT" is not considered marked",
  97                                  _task_id, (void*) obj);
  98         }
  99 
 100         // we need to mark it first
 101         if (_nextMarkBitMap->parMark(objAddr)) {



 102           // No OrderAccess:store_load() is needed. It is implicit in the
 103           // CAS done in parMark(objAddr) above
 104           HeapWord* global_finger = _cm->finger();
 105 
 106 #if _CHECK_BOTH_FINGERS_
 107           // we will check both the local and global fingers
 108 
 109           if (_finger != NULL && objAddr < _finger) {
 110             if (_cm->verbose_high()) {
 111               gclog_or_tty->print_cr("[%d] below the local finger ("PTR_FORMAT"), "
 112                                      "pushing it", _task_id, _finger);
 113             }
 114             push(obj);
 115           } else if (_curr_region != NULL && objAddr < _region_limit) {
 116             // do nothing
 117           } else if (objAddr < global_finger) {
 118             // Notice that the global finger might be moving forward
 119             // concurrently. This is not a problem. In the worst case, we
 120             // mark the object while it is above the global finger and, by
 121             // the time we read the global finger, it has moved forward




  82 
  83   ++_refs_reached;
  84 
  85   HeapWord* objAddr = (HeapWord*) obj;
  86   assert(obj->is_oop_or_null(true /* ignore mark word */), "Error");
  87   if (_g1h->is_in_g1_reserved(objAddr)) {
  88     assert(obj != NULL, "null check is implicit");
  89     if (!_nextMarkBitMap->isMarked(objAddr)) {
  90       // Only get the containing region if the object is not marked on the
  91       // bitmap (otherwise, it's a waste of time since we won't do
  92       // anything with it).
  93       HeapRegion* hr = _g1h->heap_region_containing_raw(obj);
  94       if (!hr->obj_allocated_since_next_marking(obj)) {
  95         if (_cm->verbose_high()) {
  96           gclog_or_tty->print_cr("[%d] "PTR_FORMAT" is not considered marked",
  97                                  _task_id, (void*) obj);
  98         }
  99 
 100         // we need to mark it first
 101         if (_nextMarkBitMap->parMark(objAddr)) {
 102           // Update the task specific count data with obj.
 103           _cm->add_to_count_data_for(obj, hr, _task_id);
 104 
 105           // No OrderAccess:store_load() is needed. It is implicit in the
 106           // CAS done in parMark(objAddr) above
 107           HeapWord* global_finger = _cm->finger();
 108 
 109 #if _CHECK_BOTH_FINGERS_
 110           // we will check both the local and global fingers
 111 
 112           if (_finger != NULL && objAddr < _finger) {
 113             if (_cm->verbose_high()) {
 114               gclog_or_tty->print_cr("[%d] below the local finger ("PTR_FORMAT"), "
 115                                      "pushing it", _task_id, _finger);
 116             }
 117             push(obj);
 118           } else if (_curr_region != NULL && objAddr < _region_limit) {
 119             // do nothing
 120           } else if (objAddr < global_finger) {
 121             // Notice that the global finger might be moving forward
 122             // concurrently. This is not a problem. In the worst case, we
 123             // mark the object while it is above the global finger and, by
 124             // the time we read the global finger, it has moved forward