488 }
489
490 void G1RemSet::prepare_for_oops_into_collection_set_do() {
491 DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
492 dcqs.concatenate_logs();
493
494 _scan_state->reset();
495 }
496
497 void G1RemSet::cleanup_after_oops_into_collection_set_do() {
498 G1GCPhaseTimes* phase_times = _g1->g1_policy()->phase_times();
499
500 // Set all cards back to clean.
501 double start = os::elapsedTime();
502 _scan_state->clear_card_table(_g1->workers());
503 phase_times->record_clear_ct_time((os::elapsedTime() - start) * 1000.0);
504 }
505
506 inline void check_card_ptr(jbyte* card_ptr, G1CardTable* ct) {
507 #ifdef ASSERT
508 G1CollectedHeap* g1 = G1CollectedHeap::heap();
509 assert(g1->is_in_exact(ct->addr_for(card_ptr)),
510 "Card at " PTR_FORMAT " index " SIZE_FORMAT " representing heap at " PTR_FORMAT " (%u) must be in committed heap",
511 p2i(card_ptr),
512 ct->index_for(ct->addr_for(card_ptr)),
513 p2i(ct->addr_for(card_ptr)),
514 g1->addr_to_region(ct->addr_for(card_ptr)));
515 #endif
516 }
517
518 void G1RemSet::refine_card_concurrently(jbyte* card_ptr,
519 uint worker_i) {
520 assert(!_g1->is_gc_active(), "Only call concurrently");
521
522 check_card_ptr(card_ptr, _ct);
523
524 // If the card is no longer dirty, nothing to do.
525 if (*card_ptr != G1CardTable::dirty_card_val()) {
526 return;
527 }
528
529 // Construct the region representing the card.
530 HeapWord* start = _ct->addr_for(card_ptr);
531 // And find the region containing it.
532 HeapRegion* r = _g1->heap_region_containing(start);
533
534 // This check is needed for some uncommon cases where we should
|
488 }
489
490 void G1RemSet::prepare_for_oops_into_collection_set_do() {
491 DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
492 dcqs.concatenate_logs();
493
494 _scan_state->reset();
495 }
496
497 void G1RemSet::cleanup_after_oops_into_collection_set_do() {
498 G1GCPhaseTimes* phase_times = _g1->g1_policy()->phase_times();
499
500 // Set all cards back to clean.
501 double start = os::elapsedTime();
502 _scan_state->clear_card_table(_g1->workers());
503 phase_times->record_clear_ct_time((os::elapsedTime() - start) * 1000.0);
504 }
505
506 inline void check_card_ptr(jbyte* card_ptr, G1CardTable* ct) {
507 #ifdef ASSERT
508 G1CollectedHeap* g1h = G1CollectedHeap::heap();
509 assert(g1h->is_in_exact(ct->addr_for(card_ptr)),
510 "Card at " PTR_FORMAT " index " SIZE_FORMAT " representing heap at " PTR_FORMAT " (%u) must be in committed heap",
511 p2i(card_ptr),
512 ct->index_for(ct->addr_for(card_ptr)),
513 p2i(ct->addr_for(card_ptr)),
514 g1h->addr_to_region(ct->addr_for(card_ptr)));
515 #endif
516 }
517
518 void G1RemSet::refine_card_concurrently(jbyte* card_ptr,
519 uint worker_i) {
520 assert(!_g1->is_gc_active(), "Only call concurrently");
521
522 check_card_ptr(card_ptr, _ct);
523
524 // If the card is no longer dirty, nothing to do.
525 if (*card_ptr != G1CardTable::dirty_card_val()) {
526 return;
527 }
528
529 // Construct the region representing the card.
530 HeapWord* start = _ct->addr_for(card_ptr);
531 // And find the region containing it.
532 HeapRegion* r = _g1->heap_region_containing(start);
533
534 // This check is needed for some uncommon cases where we should
|