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

Print this page
rev 6804 : imported patch commit-uncommit-within-heap


 523 
 524 G1Mux2Closure::G1Mux2Closure(OopClosure *c1, OopClosure *c2) :
 525   _c1(c1), _c2(c2) { }
 526 
 527 G1UpdateRSOrPushRefOopClosure::
 528 G1UpdateRSOrPushRefOopClosure(G1CollectedHeap* g1h,
 529                               G1RemSet* rs,
 530                               OopsInHeapRegionClosure* push_ref_cl,
 531                               bool record_refs_into_cset,
 532                               uint worker_i) :
 533   _g1(g1h), _g1_rem_set(rs), _from(NULL),
 534   _record_refs_into_cset(record_refs_into_cset),
 535   _push_ref_cl(push_ref_cl), _worker_i(worker_i) { }
 536 
 537 // Returns true if the given card contains references that point
 538 // into the collection set, if we're checking for such references;
 539 // false otherwise.
 540 
 541 bool G1RemSet::refine_card(jbyte* card_ptr, uint worker_i,
 542                            bool check_for_refs_into_cset) {






 543 
 544   // If the card is no longer dirty, nothing to do.
 545   if (*card_ptr != CardTableModRefBS::dirty_card_val()) {
 546     // No need to return that this card contains refs that point
 547     // into the collection set.
 548     return false;
 549   }
 550 
 551   // Construct the region representing the card.
 552   HeapWord* start = _ct_bs->addr_for(card_ptr);
 553   // And find the region containing it.
 554   HeapRegion* r = _g1->heap_region_containing(start);
 555 
 556   // Why do we have to check here whether a card is on a young region,
 557   // given that we dirty young regions and, as a result, the
 558   // post-barrier is supposed to filter them out and never to enqueue
 559   // them? When we allocate a new region as the "allocation region" we
 560   // actually dirty its cards after we release the lock, since card
 561   // dirtying while holding the lock was a performance bottleneck. So,
 562   // as a result, it is possible for other threads to actually




 523 
 524 G1Mux2Closure::G1Mux2Closure(OopClosure *c1, OopClosure *c2) :
 525   _c1(c1), _c2(c2) { }
 526 
 527 G1UpdateRSOrPushRefOopClosure::
 528 G1UpdateRSOrPushRefOopClosure(G1CollectedHeap* g1h,
 529                               G1RemSet* rs,
 530                               OopsInHeapRegionClosure* push_ref_cl,
 531                               bool record_refs_into_cset,
 532                               uint worker_i) :
 533   _g1(g1h), _g1_rem_set(rs), _from(NULL),
 534   _record_refs_into_cset(record_refs_into_cset),
 535   _push_ref_cl(push_ref_cl), _worker_i(worker_i) { }
 536 
 537 // Returns true if the given card contains references that point
 538 // into the collection set, if we're checking for such references;
 539 // false otherwise.
 540 
 541 bool G1RemSet::refine_card(jbyte* card_ptr, uint worker_i,
 542                            bool check_for_refs_into_cset) {
 543   assert(_g1->is_in_exact(_ct_bs->addr_for(card_ptr)),
 544          err_msg("Card at "PTR_FORMAT" index "SIZE_FORMAT" representing heap at "PTR_FORMAT" (%u) must be in committed heap",
 545                  p2i(card_ptr),
 546                  _ct_bs->index_for(_ct_bs->addr_for(card_ptr)),
 547                  _ct_bs->addr_for(card_ptr),
 548                  _g1->addr_to_region(_ct_bs->addr_for(card_ptr))));
 549 
 550   // If the card is no longer dirty, nothing to do.
 551   if (*card_ptr != CardTableModRefBS::dirty_card_val()) {
 552     // No need to return that this card contains refs that point
 553     // into the collection set.
 554     return false;
 555   }
 556 
 557   // Construct the region representing the card.
 558   HeapWord* start = _ct_bs->addr_for(card_ptr);
 559   // And find the region containing it.
 560   HeapRegion* r = _g1->heap_region_containing(start);
 561 
 562   // Why do we have to check here whether a card is on a young region,
 563   // given that we dirty young regions and, as a result, the
 564   // post-barrier is supposed to filter them out and never to enqueue
 565   // them? When we allocate a new region as the "allocation region" we
 566   // actually dirty its cards after we release the lock, since card
 567   // dirtying while holding the lock was a performance bottleneck. So,
 568   // as a result, it is possible for other threads to actually