comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 20254:9fec19bb0659

8032379: Remove the is_scavenging flag to process_strong_roots Summary: Refactor the strong root processing to avoid using a boolean in addition to the ScanOption enum. Reviewed-by: stefank, tschatzl, ehelin, jmasa
author mgerdin
date Tue, 14 Jan 2014 16:40:33 +0100
parents a2328cbebb23
children b0b97602393a
comparison
equal deleted inserted replaced
20253:731e8175d53f 20254:9fec19bb0659
3394 G1VerifyCodeRootBlobClosure blobsCl(&codeRootsCl); 3394 G1VerifyCodeRootBlobClosure blobsCl(&codeRootsCl);
3395 VerifyKlassClosure klassCl(this, &rootsCl); 3395 VerifyKlassClosure klassCl(this, &rootsCl);
3396 3396
3397 // We apply the relevant closures to all the oops in the 3397 // We apply the relevant closures to all the oops in the
3398 // system dictionary, the string table and the code cache. 3398 // system dictionary, the string table and the code cache.
3399 const int so = SO_AllClasses | SO_Strings | SO_CodeCache; 3399 const int so = SO_AllClasses | SO_Strings | SO_AllCodeCache;
3400 3400
3401 // Need cleared claim bits for the strong roots processing 3401 // Need cleared claim bits for the strong roots processing
3402 ClassLoaderDataGraph::clear_claimed_marks(); 3402 ClassLoaderDataGraph::clear_claimed_marks();
3403 3403
3404 process_strong_roots(true, // activate StrongRootsScope 3404 process_strong_roots(true, // activate StrongRootsScope
3405 false, // we set "is scavenging" to false,
3406 // so we don't reset the dirty cards.
3407 ScanningOption(so), // roots scanning options 3405 ScanningOption(so), // roots scanning options
3408 &rootsCl, 3406 &rootsCl,
3409 &blobsCl, 3407 &blobsCl,
3410 &klassCl 3408 &klassCl
3411 ); 3409 );
4865 double ext_roots_start = os::elapsedTime(); 4863 double ext_roots_start = os::elapsedTime();
4866 double closure_app_time_sec = 0.0; 4864 double closure_app_time_sec = 0.0;
4867 4865
4868 BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots); 4866 BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots);
4869 4867
4870 assert(so & SO_CodeCache || scan_rs != NULL, "must scan code roots somehow"); 4868 assert(so & SO_AllCodeCache || scan_rs != NULL, "must scan code roots somehow");
4871 // Walk the code cache/strong code roots w/o buffering, because StarTask 4869 // Walk the code cache/strong code roots w/o buffering, because StarTask
4872 // cannot handle unaligned oop locations. 4870 // cannot handle unaligned oop locations.
4873 CodeBlobToOopClosure eager_scan_code_roots(scan_non_heap_roots, true /* do_marking */); 4871 CodeBlobToOopClosure eager_scan_code_roots(scan_non_heap_roots, true /* do_marking */);
4874 4872
4875 process_strong_roots(false, // no scoping; this is parallel code 4873 process_strong_roots(false, // no scoping; this is parallel code
4876 is_scavenging, so, 4874 so,
4877 &buf_scan_non_heap_roots, 4875 &buf_scan_non_heap_roots,
4878 &eager_scan_code_roots, 4876 &eager_scan_code_roots,
4879 scan_klasses 4877 scan_klasses
4880 ); 4878 );
4881 4879
4919 // the entire code cache, we need to mark the oops in the 4917 // the entire code cache, we need to mark the oops in the
4920 // strong code root lists for the regions that are not in 4918 // strong code root lists for the regions that are not in
4921 // the collection set. 4919 // the collection set.
4922 // Note all threads participate in this set of root tasks. 4920 // Note all threads participate in this set of root tasks.
4923 double mark_strong_code_roots_ms = 0.0; 4921 double mark_strong_code_roots_ms = 0.0;
4924 if (g1_policy()->during_initial_mark_pause() && !(so & SO_CodeCache)) { 4922 if (g1_policy()->during_initial_mark_pause() && !(so & SO_AllCodeCache)) {
4925 double mark_strong_roots_start = os::elapsedTime(); 4923 double mark_strong_roots_start = os::elapsedTime();
4926 mark_strong_code_roots(worker_i); 4924 mark_strong_code_roots(worker_i);
4927 mark_strong_code_roots_ms = (os::elapsedTime() - mark_strong_roots_start) * 1000.0; 4925 mark_strong_code_roots_ms = (os::elapsedTime() - mark_strong_roots_start) * 1000.0;
4928 } 4926 }
4929 g1_policy()->phase_times()->record_strong_code_root_mark_time(worker_i, mark_strong_code_roots_ms); 4927 g1_policy()->phase_times()->record_strong_code_root_mark_time(worker_i, mark_strong_code_roots_ms);