Home
last modified time | relevance | path

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

123

/arkcompiler/runtime_core/static_core/runtime/
Dmonitor_object_lock.cpp27 [[maybe_unused]] auto res = Monitor::MonitorEnter(objHandler_.GetPtr()); in ObjectLock()
28 ASSERT(res == Monitor::State::OK); in ObjectLock()
33Monitor::State state = Monitor::Wait(objHandler_.GetPtr(), ThreadStatus::IS_WAITING, 0, 0, ignoreI… in Wait()
34 LOG_IF(state == Monitor::State::ILLEGAL, FATAL, RUNTIME) << "Monitor::Wait() failed"; in Wait()
35 return state != Monitor::State::INTERRUPTED; in Wait()
40Monitor::State state = Monitor::Wait(objHandler_.GetPtr(), ThreadStatus::IS_TIMED_WAITING, timeout… in TimedWait()
41 LOG_IF(state == Monitor::State::ILLEGAL, FATAL, RUNTIME) << "Monitor::Wait() failed"; in TimedWait()
42 return state != Monitor::State::INTERRUPTED; in TimedWait()
47 Monitor::State state = Monitor::Notify(objHandler_.GetPtr()); in Notify()
48 LOG_IF(state != Monitor::State::OK, FATAL, RUNTIME) << "Monitor::Notify() failed"; in Notify()
[all …]
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>(lastId_); in CreateMonitor() local
32 if (monitor == nullptr) { in CreateMonitor()
35 monitors_[lastId_] = 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()
116 // NB! Inflate can do nothing if monitor is already unlocked or acquired by other thread. in InflateThinLock()
127 // to heavy monitor in InflateThinLock()
137 std::optional<Monitor::State> Monitor::HandleLightLockedState(MarkWord &mark, MTManagedThread *thre… in HandleLightLockedState()
150 … LOG(DEBUG, RUNTIME) << "The lightweight monitor was successfully recursively acquired"; in HandleLightLockedState()
[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 = monitorIter->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.h77 // Potential drawback: infrustructure to detect, when the monitor is not acquired by any thread and…
80 // Potential targets: after monitor release check the owners of monitors,
85 class Monitor {
100 PANDA_PUBLIC_API static Monitor::State MonitorEnter(ObjectHeader *obj, bool trylock = false);
104 PANDA_PUBLIC_API static Monitor::State MonitorExit(ObjectHeader *obj);
128 * @param thread pointer to thread which will acquire the monitor.
129 …* @tparam for_other_thread include logic for inflation of monitor owned by other thread. Should be…
131 …* @return true if new monitor was successfuly created and object's markword updated with monitor's…
142 * @return true if object's monitor was found, acquired and freed; false otherwise
150 static Monitor *GetMonitorFromObject(ObjectHeader *obj);
[all …]
Dintrinsics.cpp348 auto res = Monitor::MonitorEnter(header); in ObjectMonitorEnter()
350 ASSERT(res != Monitor::State::INTERRUPTED); in ObjectMonitorEnter()
351 if (UNLIKELY(res != Monitor::State::OK)) { in ObjectMonitorEnter()
365 auto res = Monitor::MonitorExit(header); in ObjectMonitorExit()
367 ASSERT(res != Monitor::State::INTERRUPTED); in ObjectMonitorExit()
368 if (res == Monitor::State::ILLEGAL) { in ObjectMonitorExit()
377 Monitor::State state = Monitor::Wait(header, ThreadStatus::IS_WAITING, 0, 0); in ObjectWait()
378 LOG_IF(state == Monitor::State::ILLEGAL, FATAL, RUNTIME) << "Monitor::Wait() failed"; in ObjectWait()
383 Monitor::State state = Monitor::Wait(header, ThreadStatus::IS_TIMED_WAITING, timeout, 0); in ObjectTimedWait()
384 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> &enteringMonitor… in UpdateMonitorsForThread()
22 … PandaMap<Monitor::MonitorId, PandaSet<ManagedThread::ThreadId>> &enteredMonitors, in UpdateMonitorsForThread()
71 // We can only wait for a single monitor here. in CheckForTerminationLoops()
114 // There is a rare case, in which a monitor may be entered recursively in a in CheckNodeForTerminationLoops()
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 monitorInPlace = (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 …]
Dmonitor_object_lock.h18 #include "runtime/monitor.h"
Dobject_header.cpp90 uint32_t ObjectHeader::GetHashCodeFromMonitor(Monitor *monitorP) in GetHashCodeFromMonitor()
134 Monitor::Inflate(this, thread); in GetHashCodeMTMulti()
136 Monitor::InflateThinLock(thread, handleObj); in GetHashCodeMTMulti()
147 LOG(FATAL, RUNTIME) << "Error on GetHashCode(): no monitor on heavy locked state"; in GetHashCodeMTMulti()
Dlock_order_graph.h34 using MonitorId = Monitor::MonitorId;
/arkcompiler/runtime_core/static_core/runtime/tests/
Dmonitor_test.cpp68 Monitor::MonitorEnter(header); in TEST_F()
70 Monitor::MonitorExit(header); in TEST_F()
79 Monitor::MonitorEnter(header); in TEST_F()
81 Monitor::MonitorEnter(header); in TEST_F()
83 Monitor::MonitorExit(header); in TEST_F()
85 Monitor::MonitorExit(header); in TEST_F()
95 Monitor::MonitorEnter(header1); in TEST_F()
98 Monitor::MonitorEnter(header2); in TEST_F()
101 Monitor::MonitorExit(header1); in TEST_F()
104 Monitor::MonitorExit(header2); in TEST_F()
[all …]
Dmark_word_test.cpp80 Monitor::MonitorId GetMonitorId() in GetMonitorId()
122 Monitor::MonitorId GetMonitorId() const in GetMonitorId()
124 return static_cast<Monitor::MonitorId>(MAX_MONITOR_ID); in GetMonitorId()
175 …void CheckHeavyweightLock(const Monitor::MonitorId mId, bool isMarkedForGc, bool isReadBarrierSet … in CheckHeavyweightLock()
205 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/static_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(waitingMonitor_ == nullptr || monitor == nullptr); in SetWaitingMonitor()
68 waitingMonitor_ = monitor; in SetWaitingMonitor()
71 Monitor *GetEnteringMonitor() const in GetEnteringMonitor()
77 void SetEnteringMonitor(Monitor *monitor) in SetEnteringMonitor() argument
80 ASSERT(enteringMonitor_.load(std::memory_order_relaxed) == nullptr || monitor == nullptr); in SetEnteringMonitor()
82 enteringMonitor_.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()
/arkcompiler/runtime_core/static_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).EQ.b {
73 If(Intrinsic(:STORE_RELEASE_MARK_WORD_EXCLUSIVE, monitor, final_mark_word).b, 0).NE.b {
87 StoreI(locked_objects_addr, monitor).Imm(Constants::LOCKED_OBJECT_INFO_MONITOR_OFFSET).ptr
97 …Intrinsic(:SLOW_PATH_ENTRY, monitor).AddImm(ep_offset).MethodAsImm("MonitorEnterOddSavedBridge").T…
104 params: {monitor: 'ptr'},
120 mark_word := LoadI(monitor).Imm(Constants::MARK_WORD_OFFSET).mw
122 mark_word := Intrinsic(:LOAD_ACQUIRE_MARK_WORD_EXCLUSIVE, monitor).mw
[all …]
/arkcompiler/runtime_core/static_core/tests/checked/
Dmonitor.pa30 #! INST "Monitor"
32 #! INST "Monitor"
57 #! INST "Monitor"
59 #! INST "Monitor"
64 #! INST_NOT "Monitor"
/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/static_core/runtime/mem/gc/lang/
Dgc_lang.cpp83 GetPandaVm()->GetMonitorPool()->EnumerateMonitors([this](Monitor *monitor) { in CommonUpdateRefsToMovedObjects() argument
84 ObjectHeader *objectHeader = monitor->GetObject(); in CommonUpdateRefsToMovedObjects()
91 … LOG_DEBUG_GC << "Update monitor " << std::hex << monitor << " object, old val = 0x" << std::hex in CommonUpdateRefsToMovedObjects()
93 monitor->SetObject(reinterpret_cast<ObjectHeader *>(addr)); in CommonUpdateRefsToMovedObjects()
119 // Run monitor deflation first in PreRunPhasesImpl()
/arkcompiler/runtime_core/static_core/compiler/tests/
Dmonitor_analysis_test.cpp30 INST(1U, Opcode::Monitor).v0id().Entry().Inputs(0U, 4U); in TEST_F()
32 INST(2U, Opcode::Monitor).v0id().Exit().Inputs(0U, 5U); in TEST_F()
63 INST(4U, Opcode::Monitor).v0id().Entry().Inputs(1U, 11U); in TEST_F()
75 INST(9U, Opcode::Monitor).v0id().Exit().Inputs(1U, 12U); in TEST_F()
114 INST(5U, Opcode::Monitor).v0id().Entry().Inputs(1U, 14U); in SRC_GRAPH()
116 INST(6U, Opcode::Monitor).v0id().Entry().Inputs(2U, 15U); in SRC_GRAPH()
118 INST(7U, Opcode::Monitor).v0id().Exit().Inputs(1U, 16U); in SRC_GRAPH()
130 INST(12U, Opcode::Monitor).v0id().Exit().Inputs(2U, 17U); in SRC_GRAPH()
173 INST(4U, Opcode::Monitor).v0id().Entry().Inputs(1U, 12U); in SRC_GRAPH()
180 INST(7U, Opcode::Monitor).v0id().Exit().Inputs(1U, 13U); in SRC_GRAPH()
[all …]
/arkcompiler/runtime_core/static_core/runtime/include/tooling/
Ddebug_interface.h277 * @param object Reference to the monitor
285 * @param object Reference to the monitor
286 * @param timedOut True if the monitor timed out
291 …* @brief Method is called by the runtime when a thread is attempting to enter a monitor already ac…
294 * @param object Reference to the monitor
299 …* @brief Method is called by the runtime when a thread enters a monitor after waiting for it to be…
302 * @param object Reference to the monitor
/arkcompiler/runtime_core/static_core/compiler/optimizer/analysis/
Dmonitor_analysis.cpp35 // The Monitor.Exit is removed from the compiled code after explicit Throw instruction in MarkedMonitorRec()
39 if (inst->GetOpcode() == Opcode::Monitor) { in MarkedMonitorRec()
/arkcompiler/ets_runtime/ecmascript/compiler/codegen/maple/maple_be/include/be/
Drt.h66 static constexpr int64_t kArrayLengthOffset = 12; /* shadow + monitor + [padding] */
/arkcompiler/runtime_core/static_core/compiler/optimizer/templates/
Dinst_builder_gen.cpp.erb118 /^monitor/ => "monitor",
206 …^ststatic/, /^lda.type/, /^lda.str/, /^lda.const/, /^isinstance/, /^builtin/, /^monitor/, /launch/]

123