comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 14357:79aa45434291

8033923: Use BufferingOopClosure for G1 code root scanning Reviewed-by: mgerdin, brutisso
author stefank
date Mon, 10 Feb 2014 12:58:09 +0100
parents 7c41aaa3929b
children d166675568f6
comparison
equal deleted inserted replaced
14356:553d15cdfec5 14357:79aa45434291
5113 double ext_roots_start = os::elapsedTime(); 5113 double ext_roots_start = os::elapsedTime();
5114 double closure_app_time_sec = 0.0; 5114 double closure_app_time_sec = 0.0;
5115 5115
5116 BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots); 5116 BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots);
5117 5117
5118 assert(so & SO_AllCodeCache || scan_rs != NULL, "must scan code roots somehow"); 5118 CodeBlobToOopClosure scan_code_roots(&buf_scan_non_heap_roots, true /* do_marking */);
5119 // Walk the code cache/strong code roots w/o buffering, because StarTask
5120 // cannot handle unaligned oop locations.
5121 CodeBlobToOopClosure eager_scan_code_roots(scan_non_heap_roots, true /* do_marking */);
5122 5119
5123 process_strong_roots(false, // no scoping; this is parallel code 5120 process_strong_roots(false, // no scoping; this is parallel code
5124 so, 5121 so,
5125 &buf_scan_non_heap_roots, 5122 &buf_scan_non_heap_roots,
5126 &eager_scan_code_roots, 5123 &scan_code_roots,
5127 scan_klasses 5124 scan_klasses
5128 ); 5125 );
5129 5126
5130 // Now the CM ref_processor roots. 5127 // Now the CM ref_processor roots.
5131 if (!_process_strong_tasks->is_task_claimed(G1H_PS_refProcessor_oops_do)) { 5128 if (!_process_strong_tasks->is_task_claimed(G1H_PS_refProcessor_oops_do)) {
5175 mark_strong_code_roots_ms = (os::elapsedTime() - mark_strong_roots_start) * 1000.0; 5172 mark_strong_code_roots_ms = (os::elapsedTime() - mark_strong_roots_start) * 1000.0;
5176 } 5173 }
5177 g1_policy()->phase_times()->record_strong_code_root_mark_time(worker_i, mark_strong_code_roots_ms); 5174 g1_policy()->phase_times()->record_strong_code_root_mark_time(worker_i, mark_strong_code_roots_ms);
5178 5175
5179 // Now scan the complement of the collection set. 5176 // Now scan the complement of the collection set.
5180 if (scan_rs != NULL) { 5177 CodeBlobToOopClosure eager_scan_code_roots(scan_non_heap_roots, true /* do_marking */);
5181 g1_rem_set()->oops_into_collection_set_do(scan_rs, &eager_scan_code_roots, worker_i); 5178 g1_rem_set()->oops_into_collection_set_do(scan_rs, &eager_scan_code_roots, worker_i);
5182 } 5179
5183 _process_strong_tasks->all_tasks_completed(); 5180 _process_strong_tasks->all_tasks_completed();
5184 } 5181 }
5185 5182
5186 void 5183 void
5187 G1CollectedHeap::g1_process_weak_roots(OopClosure* root_closure) { 5184 G1CollectedHeap::g1_process_weak_roots(OopClosure* root_closure) {