src/share/vm/memory/sharedHeap.cpp

changeset 6971
7426d8d76305
parent 6968
9fec19bb0659
child 6972
64ac9c55d666
     1.1 --- a/src/share/vm/memory/sharedHeap.cpp	Mon Feb 10 12:58:09 2014 +0100
     1.2 +++ b/src/share/vm/memory/sharedHeap.cpp	Thu Feb 13 17:44:39 2014 +0100
     1.3 @@ -141,7 +141,6 @@
     1.4  void SharedHeap::process_strong_roots(bool activate_scope,
     1.5                                        ScanningOption so,
     1.6                                        OopClosure* roots,
     1.7 -                                      CodeBlobClosure* code_roots,
     1.8                                        KlassClosure* klass_closure) {
     1.9    StrongRootsScope srs(this, activate_scope);
    1.10  
    1.11 @@ -158,15 +157,17 @@
    1.12    if (!_process_strong_tasks->is_task_claimed(SH_PS_JNIHandles_oops_do))
    1.13      JNIHandles::oops_do(roots);
    1.14  
    1.15 +  CodeBlobToOopClosure code_roots(roots, true);
    1.16 +
    1.17    CLDToOopClosure roots_from_clds(roots);
    1.18    // If we limit class scanning to SO_SystemClasses we need to apply a CLD closure to
    1.19    // CLDs which are strongly reachable from the thread stacks.
    1.20    CLDToOopClosure* roots_from_clds_p = ((so & SO_SystemClasses) ? &roots_from_clds : NULL);
    1.21    // All threads execute this; the individual threads are task groups.
    1.22    if (CollectedHeap::use_parallel_gc_threads()) {
    1.23 -    Threads::possibly_parallel_oops_do(roots, roots_from_clds_p, code_roots);
    1.24 +    Threads::possibly_parallel_oops_do(roots, roots_from_clds_p, &code_roots);
    1.25    } else {
    1.26 -    Threads::oops_do(roots, roots_from_clds_p, code_roots);
    1.27 +    Threads::oops_do(roots, roots_from_clds_p, &code_roots);
    1.28    }
    1.29  
    1.30    if (!_process_strong_tasks-> is_task_claimed(SH_PS_ObjectSynchronizer_oops_do))
    1.31 @@ -208,17 +209,17 @@
    1.32  
    1.33    if (!_process_strong_tasks->is_task_claimed(SH_PS_CodeCache_oops_do)) {
    1.34      if (so & SO_ScavengeCodeCache) {
    1.35 -      assert(code_roots != NULL, "must supply closure for code cache");
    1.36 +      assert(&code_roots != NULL, "must supply closure for code cache");
    1.37  
    1.38        // We only visit parts of the CodeCache when scavenging.
    1.39 -      CodeCache::scavenge_root_nmethods_do(code_roots);
    1.40 +      CodeCache::scavenge_root_nmethods_do(&code_roots);
    1.41      }
    1.42      if (so & SO_AllCodeCache) {
    1.43 -      assert(code_roots != NULL, "must supply closure for code cache");
    1.44 +      assert(&code_roots != NULL, "must supply closure for code cache");
    1.45  
    1.46        // CMSCollector uses this to do intermediate-strength collections.
    1.47        // We scan the entire code cache, since CodeCache::do_unloading is not called.
    1.48 -      CodeCache::blobs_do(code_roots);
    1.49 +      CodeCache::blobs_do(&code_roots);
    1.50      }
    1.51      // Verify that the code cache contents are not subject to
    1.52      // movement by a scavenging collection.
    1.53 @@ -235,12 +236,10 @@
    1.54  };
    1.55  static AlwaysTrueClosure always_true;
    1.56  
    1.57 -void SharedHeap::process_weak_roots(OopClosure* root_closure,
    1.58 -                                    CodeBlobClosure* code_roots) {
    1.59 +void SharedHeap::process_weak_roots(OopClosure* root_closure) {
    1.60    // Global (weak) JNI handles
    1.61    JNIHandles::weak_oops_do(&always_true, root_closure);
    1.62  
    1.63 -  CodeCache::blobs_do(code_roots);
    1.64    StringTable::oops_do(root_closure);
    1.65  }
    1.66  

mercurial