Print this page
rev 2691 : [mq]: g1-reference-processing

Split Close
Expand all
Collapse all
          --- old/src/share/vm/gc_implementation/g1/g1RemSet.cpp
          +++ new/src/share/vm/gc_implementation/g1/g1RemSet.cpp
↓ open down ↓ 226 lines elided ↑ open up ↑
 227  227        result = result->next_in_collection_set();
 228  228    }
 229  229    return result;
 230  230  }
 231  231  
 232  232  void G1RemSet::scanRS(OopsInHeapRegionClosure* oc, int worker_i) {
 233  233    double rs_time_start = os::elapsedTime();
 234  234    HeapRegion *startRegion = calculateStartRegion(worker_i);
 235  235  
 236  236    ScanRSClosure scanRScl(oc, worker_i);
      237 +
 237  238    _g1->collection_set_iterate_from(startRegion, &scanRScl);
 238  239    scanRScl.set_try_claimed();
 239  240    _g1->collection_set_iterate_from(startRegion, &scanRScl);
 240  241  
 241  242    double scan_rs_time_sec = os::elapsedTime() - rs_time_start;
 242  243  
 243  244    assert( _cards_scanned != NULL, "invariant" );
 244  245    _cards_scanned[worker_i] = scanRScl.cards_done();
 245  246  
 246  247    _g1p->record_scan_rs_time(worker_i, scan_rs_time_sec * 1000.0);
↓ open down ↓ 29 lines elided ↑ open up ↑
 276  277        _into_cset_dcq->enqueue(card_ptr);
 277  278      }
 278  279      return true;
 279  280    }
 280  281  };
 281  282  
 282  283  void G1RemSet::updateRS(DirtyCardQueue* into_cset_dcq, int worker_i) {
 283  284    double start = os::elapsedTime();
 284  285    // Apply the given closure to all remaining log entries.
 285  286    RefineRecordRefsIntoCSCardTableEntryClosure into_cset_update_rs_cl(_g1, into_cset_dcq);
      287 +
 286  288    _g1->iterate_dirty_card_closure(&into_cset_update_rs_cl, into_cset_dcq, false, worker_i);
 287  289  
 288  290    // Now there should be no dirty cards.
 289  291    if (G1RSLogCheckCardTable) {
 290  292      CountNonCleanMemRegionClosure cl(_g1);
 291  293      _ct_bs->mod_card_iterate(&cl);
 292  294      // XXX This isn't true any more: keeping cards of young regions
 293  295      // marked dirty broke it.  Need some reasonable fix.
 294  296      guarantee(cl.n() == 0, "Card table should be clean.");
 295  297    }
↓ open down ↓ 163 lines elided ↑ open up ↑
 459  461      HeapWord* start = _ct_bs->addr_for(card_ptr);
 460  462      // And find the region containing it.
 461  463      HeapRegion* r = _g1->heap_region_containing(start);
 462  464      assert(r != NULL, "unexpected null");
 463  465  
 464  466      // Scan oops in the card looking for references into the collection set
 465  467      HeapWord* end   = _ct_bs->addr_for(card_ptr + 1);
 466  468      MemRegion scanRegion(start, end);
 467  469  
 468  470      UpdateRSetImmediate update_rs_cl(_g1->g1_rem_set());
 469      -    FilterIntoCSClosure update_rs_cset_oop_cl(NULL, _g1, &update_rs_cl);
      471 +    FilterIntoCSClosure update_rs_cset_oop_cl(NULL, _g1, &update_rs_cl, NULL /* rp */);
 470  472      FilterOutOfRegionClosure filter_then_update_rs_cset_oop_cl(r, &update_rs_cset_oop_cl);
 471  473  
 472  474      // We can pass false as the "filter_young" parameter here as:
 473  475      // * we should be in a STW pause,
 474  476      // * the DCQS to which this closure is applied is used to hold
 475  477      //   references that point into the collection set from the prior
 476  478      //   RSet updating,
 477  479      // * the post-write barrier shouldn't be logging updates to young
 478  480      //   regions (but there is a situation where this can happen - see
 479  481      //   the comment in G1RemSet::concurrentRefineOneCard below -
↓ open down ↓ 155 lines elided ↑ open up ↑
 635  637  
 636  638    assert(!check_for_refs_into_cset || _cset_rs_update_cl[worker_i] != NULL, "sanity");
 637  639    UpdateRSOrPushRefOopClosure update_rs_oop_cl(_g1,
 638  640                                                 _g1->g1_rem_set(),
 639  641                                                 _cset_rs_update_cl[worker_i],
 640  642                                                 check_for_refs_into_cset,
 641  643                                                 worker_i);
 642  644    update_rs_oop_cl.set_from(r);
 643  645  
 644  646    TriggerClosure trigger_cl;
 645      -  FilterIntoCSClosure into_cs_cl(NULL, _g1, &trigger_cl);
      647 +  FilterIntoCSClosure into_cs_cl(NULL, _g1, &trigger_cl, NULL /* rp */);
 646  648    InvokeIfNotTriggeredClosure invoke_cl(&trigger_cl, &into_cs_cl);
 647  649    Mux2Closure mux(&invoke_cl, &update_rs_oop_cl);
 648  650  
 649  651    FilterOutOfRegionClosure filter_then_update_rs_oop_cl(r,
 650  652                          (check_for_refs_into_cset ?
 651  653                                  (OopClosure*)&mux :
 652  654                                  (OopClosure*)&update_rs_oop_cl));
 653  655  
 654  656    // The region for the current card may be a young region. The
 655  657    // current card may have been a card that was evicted from the
↓ open down ↓ 291 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX