diff options
author | Alex Light <allight@google.com> | 2017-09-05 14:51:49 -0700 |
---|---|---|
committer | Alex Light <allight@google.com> | 2017-09-14 09:57:03 -0700 |
commit | 77fee87b262e969b29a9ac121a8bcbf87b68d9ce (patch) | |
tree | 3280ba8d887045217bfbcb81eb624f571eeee7d0 /runtime/runtime_callbacks.cc | |
parent | ec995142998f6c7371734e6df95b5e2c80b18d27 (diff) | |
download | art-77fee87b262e969b29a9ac121a8bcbf87b68d9ce.tar.gz art-77fee87b262e969b29a9ac121a8bcbf87b68d9ce.tar.bz2 art-77fee87b262e969b29a9ac121a8bcbf87b68d9ce.zip |
Add support for JVMTI monitor events.
Adds support for the JVMTI can_generate_monitor_events capability and
all associated events. This adds support for the
JVMTI_EVENT_MONITOR_WAIT, JVMTI_EVENT_MONITOR_WAITED,
JVMTI_EVENT_MONITOR_CONTENDED_ENTER, and
JVMTI_EVENT_MONITOR_CONTENDED_ENTERED events.
Bug: 65558434
Bug: 62821960
Bug: 34415266
Test: ./test.py --host -j50
Change-Id: I0fe8038e6c4249e77d37a67e5056b5d2a94b6f48
Diffstat (limited to 'runtime/runtime_callbacks.cc')
-rw-r--r-- | runtime/runtime_callbacks.cc | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/runtime/runtime_callbacks.cc b/runtime/runtime_callbacks.cc index 16d6c13722..88d3f28583 100644 --- a/runtime/runtime_callbacks.cc +++ b/runtime/runtime_callbacks.cc @@ -21,6 +21,7 @@ #include "art_method.h" #include "base/macros.h" #include "class_linker.h" +#include "monitor.h" #include "thread.h" namespace art { @@ -38,6 +39,38 @@ static inline void Remove(T* cb, std::vector<T*>* data) { } } +void RuntimeCallbacks::MonitorContendedLocking(Monitor* m) { + for (MonitorCallback* cb : monitor_callbacks_) { + cb->MonitorContendedLocking(m); + } +} + +void RuntimeCallbacks::MonitorContendedLocked(Monitor* m) { + for (MonitorCallback* cb : monitor_callbacks_) { + cb->MonitorContendedLocked(m); + } +} + +void RuntimeCallbacks::ObjectWaitStart(Handle<mirror::Object> m, int64_t timeout) { + for (MonitorCallback* cb : monitor_callbacks_) { + cb->ObjectWaitStart(m, timeout); + } +} + +void RuntimeCallbacks::MonitorWaitFinished(Monitor* m, bool timeout) { + for (MonitorCallback* cb : monitor_callbacks_) { + cb->MonitorWaitFinished(m, timeout); + } +} + +void RuntimeCallbacks::AddMonitorCallback(MonitorCallback* cb) { + monitor_callbacks_.push_back(cb); +} + +void RuntimeCallbacks::RemoveMonitorCallback(MonitorCallback* cb) { + Remove(cb, &monitor_callbacks_); +} + void RuntimeCallbacks::RemoveThreadLifecycleCallback(ThreadLifecycleCallback* cb) { Remove(cb, &thread_callbacks_); } |