equal
deleted
inserted
replaced
240 } |
240 } |
241 |
241 |
242 return full_gc_done; |
242 return full_gc_done; |
243 } |
243 } |
244 |
244 |
|
245 class PSAddThreadRootsTaskClosure : public ThreadClosure { |
|
246 private: |
|
247 GCTaskQueue* _q; |
|
248 |
|
249 public: |
|
250 PSAddThreadRootsTaskClosure(GCTaskQueue* q) : _q(q) { } |
|
251 void do_thread(Thread* t) { |
|
252 _q->enqueue(new ThreadRootsTask(t)); |
|
253 } |
|
254 }; |
|
255 |
245 // This method contains no policy. You should probably |
256 // This method contains no policy. You should probably |
246 // be calling invoke() instead. |
257 // be calling invoke() instead. |
247 bool PSScavenge::invoke_no_policy() { |
258 bool PSScavenge::invoke_no_policy() { |
248 assert(SafepointSynchronize::is_at_safepoint(), "should be at safepoint"); |
259 assert(SafepointSynchronize::is_at_safepoint(), "should be at safepoint"); |
249 assert(Thread::current() == (Thread*)VMThread::vm_thread(), "should be in vm thread"); |
260 assert(Thread::current() == (Thread*)VMThread::vm_thread(), "should be in vm thread"); |
380 } |
391 } |
381 |
392 |
382 q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::universe)); |
393 q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::universe)); |
383 q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::jni_handles)); |
394 q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::jni_handles)); |
384 // We scan the thread roots in parallel |
395 // We scan the thread roots in parallel |
385 Threads::create_thread_roots_tasks(q); |
396 PSAddThreadRootsTaskClosure cl(q); |
|
397 Threads::java_threads_and_vm_thread_do(&cl); |
386 q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::object_synchronizer)); |
398 q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::object_synchronizer)); |
387 q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::management)); |
399 q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::management)); |
388 q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::system_dictionary)); |
400 q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::system_dictionary)); |
389 q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::class_loader_data)); |
401 q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::class_loader_data)); |
390 q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::jvmti)); |
402 q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::jvmti)); |