< prev index next >

src/share/vm/gc/shared/collectedHeap.hpp

Print this page
rev 13349 : imported patch deflate.patch

@@ -47,10 +47,11 @@
 class MetaspaceSummary;
 class Thread;
 class ThreadClosure;
 class VirtualSpaceSummary;
 class nmethod;
+class WorkGang;
 
 class GCMessage : public FormatBuffer<1024> {
  public:
   bool is_before;
 

@@ -598,10 +599,35 @@
   virtual void verify(VerifyOption option) = 0;
 
   // Accumulate additional statistics from GCLABs.
   virtual void accumulate_statistics_all_gclabs();
 
+  // Return true if GC supports per-thread monitor deflation.
+  // In this case, idle monitors will not get deflated when entering
+  // a safepoint, but instead will get deflated when the GC
+  // calls into Thread::oops_do() or Thread::possibly_parallel_oops_do().
+  // This allows for better parallelization and cache behaviour.
+  //
+  // NOTICE that monitor deflation requires the mark words to be intact,
+  // which means that this can only be supported by GCs that don't stow
+  // away the mark word in order to temporarily store a forwarding pointer
+  // to it.
+  virtual bool supports_per_thread_monitor_deflation() const {
+    return false;
+  }
+
+  // This is called by ObjectSynchronizer::deflate_idle_monitors() when
+  // the above supports_per_thread_monitor_deflation() returns false,
+  // or on special non-GC cleanup safepoints (even if the above returns true).
+  // It gives the GC a chance to deflate idle monitors using its GC worker
+  // threads, and thus support parallelization of monitor deflation.
+  // The default implementation simply deflates idle monitors single-threaded,
+  // using the calling (VM) thread.
+  virtual void deflate_idle_monitors_all_threads();
+
+  void parallel_deflate_idle_monitors(WorkGang* workers);
+
   // Non product verification and debugging.
 #ifndef PRODUCT
   // Support for PromotionFailureALot.  Return true if it's time to cause a
   // promotion failure.  The no-argument version uses
   // this->_promotion_failure_alot_count as the counter.
< prev index next >