src/share/vm/gc_implementation/g1/concurrentMark.cpp

Print this page




4094       } else if (_nextMarkBitMap->iterate(&bitmap_closure, mr)) {
4095         giveup_current_region();
4096         regular_clock_call();
4097       } else {
4098         assert(has_aborted(), "currently the only way to do so");
4099         // The only way to abort the bitmap iteration is to return
4100         // false from the do_bit() method. However, inside the
4101         // do_bit() method we move the _finger to point to the
4102         // object currently being looked at. So, if we bail out, we
4103         // have definitely set _finger to something non-null.
4104         assert(_finger != NULL, "invariant");
4105 
4106         // Region iteration was actually aborted. So now _finger
4107         // points to the address of the object we last scanned. If we
4108         // leave it there, when we restart this task, we will rescan
4109         // the object. It is easy to avoid this. We move the finger by
4110         // enough to point to the next possible object header (the
4111         // bitmap knows by how much we need to move it as it knows its
4112         // granularity).
4113         assert(_finger < _region_limit, "invariant");
4114         HeapWord* new_finger = _nextMarkBitMap->nextWord(_finger);
4115         // Check if bitmap iteration was aborted while scanning the last object
4116         if (new_finger >= _region_limit) {
4117           giveup_current_region();
4118         } else {
4119           move_finger_to(new_finger);
4120         }
4121       }
4122     }
4123     // At this point we have either completed iterating over the
4124     // region we were holding on to, or we have aborted.
4125 
4126     // We then partially drain the local queue and the global stack.
4127     // (Do we really need this?)
4128     drain_local_queue(true);
4129     drain_global_stack(true);
4130 
4131     // Read the note on the claim_region() method on why it might
4132     // return NULL with potentially more regions available for
4133     // claiming and why we have to check out_of_regions() to determine
4134     // whether we're done or not.




4094       } else if (_nextMarkBitMap->iterate(&bitmap_closure, mr)) {
4095         giveup_current_region();
4096         regular_clock_call();
4097       } else {
4098         assert(has_aborted(), "currently the only way to do so");
4099         // The only way to abort the bitmap iteration is to return
4100         // false from the do_bit() method. However, inside the
4101         // do_bit() method we move the _finger to point to the
4102         // object currently being looked at. So, if we bail out, we
4103         // have definitely set _finger to something non-null.
4104         assert(_finger != NULL, "invariant");
4105 
4106         // Region iteration was actually aborted. So now _finger
4107         // points to the address of the object we last scanned. If we
4108         // leave it there, when we restart this task, we will rescan
4109         // the object. It is easy to avoid this. We move the finger by
4110         // enough to point to the next possible object header (the
4111         // bitmap knows by how much we need to move it as it knows its
4112         // granularity).
4113         assert(_finger < _region_limit, "invariant");
4114         HeapWord* new_finger = _nextMarkBitMap->nextObject(_finger);
4115         // Check if bitmap iteration was aborted while scanning the last object
4116         if (new_finger >= _region_limit) {
4117           giveup_current_region();
4118         } else {
4119           move_finger_to(new_finger);
4120         }
4121       }
4122     }
4123     // At this point we have either completed iterating over the
4124     // region we were holding on to, or we have aborted.
4125 
4126     // We then partially drain the local queue and the global stack.
4127     // (Do we really need this?)
4128     drain_local_queue(true);
4129     drain_global_stack(true);
4130 
4131     // Read the note on the claim_region() method on why it might
4132     // return NULL with potentially more regions available for
4133     // claiming and why we have to check out_of_regions() to determine
4134     // whether we're done or not.