5161 {
5162
5163 CMSHeap* heap = CMSHeap::heap();
5164 WorkGang* workers = heap->workers();
5165 assert(workers != NULL, "Need parallel worker threads.");
5166 CMSRefEnqueueTaskProxy enq_task(task);
5167 workers->run_task(&enq_task);
5168 }
5169
5170 void CMSCollector::refProcessingWork() {
5171 ResourceMark rm;
5172 HandleMark hm;
5173
5174 SpanReferenceProcessor* rp = ref_processor();
5175 assert(rp->span().equals(_span), "Spans should be equal");
5176 assert(!rp->enqueuing_is_done(), "Enqueuing should not be complete");
5177 // Process weak references.
5178 rp->setup_policy(false);
5179 verify_work_stacks_empty();
5180
5181 ReferenceProcessorPhaseTimes pt(_gc_timer_cm, rp->num_q());
5182 {
5183 GCTraceTime(Debug, gc, phases) t("Reference Processing", _gc_timer_cm);
5184
5185 // Setup keep_alive and complete closures.
5186 CMSKeepAliveClosure cmsKeepAliveClosure(this, _span, &_markBitMap,
5187 &_markStack, false /* !preclean */);
5188 CMSDrainMarkingStackClosure cmsDrainMarkingStackClosure(this,
5189 _span, &_markBitMap, &_markStack,
5190 &cmsKeepAliveClosure, false /* !preclean */);
5191
5192 ReferenceProcessorStats stats;
5193 if (rp->processing_is_mt()) {
5194 // Set the degree of MT here. If the discovery is done MT, there
5195 // may have been a different number of threads doing the discovery
5196 // and a different number of discovered lists may have Ref objects.
5197 // That is OK as long as the Reference lists are balanced (see
5198 // balance_all_queues() and balance_queues()).
5199 CMSHeap* heap = CMSHeap::heap();
5200 uint active_workers = ParallelGCThreads;
5201 WorkGang* workers = heap->workers();
|
5161 {
5162
5163 CMSHeap* heap = CMSHeap::heap();
5164 WorkGang* workers = heap->workers();
5165 assert(workers != NULL, "Need parallel worker threads.");
5166 CMSRefEnqueueTaskProxy enq_task(task);
5167 workers->run_task(&enq_task);
5168 }
5169
5170 void CMSCollector::refProcessingWork() {
5171 ResourceMark rm;
5172 HandleMark hm;
5173
5174 SpanReferenceProcessor* rp = ref_processor();
5175 assert(rp->span().equals(_span), "Spans should be equal");
5176 assert(!rp->enqueuing_is_done(), "Enqueuing should not be complete");
5177 // Process weak references.
5178 rp->setup_policy(false);
5179 verify_work_stacks_empty();
5180
5181 ReferenceProcessorPhaseTimes pt(_gc_timer_cm, rp->num_queues());
5182 {
5183 GCTraceTime(Debug, gc, phases) t("Reference Processing", _gc_timer_cm);
5184
5185 // Setup keep_alive and complete closures.
5186 CMSKeepAliveClosure cmsKeepAliveClosure(this, _span, &_markBitMap,
5187 &_markStack, false /* !preclean */);
5188 CMSDrainMarkingStackClosure cmsDrainMarkingStackClosure(this,
5189 _span, &_markBitMap, &_markStack,
5190 &cmsKeepAliveClosure, false /* !preclean */);
5191
5192 ReferenceProcessorStats stats;
5193 if (rp->processing_is_mt()) {
5194 // Set the degree of MT here. If the discovery is done MT, there
5195 // may have been a different number of threads doing the discovery
5196 // and a different number of discovered lists may have Ref objects.
5197 // That is OK as long as the Reference lists are balanced (see
5198 // balance_all_queues() and balance_queues()).
5199 CMSHeap* heap = CMSHeap::heap();
5200 uint active_workers = ParallelGCThreads;
5201 WorkGang* workers = heap->workers();
|