hotspot/src/share/vm/runtime/synchronizer.hpp
changeset 25472 381638db28e6
parent 25069 c937c5e883c5
child 25633 4cd9c4622c8c
equal deleted inserted replaced
25471:3ab9867d7786 25472:381638db28e6
    82   // with original recursion count
    82   // with original recursion count
    83   static intptr_t complete_exit  (Handle obj,                TRAPS);
    83   static intptr_t complete_exit  (Handle obj,                TRAPS);
    84   static void reenter            (Handle obj, intptr_t recursion, TRAPS);
    84   static void reenter            (Handle obj, intptr_t recursion, TRAPS);
    85 
    85 
    86   // thread-specific and global objectMonitor free list accessors
    86   // thread-specific and global objectMonitor free list accessors
    87 //  static void verifyInUse (Thread * Self) ; too slow for general assert/debug
    87   static void verifyInUse(Thread * Self);
    88   static ObjectMonitor * omAlloc(Thread * Self);
    88   static ObjectMonitor * omAlloc(Thread * Self);
    89   static void omRelease(Thread * Self, ObjectMonitor * m, bool FromPerThreadAlloc);
    89   static void omRelease(Thread * Self, ObjectMonitor * m, bool FromPerThreadAlloc);
    90   static void omFlush(Thread * Self);
    90   static void omFlush(Thread * Self);
    91 
    91 
    92   // Inflate light weight monitor to heavy weight monitor
    92   // Inflate light weight monitor to heavy weight monitor
   112   // GC: we current use aggressive monitor deflation policy
   112   // GC: we current use aggressive monitor deflation policy
   113   // Basically we deflate all monitors that are not busy.
   113   // Basically we deflate all monitors that are not busy.
   114   // An adaptive profile-based deflation policy could be used if needed
   114   // An adaptive profile-based deflation policy could be used if needed
   115   static void deflate_idle_monitors();
   115   static void deflate_idle_monitors();
   116   static int walk_monitor_list(ObjectMonitor** listheadp,
   116   static int walk_monitor_list(ObjectMonitor** listheadp,
   117                                ObjectMonitor** FreeHeadp,
   117                                ObjectMonitor** freeHeadp,
   118                                ObjectMonitor** FreeTailp);
   118                                ObjectMonitor** freeTailp);
   119   static bool deflate_monitor(ObjectMonitor* mid, oop obj, ObjectMonitor** FreeHeadp,
   119   static bool deflate_monitor(ObjectMonitor* mid, oop obj, ObjectMonitor** freeHeadp,
   120                               ObjectMonitor** FreeTailp);
   120                               ObjectMonitor** freeTailp);
   121   static void oops_do(OopClosure* f);
   121   static void oops_do(OopClosure* f);
   122 
   122 
   123   // debugging
   123   // debugging
   124   static void verify() PRODUCT_RETURN;
   124   static void verify() PRODUCT_RETURN;
   125   static int  verify_objmon_isinpool(ObjectMonitor *addr) PRODUCT_RETURN0;
   125   static int  verify_objmon_isinpool(ObjectMonitor *addr) PRODUCT_RETURN0;
   128 
   128 
   129  private:
   129  private:
   130   enum { _BLOCKSIZE = 128 };
   130   enum { _BLOCKSIZE = 128 };
   131   static ObjectMonitor* gBlockList;
   131   static ObjectMonitor* gBlockList;
   132   static ObjectMonitor * volatile gFreeList;
   132   static ObjectMonitor * volatile gFreeList;
   133   static ObjectMonitor * volatile gOmInUseList; // for moribund thread, so monitors they inflated still get scanned
   133   // global monitor in use list, for moribund threads,
       
   134   // monitors they inflated need to be scanned for deflation
       
   135   static ObjectMonitor * volatile gOmInUseList;
       
   136   // count of entries in gOmInUseList
   134   static int gOmInUseCount;
   137   static int gOmInUseCount;
   135 
   138 
   136 };
   139 };
   137 
   140 
   138 // ObjectLocker enforced balanced locking and can never thrown an
   141 // ObjectLocker enforced balanced locking and can never thrown an