< prev index next >

src/share/vm/runtime/synchronizer.hpp

Print this page




  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_RUNTIME_SYNCHRONIZER_HPP
  26 #define SHARE_VM_RUNTIME_SYNCHRONIZER_HPP
  27 
  28 #include "oops/markOop.hpp"
  29 #include "runtime/basicLock.hpp"
  30 #include "runtime/handles.hpp"
  31 #include "runtime/perfData.hpp"
  32 #include "utilities/top.hpp"
  33 
  34 
  35 class ObjectMonitor;
  36 
  37 class ObjectSynchronizer : AllStatic {
  38   friend class VMStructs;
  39  public:




  40   typedef enum {
  41     owner_self,
  42     owner_none,
  43     owner_other
  44   } LockOwnership;
  45   // exit must be implemented non-blocking, since the compiler cannot easily handle
  46   // deoptimization at monitor exit. Hence, it does not take a Handle argument.
  47 
  48   // This is full version of monitor enter and exit. I choose not
  49   // to use enter() and exit() in order to make sure user be ware
  50   // of the performance and semantics difference. They are normally
  51   // used by ObjectLocker etc. The interpreter and compiler use
  52   // assembly copies of these routines. Please keep them synchornized.
  53   //
  54   // attempt_rebias flag is used by UseBiasedLocking implementation
  55   static void fast_enter  (Handle obj, BasicLock* lock, bool attempt_rebias, TRAPS);
  56   static void fast_exit   (oop obj,    BasicLock* lock, Thread* THREAD);
  57 
  58   // WARNING: They are ONLY used to handle the slow cases. They should
  59   // only be used when the fast cases failed. Use of these functions




  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_RUNTIME_SYNCHRONIZER_HPP
  26 #define SHARE_VM_RUNTIME_SYNCHRONIZER_HPP
  27 
  28 #include "oops/markOop.hpp"
  29 #include "runtime/basicLock.hpp"
  30 #include "runtime/handles.hpp"
  31 #include "runtime/perfData.hpp"
  32 #include "utilities/top.hpp"
  33 
  34 
  35 class ObjectMonitor;
  36 
  37 class ObjectSynchronizer : AllStatic {
  38   friend class VMStructs;
  39 #if INCLUDE_ALL_GCS
  40   friend class ShenandoahSynchronizerIterator;
  41 #endif
  42 
  43 public:
  44   typedef enum {
  45     owner_self,
  46     owner_none,
  47     owner_other
  48   } LockOwnership;
  49   // exit must be implemented non-blocking, since the compiler cannot easily handle
  50   // deoptimization at monitor exit. Hence, it does not take a Handle argument.
  51 
  52   // This is full version of monitor enter and exit. I choose not
  53   // to use enter() and exit() in order to make sure user be ware
  54   // of the performance and semantics difference. They are normally
  55   // used by ObjectLocker etc. The interpreter and compiler use
  56   // assembly copies of these routines. Please keep them synchornized.
  57   //
  58   // attempt_rebias flag is used by UseBiasedLocking implementation
  59   static void fast_enter  (Handle obj, BasicLock* lock, bool attempt_rebias, TRAPS);
  60   static void fast_exit   (oop obj,    BasicLock* lock, Thread* THREAD);
  61 
  62   // WARNING: They are ONLY used to handle the slow cases. They should
  63   // only be used when the fast cases failed. Use of these functions


< prev index next >