425 G1Mux2Closure::G1Mux2Closure(OopClosure *c1, OopClosure *c2) :
426 _c1(c1), _c2(c2) { }
427
428 G1UpdateRSOrPushRefOopClosure::
429 G1UpdateRSOrPushRefOopClosure(G1CollectedHeap* g1h,
430 G1RemSet* rs,
431 G1ParPushHeapRSClosure* push_ref_cl,
432 bool record_refs_into_cset,
433 uint worker_i) :
434 _g1(g1h), _g1_rem_set(rs), _from(NULL),
435 _record_refs_into_cset(record_refs_into_cset),
436 _push_ref_cl(push_ref_cl), _worker_i(worker_i) { }
437
438 // Returns true if the given card contains references that point
439 // into the collection set, if we're checking for such references;
440 // false otherwise.
441
442 bool G1RemSet::refine_card(jbyte* card_ptr, uint worker_i,
443 bool check_for_refs_into_cset) {
444 assert(_g1->is_in_exact(_ct_bs->addr_for(card_ptr)),
445 err_msg("Card at "PTR_FORMAT" index "SIZE_FORMAT" representing heap at "PTR_FORMAT" (%u) must be in committed heap",
446 p2i(card_ptr),
447 _ct_bs->index_for(_ct_bs->addr_for(card_ptr)),
448 _ct_bs->addr_for(card_ptr),
449 _g1->addr_to_region(_ct_bs->addr_for(card_ptr))));
450
451 // If the card is no longer dirty, nothing to do.
452 if (*card_ptr != CardTableModRefBS::dirty_card_val()) {
453 // No need to return that this card contains refs that point
454 // into the collection set.
455 return false;
456 }
457
458 // Construct the region representing the card.
459 HeapWord* start = _ct_bs->addr_for(card_ptr);
460 // And find the region containing it.
461 HeapRegion* r = _g1->heap_region_containing(start);
462
463 // Why do we have to check here whether a card is on a young region,
464 // given that we dirty young regions and, as a result, the
465 // post-barrier is supposed to filter them out and never to enqueue
|
425 G1Mux2Closure::G1Mux2Closure(OopClosure *c1, OopClosure *c2) :
426 _c1(c1), _c2(c2) { }
427
428 G1UpdateRSOrPushRefOopClosure::
429 G1UpdateRSOrPushRefOopClosure(G1CollectedHeap* g1h,
430 G1RemSet* rs,
431 G1ParPushHeapRSClosure* push_ref_cl,
432 bool record_refs_into_cset,
433 uint worker_i) :
434 _g1(g1h), _g1_rem_set(rs), _from(NULL),
435 _record_refs_into_cset(record_refs_into_cset),
436 _push_ref_cl(push_ref_cl), _worker_i(worker_i) { }
437
438 // Returns true if the given card contains references that point
439 // into the collection set, if we're checking for such references;
440 // false otherwise.
441
442 bool G1RemSet::refine_card(jbyte* card_ptr, uint worker_i,
443 bool check_for_refs_into_cset) {
444 assert(_g1->is_in_exact(_ct_bs->addr_for(card_ptr)),
445 err_msg("Card at " PTR_FORMAT " index " SIZE_FORMAT " representing heap at " PTR_FORMAT " (%u) must be in committed heap",
446 p2i(card_ptr),
447 _ct_bs->index_for(_ct_bs->addr_for(card_ptr)),
448 _ct_bs->addr_for(card_ptr),
449 _g1->addr_to_region(_ct_bs->addr_for(card_ptr))));
450
451 // If the card is no longer dirty, nothing to do.
452 if (*card_ptr != CardTableModRefBS::dirty_card_val()) {
453 // No need to return that this card contains refs that point
454 // into the collection set.
455 return false;
456 }
457
458 // Construct the region representing the card.
459 HeapWord* start = _ct_bs->addr_for(card_ptr);
460 // And find the region containing it.
461 HeapRegion* r = _g1->heap_region_containing(start);
462
463 // Why do we have to check here whether a card is on a young region,
464 // given that we dirty young regions and, as a result, the
465 // post-barrier is supposed to filter them out and never to enqueue
|