< prev index next >

src/share/vm/runtime/thread.cpp

Print this page
rev 13349 : imported patch deflate.patch

@@ -791,17 +791,17 @@
 void Thread::oops_do(OopClosure* f, CodeBlobClosure* cf) {
   active_handles()->oops_do(f);
   // Do oop for ThreadShadow
   f->do_oop((oop*)&_pending_exception);
   handle_area()->oops_do(f);
-  // TODO: Either need better abstractions or have all GCs use this.
-  if (DeflateIdleMonitorsPerThread) {
-    ObjectSynchronizer::deflate_idle_monitors_per_thread(this);
-  }
-  if (UseShenandoahGC && ShenandoahFastSyncRoots && MonitorInUseLists) {
+  if (MonitorInUseLists) {
+    if (Universe::heap()->supports_per_thread_monitor_deflation()) {
+      ObjectSynchronizer::deflate_idle_monitors_and_oops_do(this, f);
+    } else {
     ObjectSynchronizer::thread_local_used_oops_do(this, f);
   }
+  }
 }
 
 void Thread::metadata_handles_do(void f(Metadata*)) {
   // Only walk the Handles in Thread.
   if (metadata_handles() != NULL) {

@@ -3412,10 +3412,19 @@
   }
 
   // If CompilerThreads ever become non-JavaThreads, add them here
 }
 
+void Threads::parallel_threads_do(ThreadClosure* tc) {
+  int cp = Threads::thread_claim_parity();
+  ALL_JAVA_THREADS(p) {
+    if (p->claim_oops_do(true, cp)) {
+      tc->do_thread(p);
+    }
+  }
+}
+
 // The system initialization in the library has three phases.
 //
 // Phase 1: java.lang.System class initialization
 //     java.lang.System is a primordial class loaded and initialized
 //     by the VM early during startup.  java.lang.System.<clinit>
< prev index next >