Home
last modified time | relevance | path

Searched full:monitor (Results 1 – 25 of 47) sorted by relevance

12

/arkcompiler/runtime_core/runtime/
Dmonitor_pool.cpp21 #include "runtime/monitor.h"
25 Monitor *MonitorPool::CreateMonitor(ObjectHeader *obj) in CreateMonitor()
28 for (Monitor::MonitorId i = 0; i < MAX_MONITOR_ID; i++) { in CreateMonitor()
31 auto monitor = allocator_->New<Monitor>(last_id_); in CreateMonitor() local
32 if (monitor == nullptr) { in CreateMonitor()
35 monitors_[last_id_] = monitor; in CreateMonitor()
36 monitor->SetObject(obj); in CreateMonitor()
37 return monitor; in CreateMonitor()
44 Monitor *MonitorPool::LookupMonitor(Monitor::MonitorId id) in LookupMonitor()
54 void MonitorPool::FreeMonitor(Monitor::MonitorId id) in FreeMonitor()
[all …]
Dmonitor.cpp16 #include "runtime/monitor.h"
90 void Monitor::InflateThinLock(MTManagedThread *thread, [[maybe_unused]] const VMHandle<ObjectHeader… in InflateThinLock()
94 // and try inflating light monitor (`Inflate` expects lock to still be acquired by target; in InflateThinLock()
95 // otherwise markword CAS fails). If it fails (i.e. thread got suspended when this monitor is in InflateThinLock()
98 // or inflate monitor once this thread acquires light lock), this policy yields much better in InflateThinLock()
101 // monitor still acquired. in InflateThinLock()
115 // NB! Inflate can do nothing if monitor is already unlocked or acquired by other thread. in InflateThinLock()
121 // to heavy monitor in InflateThinLock()
139 Monitor::State Monitor::MonitorEnter(ObjectHeader *obj, bool trylock) in MonitorEnter()
156 …LOG(DEBUG, RUNTIME) << "Try to enter monitor " << std::hex << obj << " with state " << std::dec <… in MonitorEnter()
[all …]
Dmonitor_object_lock.cpp28 [[maybe_unused]] auto res = Monitor::MonitorEnter(obj_handler_.GetPtr()); in ObjectLock()
29 ASSERT(res == Monitor::State::OK); in ObjectLock()
34Monitor::State state = Monitor::Wait(obj_handler_.GetPtr(), ThreadStatus::IS_WAITING, 0, 0, ignore… in Wait()
35 LOG_IF(state == Monitor::State::ILLEGAL, FATAL, RUNTIME) << "Monitor::Wait() failed"; in Wait()
40Monitor::State state = Monitor::Wait(obj_handler_.GetPtr(), ThreadStatus::IS_TIMED_WAITING, timeou… in TimedWait()
41 LOG_IF(state == Monitor::State::ILLEGAL, FATAL, RUNTIME) << "Monitor::Wait() failed"; in TimedWait()
46 Monitor::State state = Monitor::Notify(obj_handler_.GetPtr()); in Notify()
47 LOG_IF(state != Monitor::State::OK, FATAL, RUNTIME) << "Monitor::Notify() failed"; in Notify()
52 Monitor::State state = Monitor::NotifyAll(obj_handler_.GetPtr()); in NotifyAll()
53 LOG_IF(state != Monitor::State::OK, FATAL, RUNTIME) << "Monitor::NotifyAll() failed"; in NotifyAll()
[all …]
Dmonitor_pool.h24 #include "runtime/monitor.h"
30 // Likely, we do not need to copy monitor pool
34 static constexpr Monitor::MonitorId MAX_MONITOR_ID = MarkWord::MONITOR_POINTER_MAX_COUNT;
52 auto monitor = monitor_iter->second; in DeflateMonitorsWithCallBack() local
53 if (cb(monitor) && monitor->DeflateInternal()) { in DeflateMonitorsWithCallBack()
55 allocator_->Delete(monitor); in DeflateMonitorsWithCallBack()
90 Monitor *CreateMonitor(ObjectHeader *obj);
92 Monitor *LookupMonitor(Monitor::MonitorId id);
94 void FreeMonitor(Monitor::MonitorId id);
100 PandaSet<Monitor::MonitorId> GetEnteredMonitorsIds(MTManagedThread *thread);
[all …]
Dmonitor.h76 // Potential drawback: infrustructure to detect, when the monitor is not acquired by any thread and…
79 // Potential targets: after monitor release check the owners of monitors,
84 class Monitor {
99 static Monitor::State MonitorEnter(ObjectHeader *obj, bool trylock = false);
103 static Monitor::State MonitorExit(ObjectHeader *obj);
127 * @param thread pointer to thread which will acquire the monitor.
128 …* @tparam for_other_thread include logic for inflation of monitor owned by other thread. Should be…
130 …* @return true if new monitor was successfuly created and object's markword updated with monitor's…
141 * @return true if object's monitor was found, acquired and freed; false otherwise
149 static Monitor *GetMonitorFromObject(ObjectHeader *obj);
[all …]
Dintrinsics.cpp349 auto res = Monitor::MonitorEnter(header); in ObjectMonitorEnter()
351 ASSERT(res != Monitor::State::INTERRUPTED); in ObjectMonitorEnter()
352 if (UNLIKELY(res != Monitor::State::OK)) { in ObjectMonitorEnter()
364 auto res = Monitor::MonitorExit(header); in ObjectMonitorExit()
366 ASSERT(res != Monitor::State::INTERRUPTED); in ObjectMonitorExit()
367 if (res == Monitor::State::ILLEGAL) { in ObjectMonitorExit()
376 Monitor::State state = Monitor::Wait(header, ThreadStatus::IS_WAITING, 0, 0); in ObjectWait()
377 LOG_IF(state == Monitor::State::ILLEGAL, FATAL, RUNTIME) << "Monitor::Wait() failed"; in ObjectWait()
382 Monitor::State state = Monitor::Wait(header, ThreadStatus::IS_TIMED_WAITING, timeout, 0); in ObjectTimedWait()
383 LOG_IF(state == Monitor::State::ILLEGAL, FATAL, RUNTIME) << "Monitor::Wait() failed"; in ObjectTimedWait()
[all …]
Dlock_order_graph.cpp21 void UpdateMonitorsForThread(PandaMap<ManagedThread::ThreadId, Monitor::MonitorId> &entering_monito… in UpdateMonitorsForThread()
22 … PandaMap<Monitor::MonitorId, PandaSet<ManagedThread::ThreadId>> &entered_monitors, in UpdateMonitorsForThread()
71 // We can only wait for a single monitor here. in CheckForTerminationLoops()
121 // There is a rare case, in which a monitor may be entered recursively in a in CheckForTerminationLoops()
Dmark_word.h27 // | Monitor:60 | RB:1 | GC:1 | state:01 | OOP to metadata object | Heavyw…
44 // | Monitor:28 | RB:1 | GC:1 | state:01 | OOP to metadata object | Heavyw…
61 // | Monitor:27 | Hash:1 | RB:1 | GC:1 | state:01 | OOP to metadata object | Heavyw…
76 // | Monitor:12 | RB:1 | GC:1 | state:01 | OOP to metadata object | Heavyw…
89 #include "runtime/monitor.h"
200 MarkWord DecodeFromMonitor(Monitor::MonitorId monitor) in DecodeFromMonitor() argument
202 // Clear monitor and status bits in DecodeFromMonitor()
204 markWordSize monitor_in_place = (static_cast<markWordSize>(monitor) & MONITOR_POINTER_MASK) in DecodeFromMonitor()
221 // Clear monitor and status bits in DecodeFromLightLock()
235 // Clear monitor and status bits in DecodeFromUnlocked()
[all …]
Dobject_header.cpp68 uint32_t ObjectHeader::GetHashCodeFromMonitor(Monitor *monitor_p) in GetHashCodeFromMonitor()
112 Monitor::Inflate(this, thread); in GetHashCodeMTMulti()
114 Monitor::InflateThinLock(thread, handle_obj); in GetHashCodeMTMulti()
125 LOG(FATAL, RUNTIME) << "Error on GetHashCode(): no monitor on heavy locked state"; in GetHashCodeMTMulti()
Dmonitor_object_lock.h18 #include "runtime/monitor.h"
Dlock_order_graph.h34 using MonitorId = Monitor::MonitorId;
/arkcompiler/runtime_core/runtime/tests/
Dmonitor_test.cpp61 Monitor::MonitorEnter(header); in TEST_F()
63 Monitor::MonitorExit(header); in TEST_F()
72 Monitor::MonitorEnter(header); in TEST_F()
74 Monitor::MonitorEnter(header); in TEST_F()
76 Monitor::MonitorExit(header); in TEST_F()
78 Monitor::MonitorExit(header); in TEST_F()
88 Monitor::MonitorEnter(header1); in TEST_F()
91 Monitor::MonitorEnter(header2); in TEST_F()
94 Monitor::MonitorExit(header1); in TEST_F()
97 Monitor::MonitorExit(header2); in TEST_F()
[all …]
Dmark_word_test.cpp78 Monitor::MonitorId GetMonitorId() in GetMonitorId()
120 Monitor::MonitorId GetMonitorId() const in GetMonitorId()
122 return static_cast<Monitor::MonitorId>(MAX_MONITOR_ID); in GetMonitorId()
173 …void CheckHeavyweightLock(const Monitor::MonitorId mId, bool isMarkedForGC, bool isReadBarrierSet … in CheckHeavyweightLock()
203 void DecodeHeavyLock(Monitor::MonitorId mId) in DecodeHeavyLock()
/arkcompiler/runtime_core/tests/cts-generator/cts-template/
Dmonitor.yaml42 panda.Object monitor
49 stobj.obj a0, RL.monitor
54 ldobj.obj a0, RL.monitor
68 - file-name: 'monitor'
70 title: Monitor instructions
72 Monitor instructions are used to synchronize object access between threads. Each object
73 is associated with a monitor, each monitor has a counter that allows to control access to
74 the monitor object.
77 On monitorenter VM thread tries to get ownership of the monitor in the following manner: if
78 monitor count is equal to zero, then it means that monitor doesn't belong to any thread. In
[all …]
/arkcompiler/runtime_core/runtime/include/
Dmtmanaged_thread.h35 void AddMonitor(Monitor *monitor);
36 void RemoveMonitor(Monitor *monitor);
60 Monitor *GetWaitingMonitor() in GetWaitingMonitor()
65 void SetWaitingMonitor(Monitor *monitor) in SetWaitingMonitor() argument
67 ASSERT(waiting_monitor_ == nullptr || monitor == nullptr); in SetWaitingMonitor()
68 waiting_monitor_ = monitor; in SetWaitingMonitor()
71 Monitor *GetEnteringMonitor() const in GetEnteringMonitor()
77 void SetEnteringMonitor(Monitor *monitor) in SetEnteringMonitor() argument
80 ASSERT(entering_monitor_.load(std::memory_order_relaxed) == nullptr || monitor == nullptr); in SetEnteringMonitor()
82 entering_monitor_.store(monitor, std::memory_order_relaxed); in SetEnteringMonitor()
[all …]
Dthread-inl.h117 ALWAYS_INLINE inline void MTManagedThread::AddMonitor(Monitor *monitor) in AddMonitor() argument
122 LOG(DEBUG, RUNTIME) << "Adding monitor " << monitor->GetId(); in AddMonitor()
125 ALWAYS_INLINE inline void MTManagedThread::RemoveMonitor(Monitor *monitor) in RemoveMonitor() argument
130 LOG(DEBUG, RUNTIME) << "Removing monitor " << monitor->GetId(); in RemoveMonitor()
Dobject_header.h28 // - Monitor functions (get monitor, notify, notify all, wait)
122 uint32_t GetHashCodeFromMonitor(Monitor *monitor_p);
Druntime_notification.h386 // If we need to support multiple monitor listeners, in MonitorWaitEvent()
399 // If we need to support multiple monitor listeners, in MonitorWaitedEvent()
412 // If we need to support multiple monitor listeners, in MonitorContendedEnterEvent()
425 // If we need to support multiple monitor listeners, in MonitorContendedEnteredEvent()
/arkcompiler/runtime_core/irtoc/scripts/
Dmonitors.irt26 params: {monitor: 'ptr'},
46 mark_word := LoadI(monitor).Imm(Constants::MARK_WORD_OFFSET).mw
48 mark_word := Intrinsic(:LOAD_ACQUIRE_MARK_WORD_EXCLUSIVE, monitor).mw
69 … If(Intrinsic(:COMPARE_AND_SET_MARK_WORD, monitor, mark_word, final_mark_word).b, 0).CC(:CC_EQ).b {
73 … If(Intrinsic(:STORE_RELEASE_MARK_WORD_EXCLUSIVE, monitor, final_mark_word).b, 0).CC(:CC_NE).b {
87 StoreI(locked_objects_addr, monitor).Imm(Constants::LOCKED_OBJECT_INFO_MONITOR_OFFSET).ptr
96 Intrinsic(:SLOW_PATH_ENTRY, monitor).AddImm(Constants::MONITOR_ENTER_SLOW_PATH).v0id
103 params: {monitor: 'ptr'},
119 mark_word := LoadI(monitor).Imm(Constants::MARK_WORD_OFFSET).mw
121 mark_word := Intrinsic(:LOAD_ACQUIRE_MARK_WORD_EXCLUSIVE, monitor).mw
[all …]
/arkcompiler/runtime_core/tests/checked/
Dmonitor.pa30 #! INST "Monitor"
32 #! INST "Monitor"
57 #! INST "Monitor"
59 #! INST "Monitor"
62 #! INST_NOT "Monitor"
/arkcompiler/runtime_core/runtime/mem/gc/lang/
Dgc_lang.cpp89 GetPandaVm()->GetMonitorPool()->EnumerateMonitors([this](Monitor *monitor) { in CommonUpdateRefsToMovedObjects() argument
90 ObjectHeader *object_header = monitor->GetObject(); in CommonUpdateRefsToMovedObjects()
95 … LOG_DEBUG_GC << "Update monitor " << std::hex << monitor << " object, old val = 0x" << std::hex in CommonUpdateRefsToMovedObjects()
97 monitor->SetObject(reinterpret_cast<ObjectHeader *>(addr)); in CommonUpdateRefsToMovedObjects()
125 // Run monitor deflation first in PreRunPhasesImpl()
/arkcompiler/runtime_core/runtime/include/tooling/
Ddebug_interface.h281 * @param object Reference to the monitor
289 * @param object Reference to the monitor
290 * @param timedOut True if the monitor timed out
295 …* \brief Method is called by the runtime when a thread is attempting to enter a monitor already ac…
298 * @param object Reference to the monitor
303 …* \brief Method is called by the runtime when a thread enters a monitor after waiting for it to be…
306 * @param object Reference to the monitor
/arkcompiler/runtime_core/platforms/unix/libpandabase/futex/
Dmutex.h53 …// Should be used only in monitor. Intended to be used with just created mutexes which aren't in u…
57 …// Should be used only in monitor. Intended to be used with just created mutexes which aren't in u…
/arkcompiler/runtime_core/compiler/docs/
Dcode_sink_doc.md50 * a Monitor instruction
97 // Do not sink over monitor
/arkcompiler/runtime_core/compiler/optimizer/optimizations/
Dcode_sink.cpp107 if (inst->GetOpcode() == Opcode::Monitor || (inst->IsStore() && IsVolatileMemInst(inst))) { in ProcessBlock()
120 // enter or exit monitor in candidate block in ProcessBlock()

12