< prev index next >

src/share/vm/gc/parallel/psParallelCompact.cpp

Print this page
rev 11778 : [mq]: service.patch

*** 2057,2066 **** --- 2057,2086 ---- assert(ParallelScavengeHeap::gc_task_manager() != NULL, "shouldn't return NULL"); return ParallelScavengeHeap::gc_task_manager(); } + class CreateThreadRootsMarkingTasksClosure : public ThreadClosure { + + private: + GCTaskQueue* _queue; + + public: + + CreateThreadRootsMarkingTasksClosure(GCTaskQueue* q) : _queue(q) { + } + + void do_thread(Thread* thread) { + if (thread->is_Java_thread()) { + _queue->enqueue(new ThreadRootsMarkingTask((JavaThread*) thread)); + } else if (thread->is_VM_thread()) { + _queue->enqueue(new ThreadRootsMarkingTask((VMThread*) thread)); + } + } + + }; + void PSParallelCompact::marking_phase(ParCompactionManager* cm, bool maximum_heap_compaction, ParallelOldTracer *gc_tracer) { // Recursively traverse all live objects and mark them GCTraceTime(Info, gc, phases) tm("Marking Phase", &_gc_timer);
*** 2085,2095 **** GCTaskQueue* q = GCTaskQueue::create(); q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::universe)); q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::jni_handles)); // We scan the thread roots in parallel ! Threads::create_thread_roots_marking_tasks(q); q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::object_synchronizer)); q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::flat_profiler)); q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::management)); q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::system_dictionary)); q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::class_loader_data)); --- 2105,2116 ---- GCTaskQueue* q = GCTaskQueue::create(); q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::universe)); q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::jni_handles)); // We scan the thread roots in parallel ! CreateThreadRootsMarkingTasksClosure cl(q); ! Threads::threads_do(&cl); q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::object_synchronizer)); q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::flat_profiler)); q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::management)); q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::system_dictionary)); q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::class_loader_data));
< prev index next >