63 public:
64 Iterator(ObjectMonitor* head) : _current(head) {}
65 bool has_next() const { return _current != nullptr; }
66 ObjectMonitor* next();
67 };
68
69 class ObjectSynchronizer : AllStatic {
70 friend class VMStructs;
71 friend class ObjectMonitorDeflationLogging;
72 friend class WhiteBox;
73
74 public:
75 typedef enum {
76 inflate_cause_vm_internal = 0,
77 inflate_cause_monitor_enter = 1,
78 inflate_cause_wait = 2,
79 inflate_cause_notify = 3,
80 inflate_cause_hash_code = 4,
81 inflate_cause_jni_enter = 5,
82 inflate_cause_jni_exit = 6,
83 inflate_cause_nof = 7 // Number of causes
84 } InflateCause;
85
86 typedef enum {
87 NOT_ENABLED = 0,
88 FATAL_EXIT = 1,
89 LOG_WARNING = 2
90 } SyncDiagnosticOption;
91
92 // exit must be implemented non-blocking, since the compiler cannot easily handle
93 // deoptimization at monitor exit. Hence, it does not take a Handle argument.
94
95 // This is the "slow path" version of monitor enter and exit.
96 static void enter(Handle obj, BasicLock* lock, JavaThread* current);
97 static void exit(oop obj, BasicLock* lock, JavaThread* current);
98 // Used to enter a monitor for another thread. This requires that the
99 // locking_thread is suspended, and that entering on a potential
100 // inflated monitor may only contend with deflation. That is the obj being
101 // locked on is either already locked by the locking_thread or cannot
102 // escape the locking_thread.
103 static void enter_for(Handle obj, BasicLock* lock, JavaThread* locking_thread);
|
63 public:
64 Iterator(ObjectMonitor* head) : _current(head) {}
65 bool has_next() const { return _current != nullptr; }
66 ObjectMonitor* next();
67 };
68
69 class ObjectSynchronizer : AllStatic {
70 friend class VMStructs;
71 friend class ObjectMonitorDeflationLogging;
72 friend class WhiteBox;
73
74 public:
75 typedef enum {
76 inflate_cause_vm_internal = 0,
77 inflate_cause_monitor_enter = 1,
78 inflate_cause_wait = 2,
79 inflate_cause_notify = 3,
80 inflate_cause_hash_code = 4,
81 inflate_cause_jni_enter = 5,
82 inflate_cause_jni_exit = 6,
83 inflate_cause_cont_freeze = 7,
84 inflate_cause_nof = 8 // Number of causes
85 } InflateCause;
86
87 typedef enum {
88 NOT_ENABLED = 0,
89 FATAL_EXIT = 1,
90 LOG_WARNING = 2
91 } SyncDiagnosticOption;
92
93 // exit must be implemented non-blocking, since the compiler cannot easily handle
94 // deoptimization at monitor exit. Hence, it does not take a Handle argument.
95
96 // This is the "slow path" version of monitor enter and exit.
97 static void enter(Handle obj, BasicLock* lock, JavaThread* current);
98 static void exit(oop obj, BasicLock* lock, JavaThread* current);
99 // Used to enter a monitor for another thread. This requires that the
100 // locking_thread is suspended, and that entering on a potential
101 // inflated monitor may only contend with deflation. That is the obj being
102 // locked on is either already locked by the locking_thread or cannot
103 // escape the locking_thread.
104 static void enter_for(Handle obj, BasicLock* lock, JavaThread* locking_thread);
|