272 G1PretouchTask cl(page_start(start_page), bounded_end_addr(start_page + size_in_pages), _page_size);
273
274 if (pretouch_gang != NULL) {
275 size_t num_chunks = MAX2((size_t)1, size_in_pages * _page_size / MAX2(G1PretouchTask::chunk_size(), _page_size));
276
277 uint num_workers = MIN2((uint)num_chunks, pretouch_gang->active_workers());
278 log_debug(gc, heap)("Running %s with %u workers for " SIZE_FORMAT " work units pre-touching " SIZE_FORMAT "B.",
279 cl.name(), num_workers, num_chunks, size_in_pages * _page_size);
280 pretouch_gang->run_task(&cl, num_workers);
281 } else {
282 log_debug(gc, heap)("Running %s pre-touching " SIZE_FORMAT "B.",
283 cl.name(), size_in_pages * _page_size);
284 cl.work(0);
285 }
286 }
287
288 bool G1PageBasedVirtualSpace::contains(const void* p) const {
289 return _low_boundary <= (const char*) p && (const char*) p < _high_boundary;
290 }
291
292 #ifndef PRODUCT
293 void G1PageBasedVirtualSpace::print_on(outputStream* out) {
294 out->print ("Virtual space:");
295 if (_special) out->print(" (pinned in memory)");
296 out->cr();
297 out->print_cr(" - committed: " SIZE_FORMAT, committed_size());
298 out->print_cr(" - reserved: " SIZE_FORMAT, reserved_size());
299 out->print_cr(" - preferred page size: " SIZE_FORMAT, _page_size);
300 out->print_cr(" - [low_b, high_b]: [" PTR_FORMAT ", " PTR_FORMAT "]", p2i(_low_boundary), p2i(_high_boundary));
301 }
302
303 void G1PageBasedVirtualSpace::print() {
304 print_on(tty);
305 }
306 #endif
|
272 G1PretouchTask cl(page_start(start_page), bounded_end_addr(start_page + size_in_pages), _page_size);
273
274 if (pretouch_gang != NULL) {
275 size_t num_chunks = MAX2((size_t)1, size_in_pages * _page_size / MAX2(G1PretouchTask::chunk_size(), _page_size));
276
277 uint num_workers = MIN2((uint)num_chunks, pretouch_gang->active_workers());
278 log_debug(gc, heap)("Running %s with %u workers for " SIZE_FORMAT " work units pre-touching " SIZE_FORMAT "B.",
279 cl.name(), num_workers, num_chunks, size_in_pages * _page_size);
280 pretouch_gang->run_task(&cl, num_workers);
281 } else {
282 log_debug(gc, heap)("Running %s pre-touching " SIZE_FORMAT "B.",
283 cl.name(), size_in_pages * _page_size);
284 cl.work(0);
285 }
286 }
287
288 bool G1PageBasedVirtualSpace::contains(const void* p) const {
289 return _low_boundary <= (const char*) p && (const char*) p < _high_boundary;
290 }
291
292 size_t G1PageBasedVirtualSpace::page_size() const {
293 assert(_page_size > 0, "Page size is not yet initialized.");
294 return _page_size;
295 }
296
297 #ifndef PRODUCT
298 void G1PageBasedVirtualSpace::print_on(outputStream* out) {
299 out->print ("Virtual space:");
300 if (_special) out->print(" (pinned in memory)");
301 out->cr();
302 out->print_cr(" - committed: " SIZE_FORMAT, committed_size());
303 out->print_cr(" - reserved: " SIZE_FORMAT, reserved_size());
304 out->print_cr(" - preferred page size: " SIZE_FORMAT, _page_size);
305 out->print_cr(" - [low_b, high_b]: [" PTR_FORMAT ", " PTR_FORMAT "]", p2i(_low_boundary), p2i(_high_boundary));
306 }
307
308 void G1PageBasedVirtualSpace::print() {
309 print_on(tty);
310 }
311 #endif
|