comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 14308:870aedf4ba4f

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 c685ef164975
children 1e1c8d358b52
comparison
equal deleted inserted replaced
14307:7ab52431bc9f 14308:870aedf4ba4f
3390 G1VerifyCodeRootBlobClosure blobsCl(&codeRootsCl); 3390 G1VerifyCodeRootBlobClosure blobsCl(&codeRootsCl);
3391 VerifyKlassClosure klassCl(this, &rootsCl); 3391 VerifyKlassClosure klassCl(this, &rootsCl);
3392 3392
3393 // We apply the relevant closures to all the oops in the 3393 // We apply the relevant closures to all the oops in the
3394 // system dictionary, the string table and the code cache. 3394 // system dictionary, the string table and the code cache.
3395 const int so = SO_AllClasses | SO_Strings | SO_CodeCache; 3395 const int so = SO_AllClasses | SO_Strings | SO_AllCodeCache;
3396 3396
3397 // Need cleared claim bits for the strong roots processing 3397 // Need cleared claim bits for the strong roots processing
3398 ClassLoaderDataGraph::clear_claimed_marks(); 3398 ClassLoaderDataGraph::clear_claimed_marks();
3399 3399
3400 process_strong_roots(true, // activate StrongRootsScope 3400 process_strong_roots(true, // activate StrongRootsScope
3401 false, // we set "is scavenging" to false,
3402 // so we don't reset the dirty cards.
3403 ScanningOption(so), // roots scanning options 3401 ScanningOption(so), // roots scanning options
3404 &rootsCl, 3402 &rootsCl,
3405 &blobsCl, 3403 &blobsCl,
3406 &klassCl 3404 &klassCl
3407 ); 3405 );
5104 double ext_roots_start = os::elapsedTime(); 5102 double ext_roots_start = os::elapsedTime();
5105 double closure_app_time_sec = 0.0; 5103 double closure_app_time_sec = 0.0;
5106 5104
5107 BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots); 5105 BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots);
5108 5106
5109 assert(so & SO_CodeCache || scan_rs != NULL, "must scan code roots somehow"); 5107 assert(so & SO_AllCodeCache || scan_rs != NULL, "must scan code roots somehow");
5110 // Walk the code cache/strong code roots w/o buffering, because StarTask 5108 // Walk the code cache/strong code roots w/o buffering, because StarTask
5111 // cannot handle unaligned oop locations. 5109 // cannot handle unaligned oop locations.
5112 CodeBlobToOopClosure eager_scan_code_roots(scan_non_heap_roots, true /* do_marking */); 5110 CodeBlobToOopClosure eager_scan_code_roots(scan_non_heap_roots, true /* do_marking */);
5113 5111
5114 process_strong_roots(false, // no scoping; this is parallel code 5112 process_strong_roots(false, // no scoping; this is parallel code
5115 is_scavenging, so, 5113 so,
5116 &buf_scan_non_heap_roots, 5114 &buf_scan_non_heap_roots,
5117 &eager_scan_code_roots, 5115 &eager_scan_code_roots,
5118 scan_klasses 5116 scan_klasses
5119 ); 5117 );
5120 5118
5158 // the entire code cache, we need to mark the oops in the 5156 // the entire code cache, we need to mark the oops in the
5159 // strong code root lists for the regions that are not in 5157 // strong code root lists for the regions that are not in
5160 // the collection set. 5158 // the collection set.
5161 // Note all threads participate in this set of root tasks. 5159 // Note all threads participate in this set of root tasks.
5162 double mark_strong_code_roots_ms = 0.0; 5160 double mark_strong_code_roots_ms = 0.0;
5163 if (g1_policy()->during_initial_mark_pause() && !(so & SO_CodeCache)) { 5161 if (g1_policy()->during_initial_mark_pause() && !(so & SO_AllCodeCache)) {
5164 double mark_strong_roots_start = os::elapsedTime(); 5162 double mark_strong_roots_start = os::elapsedTime();
5165 mark_strong_code_roots(worker_i); 5163 mark_strong_code_roots(worker_i);
5166 mark_strong_code_roots_ms = (os::elapsedTime() - mark_strong_roots_start) * 1000.0; 5164 mark_strong_code_roots_ms = (os::elapsedTime() - mark_strong_roots_start) * 1000.0;
5167 } 5165 }
5168 g1_policy()->phase_times()->record_strong_code_root_mark_time(worker_i, mark_strong_code_roots_ms); 5166 g1_policy()->phase_times()->record_strong_code_root_mark_time(worker_i, mark_strong_code_roots_ms);