# HG changeset patch # User stefank # Date 1392033489 -3600 # Node ID bf13e374e024c2f8603e1e176ffb773a47ff3ec3 # Parent 76673a1bac035378e02f7a53751b12a99686181d 8033923: Use BufferingOopClosure for G1 code root scanning Reviewed-by: mgerdin, brutisso diff -r 76673a1bac03 -r bf13e374e024 hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Mon Feb 10 14:37:53 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Mon Feb 10 12:58:09 2014 +0100 @@ -5115,15 +5115,12 @@ BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots); - assert(so & SO_AllCodeCache || scan_rs != NULL, "must scan code roots somehow"); - // Walk the code cache/strong code roots w/o buffering, because StarTask - // cannot handle unaligned oop locations. - CodeBlobToOopClosure eager_scan_code_roots(scan_non_heap_roots, true /* do_marking */); + CodeBlobToOopClosure scan_code_roots(&buf_scan_non_heap_roots, true /* do_marking */); process_strong_roots(false, // no scoping; this is parallel code so, &buf_scan_non_heap_roots, - &eager_scan_code_roots, + &scan_code_roots, scan_klasses ); @@ -5177,9 +5174,9 @@ g1_policy()->phase_times()->record_strong_code_root_mark_time(worker_i, mark_strong_code_roots_ms); // Now scan the complement of the collection set. - if (scan_rs != NULL) { - g1_rem_set()->oops_into_collection_set_do(scan_rs, &eager_scan_code_roots, worker_i); - } + CodeBlobToOopClosure eager_scan_code_roots(scan_non_heap_roots, true /* do_marking */); + g1_rem_set()->oops_into_collection_set_do(scan_rs, &eager_scan_code_roots, worker_i); + _process_strong_tasks->all_tasks_completed(); }