comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 14466:d166675568f6

8034761: Remove the do_code_roots parameter from process_strong_roots Reviewed-by: tschatzl, mgerdin, jmasa
author stefank
date Thu, 13 Feb 2014 17:44:39 +0100
parents 79aa45434291
children e9d5c28e5059
comparison
equal deleted inserted replaced
14359:f7f0c6a77d6d 14466:d166675568f6
3392 assert(Thread::current()->is_VM_thread(), 3392 assert(Thread::current()->is_VM_thread(),
3393 "Expected to be executed serially by the VM thread at this point"); 3393 "Expected to be executed serially by the VM thread at this point");
3394 3394
3395 if (!silent) { gclog_or_tty->print("Roots "); } 3395 if (!silent) { gclog_or_tty->print("Roots "); }
3396 VerifyRootsClosure rootsCl(vo); 3396 VerifyRootsClosure rootsCl(vo);
3397 G1VerifyCodeRootOopClosure codeRootsCl(this, &rootsCl, vo);
3398 G1VerifyCodeRootBlobClosure blobsCl(&codeRootsCl);
3399 VerifyKlassClosure klassCl(this, &rootsCl); 3397 VerifyKlassClosure klassCl(this, &rootsCl);
3400 3398
3401 // We apply the relevant closures to all the oops in the 3399 // We apply the relevant closures to all the oops in the
3402 // system dictionary, the string table and the code cache. 3400 // system dictionary, class loader data graph and the string table.
3403 const int so = SO_AllClasses | SO_Strings | SO_AllCodeCache; 3401 // Don't verify the code cache here, since it's verified below.
3402 const int so = SO_AllClasses | SO_Strings;
3404 3403
3405 // Need cleared claim bits for the strong roots processing 3404 // Need cleared claim bits for the strong roots processing
3406 ClassLoaderDataGraph::clear_claimed_marks(); 3405 ClassLoaderDataGraph::clear_claimed_marks();
3407 3406
3408 process_strong_roots(true, // activate StrongRootsScope 3407 process_strong_roots(true, // activate StrongRootsScope
3409 ScanningOption(so), // roots scanning options 3408 ScanningOption(so), // roots scanning options
3410 &rootsCl, 3409 &rootsCl,
3411 &blobsCl,
3412 &klassCl 3410 &klassCl
3413 ); 3411 );
3412
3413 // Verify the nmethods in the code cache.
3414 G1VerifyCodeRootOopClosure codeRootsCl(this, &rootsCl, vo);
3415 G1VerifyCodeRootBlobClosure blobsCl(&codeRootsCl);
3416 CodeCache::blobs_do(&blobsCl);
3414 3417
3415 bool failures = rootsCl.failures() || codeRootsCl.failures(); 3418 bool failures = rootsCl.failures() || codeRootsCl.failures();
3416 3419
3417 if (vo != VerifyOption_G1UseMarkWord) { 3420 if (vo != VerifyOption_G1UseMarkWord) {
3418 // If we're verifying during a full GC then the region sets 3421 // If we're verifying during a full GC then the region sets
5113 double ext_roots_start = os::elapsedTime(); 5116 double ext_roots_start = os::elapsedTime();
5114 double closure_app_time_sec = 0.0; 5117 double closure_app_time_sec = 0.0;
5115 5118
5116 BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots); 5119 BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots);
5117 5120
5118 CodeBlobToOopClosure scan_code_roots(&buf_scan_non_heap_roots, true /* do_marking */);
5119
5120 process_strong_roots(false, // no scoping; this is parallel code 5121 process_strong_roots(false, // no scoping; this is parallel code
5121 so, 5122 so,
5122 &buf_scan_non_heap_roots, 5123 &buf_scan_non_heap_roots,
5123 &scan_code_roots,
5124 scan_klasses 5124 scan_klasses
5125 ); 5125 );
5126 5126
5127 // Now the CM ref_processor roots. 5127 // Now the CM ref_processor roots.
5128 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)) {
5176 // Now scan the complement of the collection set. 5176 // Now scan the complement of the collection set.
5177 CodeBlobToOopClosure eager_scan_code_roots(scan_non_heap_roots, true /* do_marking */); 5177 CodeBlobToOopClosure eager_scan_code_roots(scan_non_heap_roots, true /* do_marking */);
5178 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);
5179 5179
5180 _process_strong_tasks->all_tasks_completed(); 5180 _process_strong_tasks->all_tasks_completed();
5181 }
5182
5183 void
5184 G1CollectedHeap::g1_process_weak_roots(OopClosure* root_closure) {
5185 CodeBlobToOopClosure roots_in_blobs(root_closure, /*do_marking=*/ false);
5186 SharedHeap::process_weak_roots(root_closure, &roots_in_blobs);
5187 } 5181 }
5188 5182
5189 class G1StringSymbolTableUnlinkTask : public AbstractGangTask { 5183 class G1StringSymbolTableUnlinkTask : public AbstractGangTask {
5190 private: 5184 private:
5191 BoolObjectClosure* _is_alive; 5185 BoolObjectClosure* _is_alive;