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

Print this page




 306 }
 307 
 308 // This determines whether the method below will check both the local
 309 // and global fingers when determining whether to push on the stack a
 310 // gray object (value 1) or whether it will only check the global one
 311 // (value 0). The tradeoffs are that the former will be a bit more
 312 // accurate and possibly push less on the stack, but it might also be
 313 // a little bit slower.
 314 
 315 #define _CHECK_BOTH_FINGERS_      1
 316 
 317 inline void CMTask::deal_with_reference(oop obj) {
 318   if (_cm->verbose_high()) {
 319     gclog_or_tty->print_cr("[%u] we're dealing with reference = "PTR_FORMAT,
 320                            _worker_id, p2i((void*) obj));
 321   }
 322 
 323   ++_refs_reached;
 324 
 325   HeapWord* objAddr = (HeapWord*) obj;
 326   assert(obj->is_oop_or_null(true /* ignore mark word */), "Error");
 327   if (_g1h->is_in_g1_reserved(objAddr)) {
 328     assert(obj != NULL, "null check is implicit");
 329     if (!_nextMarkBitMap->isMarked(objAddr)) {
 330       // Only get the containing region if the object is not marked on the
 331       // bitmap (otherwise, it's a waste of time since we won't do
 332       // anything with it).
 333       HeapRegion* hr = _g1h->heap_region_containing_raw(obj);
 334       if (!hr->obj_allocated_since_next_marking(obj)) {
 335         if (_cm->verbose_high()) {
 336           gclog_or_tty->print_cr("[%u] "PTR_FORMAT" is not considered marked",
 337                                  _worker_id, p2i((void*) obj));
 338         }
 339 
 340         // we need to mark it first
 341         if (_cm->par_mark_and_count(obj, hr, _marked_bytes_array, _card_bm)) {
 342           // No OrderAccess:store_load() is needed. It is implicit in the
 343           // CAS done in CMBitMap::parMark() call in the routine above.
 344           HeapWord* global_finger = _cm->finger();
 345 
 346 #if _CHECK_BOTH_FINGERS_




 306 }
 307 
 308 // This determines whether the method below will check both the local
 309 // and global fingers when determining whether to push on the stack a
 310 // gray object (value 1) or whether it will only check the global one
 311 // (value 0). The tradeoffs are that the former will be a bit more
 312 // accurate and possibly push less on the stack, but it might also be
 313 // a little bit slower.
 314 
 315 #define _CHECK_BOTH_FINGERS_      1
 316 
 317 inline void CMTask::deal_with_reference(oop obj) {
 318   if (_cm->verbose_high()) {
 319     gclog_or_tty->print_cr("[%u] we're dealing with reference = "PTR_FORMAT,
 320                            _worker_id, p2i((void*) obj));
 321   }
 322 
 323   ++_refs_reached;
 324 
 325   HeapWord* objAddr = (HeapWord*) obj;
 326   assert(obj->is_oop_or_null(true /* ignore mark word */), err_msg("expected an oop or NULL: " PTR_FORMAT, p2i(obj)));
 327   if (_g1h->is_in_g1_reserved(objAddr)) {
 328     assert(obj != NULL, "null check is implicit");
 329     if (!_nextMarkBitMap->isMarked(objAddr)) {
 330       // Only get the containing region if the object is not marked on the
 331       // bitmap (otherwise, it's a waste of time since we won't do
 332       // anything with it).
 333       HeapRegion* hr = _g1h->heap_region_containing_raw(obj);
 334       if (!hr->obj_allocated_since_next_marking(obj)) {
 335         if (_cm->verbose_high()) {
 336           gclog_or_tty->print_cr("[%u] "PTR_FORMAT" is not considered marked",
 337                                  _worker_id, p2i((void*) obj));
 338         }
 339 
 340         // we need to mark it first
 341         if (_cm->par_mark_and_count(obj, hr, _marked_bytes_array, _card_bm)) {
 342           // No OrderAccess:store_load() is needed. It is implicit in the
 343           // CAS done in CMBitMap::parMark() call in the routine above.
 344           HeapWord* global_finger = _cm->finger();
 345 
 346 #if _CHECK_BOTH_FINGERS_