hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp
changeset 3908 24b55ad4c228
parent 670 ddf3e9583f2f
child 5547 f4b087cbb361
equal deleted inserted replaced
3906:6767b0c66883 3908:24b55ad4c228
    64       break;
    64       break;
    65 
    65 
    66     case threads:
    66     case threads:
    67     {
    67     {
    68       ResourceMark rm;
    68       ResourceMark rm;
    69       Threads::oops_do(&roots_closure);
    69       Threads::oops_do(&roots_closure, NULL);
    70     }
    70     }
    71     break;
    71     break;
    72 
    72 
    73     case object_synchronizer:
    73     case object_synchronizer:
    74       ObjectSynchronizer::oops_do(&roots_closure);
    74       ObjectSynchronizer::oops_do(&roots_closure);
    88 
    88 
    89     case jvmti:
    89     case jvmti:
    90       JvmtiExport::oops_do(&roots_closure);
    90       JvmtiExport::oops_do(&roots_closure);
    91       break;
    91       break;
    92 
    92 
       
    93 
       
    94     case code_cache:
       
    95       {
       
    96         CodeBlobToOopClosure each_scavengable_code_blob(&roots_closure, /*do_marking=*/ true);
       
    97         CodeCache::scavenge_root_nmethods_do(&each_scavengable_code_blob);
       
    98       }
       
    99       break;
       
   100 
    93     default:
   101     default:
    94       fatal("Unknown root type");
   102       fatal("Unknown root type");
    95   }
   103   }
    96 
   104 
    97   // Do the real work
   105   // Do the real work
   105 void ThreadRootsTask::do_it(GCTaskManager* manager, uint which) {
   113 void ThreadRootsTask::do_it(GCTaskManager* manager, uint which) {
   106   assert(Universe::heap()->is_gc_active(), "called outside gc");
   114   assert(Universe::heap()->is_gc_active(), "called outside gc");
   107 
   115 
   108   PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(which);
   116   PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(which);
   109   PSScavengeRootsClosure roots_closure(pm);
   117   PSScavengeRootsClosure roots_closure(pm);
       
   118   CodeBlobToOopClosure roots_in_blobs(&roots_closure, /*do_marking=*/ true);
   110 
   119 
   111   if (_java_thread != NULL)
   120   if (_java_thread != NULL)
   112     _java_thread->oops_do(&roots_closure);
   121     _java_thread->oops_do(&roots_closure, &roots_in_blobs);
   113 
   122 
   114   if (_vm_thread != NULL)
   123   if (_vm_thread != NULL)
   115     _vm_thread->oops_do(&roots_closure);
   124     _vm_thread->oops_do(&roots_closure, &roots_in_blobs);
   116 
   125 
   117   // Do the real work
   126   // Do the real work
   118   pm->drain_stacks(false);
   127   pm->drain_stacks(false);
   119 }
   128 }
   120 
   129