50 { |
50 { |
51 _cset_rs_update_cl = NEW_C_HEAP_ARRAY(G1ParPushHeapRSClosure*, n_workers(), mtGC); |
51 _cset_rs_update_cl = NEW_C_HEAP_ARRAY(G1ParPushHeapRSClosure*, n_workers(), mtGC); |
52 for (uint i = 0; i < n_workers(); i++) { |
52 for (uint i = 0; i < n_workers(); i++) { |
53 _cset_rs_update_cl[i] = NULL; |
53 _cset_rs_update_cl[i] = NULL; |
54 } |
54 } |
55 if (G1SummarizeRSetStats) { |
55 if (log_is_enabled(Trace, gc, remset)) { |
56 _prev_period_summary.initialize(this); |
56 _prev_period_summary.initialize(this); |
57 } |
57 } |
58 // Initialize the card queue set used to hold cards containing |
58 // Initialize the card queue set used to hold cards containing |
59 // references into the collection set. |
59 // references into the collection set. |
60 _into_cset_dirty_card_queue_set.initialize(NULL, // Should never be called by the Java code |
60 _into_cset_dirty_card_queue_set.initialize(NULL, // Should never be called by the Java code |
107 _cards_done++; |
107 _cards_done++; |
108 cl.do_MemRegion(mr); |
108 cl.do_MemRegion(mr); |
109 } |
109 } |
110 } |
110 } |
111 |
111 |
112 void ScanRSClosure::printCard(HeapRegion* card_region, size_t card_index, |
|
113 HeapWord* card_start) { |
|
114 gclog_or_tty->print_cr("T %u Region [" PTR_FORMAT ", " PTR_FORMAT ") " |
|
115 "RS names card " SIZE_FORMAT_HEX ": " |
|
116 "[" PTR_FORMAT ", " PTR_FORMAT ")", |
|
117 _worker_i, |
|
118 p2i(card_region->bottom()), p2i(card_region->end()), |
|
119 card_index, |
|
120 p2i(card_start), p2i(card_start + G1BlockOffsetSharedArray::N_words)); |
|
121 } |
|
122 |
|
123 void ScanRSClosure::scan_strong_code_roots(HeapRegion* r) { |
112 void ScanRSClosure::scan_strong_code_roots(HeapRegion* r) { |
124 double scan_start = os::elapsedTime(); |
113 double scan_start = os::elapsedTime(); |
125 r->strong_code_roots_do(_code_root_cl); |
114 r->strong_code_roots_do(_code_root_cl); |
126 _strong_code_root_scan_time_sec += (os::elapsedTime() - scan_start); |
115 _strong_code_root_scan_time_sec += (os::elapsedTime() - scan_start); |
127 } |
116 } |
150 if (current_card >= jump_to_card + _block_size) { |
139 if (current_card >= jump_to_card + _block_size) { |
151 jump_to_card = hrrs->iter_claimed_next(_block_size); |
140 jump_to_card = hrrs->iter_claimed_next(_block_size); |
152 } |
141 } |
153 if (current_card < jump_to_card) continue; |
142 if (current_card < jump_to_card) continue; |
154 HeapWord* card_start = _g1h->bot_shared()->address_for_index(card_index); |
143 HeapWord* card_start = _g1h->bot_shared()->address_for_index(card_index); |
155 #if 0 |
|
156 gclog_or_tty->print("Rem set iteration yielded card [" PTR_FORMAT ", " PTR_FORMAT ").\n", |
|
157 card_start, card_start + CardTableModRefBS::card_size_in_words); |
|
158 #endif |
|
159 |
144 |
160 HeapRegion* card_region = _g1h->heap_region_containing(card_start); |
145 HeapRegion* card_region = _g1h->heap_region_containing(card_start); |
161 _cards++; |
146 _cards++; |
162 |
147 |
163 if (!card_region->is_on_dirty_cards_region_list()) { |
148 if (!card_region->is_on_dirty_cards_region_list()) { |
524 "invalid result at non safepoint"); |
509 "invalid result at non safepoint"); |
525 |
510 |
526 return has_refs_into_cset; |
511 return has_refs_into_cset; |
527 } |
512 } |
528 |
513 |
529 void G1RemSet::print_periodic_summary_info(const char* header) { |
514 void G1RemSet::print_periodic_summary_info(const char* header, uint period_count) { |
530 G1RemSetSummary current; |
515 if ((G1SummarizeRSetStatsPeriod > 0) && log_is_enabled(Trace, gc, remset) && |
531 current.initialize(this); |
516 (period_count % G1SummarizeRSetStatsPeriod == 0)) { |
532 |
517 |
533 _prev_period_summary.subtract_from(¤t); |
518 if (!_prev_period_summary.initialized()) { |
534 print_summary_info(&_prev_period_summary, header); |
519 _prev_period_summary.initialize(this); |
535 |
520 } |
536 _prev_period_summary.set(¤t); |
521 |
|
522 G1RemSetSummary current; |
|
523 current.initialize(this); |
|
524 _prev_period_summary.subtract_from(¤t); |
|
525 |
|
526 LogHandle(gc, remset) log; |
|
527 log.trace("%s", header); |
|
528 ResourceMark rm; |
|
529 _prev_period_summary.print_on(log.trace_stream()); |
|
530 |
|
531 _prev_period_summary.set(¤t); |
|
532 } |
537 } |
533 } |
538 |
534 |
539 void G1RemSet::print_summary_info() { |
535 void G1RemSet::print_summary_info() { |
540 G1RemSetSummary current; |
536 LogHandle(gc, remset, exit) log; |
541 current.initialize(this); |
537 if (log.is_trace()) { |
542 |
538 log.trace(" Cumulative RS summary"); |
543 print_summary_info(¤t, " Cumulative RS summary"); |
539 G1RemSetSummary current; |
544 } |
540 current.initialize(this); |
545 |
541 ResourceMark rm; |
546 void G1RemSet::print_summary_info(G1RemSetSummary * summary, const char * header) { |
542 current.print_on(log.trace_stream()); |
547 assert(summary != NULL, "just checking"); |
543 } |
548 |
|
549 if (header != NULL) { |
|
550 gclog_or_tty->print_cr("%s", header); |
|
551 } |
|
552 |
|
553 summary->print_on(gclog_or_tty); |
|
554 } |
544 } |
555 |
545 |
556 void G1RemSet::prepare_for_verify() { |
546 void G1RemSet::prepare_for_verify() { |
557 if (G1HRRSFlushLogBuffersOnVerify && |
547 if (G1HRRSFlushLogBuffersOnVerify && |
558 (VerifyBeforeGC || VerifyAfterGC) |
548 (VerifyBeforeGC || VerifyAfterGC) |