comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 20257:7426d8d76305

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 b0b97602393a
children b7d24d2bc8be
comparison
equal deleted inserted replaced
20256:b0b97602393a 20257:7426d8d76305
3388 assert(Thread::current()->is_VM_thread(), 3388 assert(Thread::current()->is_VM_thread(),
3389 "Expected to be executed serially by the VM thread at this point"); 3389 "Expected to be executed serially by the VM thread at this point");
3390 3390
3391 if (!silent) { gclog_or_tty->print("Roots "); } 3391 if (!silent) { gclog_or_tty->print("Roots "); }
3392 VerifyRootsClosure rootsCl(vo); 3392 VerifyRootsClosure rootsCl(vo);
3393 G1VerifyCodeRootOopClosure codeRootsCl(this, &rootsCl, vo);
3394 G1VerifyCodeRootBlobClosure blobsCl(&codeRootsCl);
3395 VerifyKlassClosure klassCl(this, &rootsCl); 3393 VerifyKlassClosure klassCl(this, &rootsCl);
3396 3394
3397 // We apply the relevant closures to all the oops in the 3395 // We apply the relevant closures to all the oops in the
3398 // system dictionary, the string table and the code cache. 3396 // system dictionary, class loader data graph and the string table.
3399 const int so = SO_AllClasses | SO_Strings | SO_AllCodeCache; 3397 // Don't verify the code cache here, since it's verified below.
3398 const int so = SO_AllClasses | SO_Strings;
3400 3399
3401 // Need cleared claim bits for the strong roots processing 3400 // Need cleared claim bits for the strong roots processing
3402 ClassLoaderDataGraph::clear_claimed_marks(); 3401 ClassLoaderDataGraph::clear_claimed_marks();
3403 3402
3404 process_strong_roots(true, // activate StrongRootsScope 3403 process_strong_roots(true, // activate StrongRootsScope
3405 ScanningOption(so), // roots scanning options 3404 ScanningOption(so), // roots scanning options
3406 &rootsCl, 3405 &rootsCl,
3407 &blobsCl,
3408 &klassCl 3406 &klassCl
3409 ); 3407 );
3408
3409 // Verify the nmethods in the code cache.
3410 G1VerifyCodeRootOopClosure codeRootsCl(this, &rootsCl, vo);
3411 G1VerifyCodeRootBlobClosure blobsCl(&codeRootsCl);
3412 CodeCache::blobs_do(&blobsCl);
3410 3413
3411 bool failures = rootsCl.failures() || codeRootsCl.failures(); 3414 bool failures = rootsCl.failures() || codeRootsCl.failures();
3412 3415
3413 if (vo != VerifyOption_G1UseMarkWord) { 3416 if (vo != VerifyOption_G1UseMarkWord) {
3414 // If we're verifying during a full GC then the region sets 3417 // If we're verifying during a full GC then the region sets
4863 double ext_roots_start = os::elapsedTime(); 4866 double ext_roots_start = os::elapsedTime();
4864 double closure_app_time_sec = 0.0; 4867 double closure_app_time_sec = 0.0;
4865 4868
4866 BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots); 4869 BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots);
4867 4870
4868 CodeBlobToOopClosure scan_code_roots(&buf_scan_non_heap_roots, true /* do_marking */);
4869
4870 process_strong_roots(false, // no scoping; this is parallel code 4871 process_strong_roots(false, // no scoping; this is parallel code
4871 so, 4872 so,
4872 &buf_scan_non_heap_roots, 4873 &buf_scan_non_heap_roots,
4873 &scan_code_roots,
4874 scan_klasses 4874 scan_klasses
4875 ); 4875 );
4876 4876
4877 // Now the CM ref_processor roots. 4877 // Now the CM ref_processor roots.
4878 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)) {
4926 // Now scan the complement of the collection set. 4926 // Now scan the complement of the collection set.
4927 CodeBlobToOopClosure eager_scan_code_roots(scan_non_heap_roots, true /* do_marking */); 4927 CodeBlobToOopClosure eager_scan_code_roots(scan_non_heap_roots, true /* do_marking */);
4928 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);
4929 4929
4930 _process_strong_tasks->all_tasks_completed(); 4930 _process_strong_tasks->all_tasks_completed();
4931 }
4932
4933 void
4934 G1CollectedHeap::g1_process_weak_roots(OopClosure* root_closure) {
4935 CodeBlobToOopClosure roots_in_blobs(root_closure, /*do_marking=*/ false);
4936 SharedHeap::process_weak_roots(root_closure, &roots_in_blobs);
4937 } 4931 }
4938 4932
4939 class G1StringSymbolTableUnlinkTask : public AbstractGangTask { 4933 class G1StringSymbolTableUnlinkTask : public AbstractGangTask {
4940 private: 4934 private:
4941 BoolObjectClosure* _is_alive; 4935 BoolObjectClosure* _is_alive;