diff options
Diffstat (limited to 'runtime/runtime_callbacks.cc')
-rw-r--r-- | runtime/runtime_callbacks.cc | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/runtime/runtime_callbacks.cc b/runtime/runtime_callbacks.cc index 88d3f28583..f164f7c8ec 100644 --- a/runtime/runtime_callbacks.cc +++ b/runtime/runtime_callbacks.cc @@ -26,10 +26,6 @@ namespace art { -void RuntimeCallbacks::AddThreadLifecycleCallback(ThreadLifecycleCallback* cb) { - thread_callbacks_.push_back(cb); -} - template <typename T> ALWAYS_INLINE static inline void Remove(T* cb, std::vector<T*>* data) { @@ -39,6 +35,27 @@ static inline void Remove(T* cb, std::vector<T*>* data) { } } +void RuntimeCallbacks::AddMethodInspectionCallback(MethodInspectionCallback* cb) { + method_inspection_callbacks_.push_back(cb); +} + +void RuntimeCallbacks::RemoveMethodInspectionCallback(MethodInspectionCallback* cb) { + Remove(cb, &method_inspection_callbacks_); +} + +bool RuntimeCallbacks::IsMethodBeingInspected(ArtMethod* m) { + for (MethodInspectionCallback* cb : method_inspection_callbacks_) { + if (cb->IsMethodBeingInspected(m)) { + return true; + } + } + return false; +} + +void RuntimeCallbacks::AddThreadLifecycleCallback(ThreadLifecycleCallback* cb) { + thread_callbacks_.push_back(cb); +} + void RuntimeCallbacks::MonitorContendedLocking(Monitor* m) { for (MonitorCallback* cb : monitor_callbacks_) { cb->MonitorContendedLocking(m); |