360 _g1h(g1h),
361 _vo(vo),
362 _failures(false),
363 _hrclaimer(g1h->workers()->active_workers()) {}
364
365 bool failures() {
366 return _failures;
367 }
368
369 void work(uint worker_id) {
370 HandleMark hm;
371 VerifyRegionClosure blk(true, _vo);
372 _g1h->heap_region_par_iterate_from_worker_offset(&blk, &_hrclaimer, worker_id);
373 if (blk.failures()) {
374 _failures = true;
375 }
376 }
377 };
378
379 void G1HeapVerifier::parse_verification_type(const char* type) {
380 if (strcmp(type, "young") == 0) {
381 enable_verification_type(G1VerifyYoung);
382 } else if (strcmp(type, "mixed") == 0) {
383 enable_verification_type(G1VerifyMixed);
384 } else if (strcmp(type, "remark") == 0) {
385 enable_verification_type(G1VerifyRemark);
386 } else if (strcmp(type, "cleanup") == 0) {
387 enable_verification_type(G1VerifyCleanup);
388 } else if (strcmp(type, "full") == 0) {
389 enable_verification_type(G1VerifyFull);
390 } else {
391 log_warning(gc, verify)("VerifyGCType: '%s' is unknown. Available types are: young, mixed, remark, cleanup and full", type);
392 }
393 }
394
395 void G1HeapVerifier::enable_verification_type(G1VerifyType type) {
396 // First enable will clear _enabled_verification_types.
397 if (_enabled_verification_types == G1VerifyAll) {
398 _enabled_verification_types = type;
399 } else {
400 _enabled_verification_types |= type;
401 }
402 }
403
404 bool G1HeapVerifier::should_verify(G1VerifyType type) {
405 return (_enabled_verification_types & type) == type;
406 }
407
408 void G1HeapVerifier::verify(VerifyOption vo) {
409 if (!SafepointSynchronize::is_at_safepoint()) {
410 log_info(gc, verify)("Skipping verification. Not at safepoint.");
411 }
|
360 _g1h(g1h),
361 _vo(vo),
362 _failures(false),
363 _hrclaimer(g1h->workers()->active_workers()) {}
364
365 bool failures() {
366 return _failures;
367 }
368
369 void work(uint worker_id) {
370 HandleMark hm;
371 VerifyRegionClosure blk(true, _vo);
372 _g1h->heap_region_par_iterate_from_worker_offset(&blk, &_hrclaimer, worker_id);
373 if (blk.failures()) {
374 _failures = true;
375 }
376 }
377 };
378
379 void G1HeapVerifier::parse_verification_type(const char* type) {
380 if (strcmp(type, "young-only") == 0) {
381 enable_verification_type(G1VerifyYoungOnly);
382 } else if (strcmp(type, "initial-mark") == 0) {
383 enable_verification_type(G1VerifyInitialMark);
384 } else if (strcmp(type, "mixed") == 0) {
385 enable_verification_type(G1VerifyMixed);
386 } else if (strcmp(type, "remark") == 0) {
387 enable_verification_type(G1VerifyRemark);
388 } else if (strcmp(type, "cleanup") == 0) {
389 enable_verification_type(G1VerifyCleanup);
390 } else if (strcmp(type, "full") == 0) {
391 enable_verification_type(G1VerifyFull);
392 } else {
393 log_warning(gc, verify)("VerifyGCType: '%s' is unknown. Available types are: "
394 "young-only, initial-mark, mixed, remark, cleanup and full", type);
395 }
396 }
397
398 void G1HeapVerifier::enable_verification_type(G1VerifyType type) {
399 // First enable will clear _enabled_verification_types.
400 if (_enabled_verification_types == G1VerifyAll) {
401 _enabled_verification_types = type;
402 } else {
403 _enabled_verification_types |= type;
404 }
405 }
406
407 bool G1HeapVerifier::should_verify(G1VerifyType type) {
408 return (_enabled_verification_types & type) == type;
409 }
410
411 void G1HeapVerifier::verify(VerifyOption vo) {
412 if (!SafepointSynchronize::is_at_safepoint()) {
413 log_info(gc, verify)("Skipping verification. Not at safepoint.");
414 }
|