Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 20256:b0b97602393a
8033923: Use BufferingOopClosure for G1 code root scanning
Reviewed-by: mgerdin, brutisso
author | stefank |
---|---|
date | Mon, 10 Feb 2014 12:58:09 +0100 |
parents | 9fec19bb0659 |
children | 7426d8d76305 |
comparison
equal
deleted
inserted
replaced
20255:02e61cf08ab3 | 20256:b0b97602393a |
---|---|
4863 double ext_roots_start = os::elapsedTime(); | 4863 double ext_roots_start = os::elapsedTime(); |
4864 double closure_app_time_sec = 0.0; | 4864 double closure_app_time_sec = 0.0; |
4865 | 4865 |
4866 BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots); | 4866 BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots); |
4867 | 4867 |
4868 assert(so & SO_AllCodeCache || scan_rs != NULL, "must scan code roots somehow"); | 4868 CodeBlobToOopClosure scan_code_roots(&buf_scan_non_heap_roots, true /* do_marking */); |
4869 // Walk the code cache/strong code roots w/o buffering, because StarTask | |
4870 // cannot handle unaligned oop locations. | |
4871 CodeBlobToOopClosure eager_scan_code_roots(scan_non_heap_roots, true /* do_marking */); | |
4872 | 4869 |
4873 process_strong_roots(false, // no scoping; this is parallel code | 4870 process_strong_roots(false, // no scoping; this is parallel code |
4874 so, | 4871 so, |
4875 &buf_scan_non_heap_roots, | 4872 &buf_scan_non_heap_roots, |
4876 &eager_scan_code_roots, | 4873 &scan_code_roots, |
4877 scan_klasses | 4874 scan_klasses |
4878 ); | 4875 ); |
4879 | 4876 |
4880 // Now the CM ref_processor roots. | 4877 // Now the CM ref_processor roots. |
4881 if (!_process_strong_tasks->is_task_claimed(G1H_PS_refProcessor_oops_do)) { | 4878 if (!_process_strong_tasks->is_task_claimed(G1H_PS_refProcessor_oops_do)) { |
4925 mark_strong_code_roots_ms = (os::elapsedTime() - mark_strong_roots_start) * 1000.0; | 4922 mark_strong_code_roots_ms = (os::elapsedTime() - mark_strong_roots_start) * 1000.0; |
4926 } | 4923 } |
4927 g1_policy()->phase_times()->record_strong_code_root_mark_time(worker_i, mark_strong_code_roots_ms); | 4924 g1_policy()->phase_times()->record_strong_code_root_mark_time(worker_i, mark_strong_code_roots_ms); |
4928 | 4925 |
4929 // Now scan the complement of the collection set. | 4926 // Now scan the complement of the collection set. |
4930 if (scan_rs != NULL) { | 4927 CodeBlobToOopClosure eager_scan_code_roots(scan_non_heap_roots, true /* do_marking */); |
4931 g1_rem_set()->oops_into_collection_set_do(scan_rs, &eager_scan_code_roots, worker_i); | 4928 g1_rem_set()->oops_into_collection_set_do(scan_rs, &eager_scan_code_roots, worker_i); |
4932 } | 4929 |
4933 _process_strong_tasks->all_tasks_completed(); | 4930 _process_strong_tasks->all_tasks_completed(); |
4934 } | 4931 } |
4935 | 4932 |
4936 void | 4933 void |
4937 G1CollectedHeap::g1_process_weak_roots(OopClosure* root_closure) { | 4934 G1CollectedHeap::g1_process_weak_roots(OopClosure* root_closure) { |