42 |
42 |
43 _n_hot = 0; |
43 _n_hot = 0; |
44 _hot_cache_idx = 0; |
44 _hot_cache_idx = 0; |
45 |
45 |
46 // For refining the cards in the hot cache in parallel |
46 // For refining the cards in the hot cache in parallel |
47 int n_workers = (ParallelGCThreads > 0 ? |
47 uint n_workers = (ParallelGCThreads > 0 ? |
48 _g1h->workers()->total_workers() : 1); |
48 _g1h->workers()->total_workers() : 1); |
49 _hot_cache_par_chunk_size = MAX2(1, _hot_cache_size / n_workers); |
49 _hot_cache_par_chunk_size = MAX2(1, _hot_cache_size / (int)n_workers); |
50 _hot_cache_par_claimed_idx = 0; |
50 _hot_cache_par_claimed_idx = 0; |
51 |
51 |
52 _card_counts.initialize(); |
52 _card_counts.initialize(); |
53 } |
53 } |
54 } |
54 } |
87 _n_hot++; |
87 _n_hot++; |
88 |
88 |
89 return res; |
89 return res; |
90 } |
90 } |
91 |
91 |
92 void G1HotCardCache::drain(int worker_i, |
92 void G1HotCardCache::drain(uint worker_i, |
93 G1RemSet* g1rs, |
93 G1RemSet* g1rs, |
94 DirtyCardQueue* into_cset_dcq) { |
94 DirtyCardQueue* into_cset_dcq) { |
95 if (!default_use_cache()) { |
95 if (!default_use_cache()) { |
96 assert(_hot_cache == NULL, "Logic"); |
96 assert(_hot_cache == NULL, "Logic"); |
97 return; |
97 return; |
120 // The only time we care about recording cards that contain |
120 // The only time we care about recording cards that contain |
121 // references that point into the collection set is during |
121 // references that point into the collection set is during |
122 // RSet updating while within an evacuation pause. |
122 // RSet updating while within an evacuation pause. |
123 // In this case worker_i should be the id of a GC worker thread |
123 // In this case worker_i should be the id of a GC worker thread |
124 assert(SafepointSynchronize::is_at_safepoint(), "Should be at a safepoint"); |
124 assert(SafepointSynchronize::is_at_safepoint(), "Should be at a safepoint"); |
125 assert(worker_i < (int) (ParallelGCThreads == 0 ? 1 : ParallelGCThreads), |
125 assert(worker_i < (ParallelGCThreads == 0 ? 1 : ParallelGCThreads), |
126 err_msg("incorrect worker id: "INT32_FORMAT, worker_i)); |
126 err_msg("incorrect worker id: "UINT32_FORMAT, worker_i)); |
127 |
127 |
128 into_cset_dcq->enqueue(card_ptr); |
128 into_cset_dcq->enqueue(card_ptr); |
129 } |
129 } |
130 } |
130 } |
131 } |
131 } |