58 G1RemSetScanState* _scan_state; |
59 G1RemSetScanState* _scan_state; |
59 |
60 |
60 G1RemSetSummary _prev_period_summary; |
61 G1RemSetSummary _prev_period_summary; |
61 |
62 |
62 G1CollectedHeap* _g1h; |
63 G1CollectedHeap* _g1h; |
63 size_t _num_conc_refined_cards; // Number of cards refined concurrently to the mutator. |
|
64 |
64 |
65 G1CardTable* _ct; |
65 G1CardTable* _ct; |
66 G1Policy* _g1p; |
66 G1Policy* _g1p; |
67 G1HotCardCache* _hot_card_cache; |
67 G1HotCardCache* _hot_card_cache; |
68 |
68 |
|
69 void print_merge_heap_roots_stats(); |
69 public: |
70 public: |
70 |
71 |
71 typedef CardTable::CardValue CardValue; |
72 typedef CardTable::CardValue CardValue; |
72 // Gives an approximation on how many threads can be expected to add records to |
73 // Gives an approximation on how many threads can be expected to add records to |
73 // a remembered set in parallel. This can be used for sizing data structures to |
74 // a remembered set in parallel. This can be used for sizing data structures to |
82 G1RemSet(G1CollectedHeap* g1h, |
83 G1RemSet(G1CollectedHeap* g1h, |
83 G1CardTable* ct, |
84 G1CardTable* ct, |
84 G1HotCardCache* hot_card_cache); |
85 G1HotCardCache* hot_card_cache); |
85 ~G1RemSet(); |
86 ~G1RemSet(); |
86 |
87 |
87 // Scan all remembered sets of the collection set for references into the collection |
88 // Scan all cards in the non-collection set regions that potentially contain |
88 // set. |
89 // references into the current whole collection set. |
89 // Further applies heap_region_codeblobs on the oops of the unmarked nmethods on the strong code |
90 void scan_heap_roots(G1ParScanThreadState* pss, |
90 // roots list for each region in the collection set. |
91 uint worker_id, |
91 void scan_rem_set(G1ParScanThreadState* pss, |
92 G1GCPhaseTimes::GCParPhases scan_phase, |
92 uint worker_i, |
93 G1GCPhaseTimes::GCParPhases objcopy_phase); |
93 G1GCPhaseTimes::GCParPhases scan_phase, |
|
94 G1GCPhaseTimes::GCParPhases objcopy_phase, |
|
95 G1GCPhaseTimes::GCParPhases coderoots_phase); |
|
96 |
94 |
97 // Flush remaining refinement buffers for cross-region references to either evacuate references |
95 // Merge cards from various sources (remembered sets, hot card cache, log buffers) |
98 // into the collection set or update the remembered set. |
96 // and calculate the cards that need to be scanned later (via scan_heap_roots()). |
99 void update_rem_set(G1ParScanThreadState* pss, uint worker_i); |
97 // If initial_evacuation is set, this is called during the initial evacuation. |
|
98 void merge_heap_roots(bool initial_evacuation); |
100 |
99 |
101 // Prepare for and cleanup after scanning the remembered sets. Must be called |
100 // Prepare for and cleanup after scanning the heap roots. Must be called |
102 // once before and after in sequential code. |
101 // once before and after in sequential code. |
103 void prepare_for_scan_rem_set(); |
102 void prepare_for_scan_heap_roots(); |
104 void cleanup_after_scan_rem_set(); |
103 // Cleans the card table from temporary duplicate detection information. |
105 // Prepares the given region for remembered set scanning. |
104 void cleanup_after_scan_heap_roots(); |
106 void prepare_for_scan_rem_set(uint region_idx); |
105 // Prepares the given region for heap root scanning. |
|
106 void prepare_for_scan_heap_roots(uint region_idx); |
107 |
107 |
108 G1RemSetScanState* scan_state() const { return _scan_state; } |
108 // Do work for regions in the current increment of the collection set, scanning |
|
109 // non-card based (heap) roots. |
|
110 void scan_collection_set_regions(G1ParScanThreadState* pss, |
|
111 uint worker_id, |
|
112 G1GCPhaseTimes::GCParPhases scan_phase, |
|
113 G1GCPhaseTimes::GCParPhases coderoots_phase, |
|
114 G1GCPhaseTimes::GCParPhases objcopy_phase); |
109 |
115 |
110 // Refine the card corresponding to "card_ptr". Safe to be called concurrently |
116 // Refine the card corresponding to "card_ptr". Safe to be called concurrently |
111 // to the mutator. |
117 // to the mutator. |
112 void refine_card_concurrently(CardValue* card_ptr, |
118 void refine_card_concurrently(CardValue* card_ptr, |
113 uint worker_i); |
119 uint worker_id); |
114 |
|
115 // Refine the card corresponding to "card_ptr", applying the given closure to |
|
116 // all references found. Must only be called during gc. |
|
117 // Returns whether the card has been scanned. |
|
118 bool refine_card_during_gc(CardValue* card_ptr, G1ScanCardClosure* update_rs_cl); |
|
119 |
120 |
120 // Print accumulated summary info from the start of the VM. |
121 // Print accumulated summary info from the start of the VM. |
121 void print_summary_info(); |
122 void print_summary_info(); |
122 |
123 |
123 // Print accumulated summary info from the last time called. |
124 // Print accumulated summary info from the last time called. |
124 void print_periodic_summary_info(const char* header, uint period_count); |
125 void print_periodic_summary_info(const char* header, uint period_count); |
125 |
126 |
126 size_t num_conc_refined_cards() const { return _num_conc_refined_cards; } |
|
127 |
|
128 // Rebuilds the remembered set by scanning from bottom to TARS for all regions |
127 // Rebuilds the remembered set by scanning from bottom to TARS for all regions |
129 // using the given work gang. |
128 // using the given work gang. |
130 void rebuild_rem_set(G1ConcurrentMark* cm, WorkGang* workers, uint worker_id_offset); |
129 void rebuild_rem_set(G1ConcurrentMark* cm, WorkGang* workers, uint worker_id_offset); |
131 }; |
130 }; |
132 |
131 |