2228 // * For both types of GC:
2229 // * Discovery is atomic - i.e. not concurrent.
2230 // * Reference discovery will not need a barrier.
2231
2232 SharedHeap::ref_processing_init();
2233 MemRegion mr = reserved_region();
2234
2235 // Concurrent Mark ref processor
2236 _ref_processor_cm =
2237 new ReferenceProcessor(mr, // span
2238 ParallelRefProcEnabled && (ParallelGCThreads > 1),
2239 // mt processing
2240 (int) ParallelGCThreads,
2241 // degree of mt processing
2242 (ParallelGCThreads > 1) || (ConcGCThreads > 1),
2243 // mt discovery
2244 (int) MAX2(ParallelGCThreads, ConcGCThreads),
2245 // degree of mt discovery
2246 false,
2247 // Reference discovery is not atomic
2248 &_is_alive_closure_cm,
2249 // is alive closure
2250 // (for efficiency/performance)
2251 true);
2252 // Setting next fields of discovered
2253 // lists requires a barrier.
2254
2255 // STW ref processor
2256 _ref_processor_stw =
2257 new ReferenceProcessor(mr, // span
2258 ParallelRefProcEnabled && (ParallelGCThreads > 1),
2259 // mt processing
2260 MAX2((int)ParallelGCThreads, 1),
2261 // degree of mt processing
2262 (ParallelGCThreads > 1),
2263 // mt discovery
2264 MAX2((int)ParallelGCThreads, 1),
2265 // degree of mt discovery
2266 true,
2267 // Reference discovery is atomic
2268 &_is_alive_closure_stw,
2269 // is alive closure
2270 // (for efficiency/performance)
2271 false);
2272 // Setting next fields of discovered
2273 // lists does not require a barrier.
2274 }
2275
2276 size_t G1CollectedHeap::capacity() const {
2277 return _g1_committed.byte_size();
2278 }
2279
2280 void G1CollectedHeap::reset_gc_time_stamps(HeapRegion* hr) {
2281 assert(!hr->continuesHumongous(), "pre-condition");
2282 hr->reset_gc_time_stamp();
2283 if (hr->startsHumongous()) {
2284 uint first_index = hr->hrs_index() + 1;
2285 uint last_index = hr->last_hc_index();
2286 for (uint i = first_index; i < last_index; i += 1) {
2287 HeapRegion* chr = region_at(i);
2288 assert(chr->continuesHumongous(), "sanity");
2289 chr->reset_gc_time_stamp();
2290 }
2291 }
2292 }
2293
|
2228 // * For both types of GC:
2229 // * Discovery is atomic - i.e. not concurrent.
2230 // * Reference discovery will not need a barrier.
2231
2232 SharedHeap::ref_processing_init();
2233 MemRegion mr = reserved_region();
2234
2235 // Concurrent Mark ref processor
2236 _ref_processor_cm =
2237 new ReferenceProcessor(mr, // span
2238 ParallelRefProcEnabled && (ParallelGCThreads > 1),
2239 // mt processing
2240 (int) ParallelGCThreads,
2241 // degree of mt processing
2242 (ParallelGCThreads > 1) || (ConcGCThreads > 1),
2243 // mt discovery
2244 (int) MAX2(ParallelGCThreads, ConcGCThreads),
2245 // degree of mt discovery
2246 false,
2247 // Reference discovery is not atomic
2248 &_is_alive_closure_cm);
2249 // is alive closure
2250 // (for efficiency/performance)
2251
2252 // STW ref processor
2253 _ref_processor_stw =
2254 new ReferenceProcessor(mr, // span
2255 ParallelRefProcEnabled && (ParallelGCThreads > 1),
2256 // mt processing
2257 MAX2((int)ParallelGCThreads, 1),
2258 // degree of mt processing
2259 (ParallelGCThreads > 1),
2260 // mt discovery
2261 MAX2((int)ParallelGCThreads, 1),
2262 // degree of mt discovery
2263 true,
2264 // Reference discovery is atomic
2265 &_is_alive_closure_stw);
2266 // is alive closure
2267 // (for efficiency/performance)
2268 }
2269
2270 size_t G1CollectedHeap::capacity() const {
2271 return _g1_committed.byte_size();
2272 }
2273
2274 void G1CollectedHeap::reset_gc_time_stamps(HeapRegion* hr) {
2275 assert(!hr->continuesHumongous(), "pre-condition");
2276 hr->reset_gc_time_stamp();
2277 if (hr->startsHumongous()) {
2278 uint first_index = hr->hrs_index() + 1;
2279 uint last_index = hr->last_hc_index();
2280 for (uint i = first_index; i < last_index; i += 1) {
2281 HeapRegion* chr = region_at(i);
2282 assert(chr->continuesHumongous(), "sanity");
2283 chr->reset_gc_time_stamp();
2284 }
2285 }
2286 }
2287
|