summaryrefslogtreecommitdiff
path: root/runtime/openjdkjvmti/events-inl.h
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2017-04-13 01:32:51 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-04-13 01:32:52 +0000
commit687fb792b2a819bb43d45eb720ed68a077ed1beb (patch)
treeca2a6bb4b229c363a3eb1f19e4365f1b3193ff7f /runtime/openjdkjvmti/events-inl.h
parentdbe35eddc4324468e08afc0829787f02ee736cea (diff)
parentbb766464bced8ca7db9cdaf635ae04759151a088 (diff)
Merge changes I49c02b92,I898e5cff
* changes: Ensure one can call DisposeEnvironment during event callbacks. run-tests with jvmti-stress configuration
Diffstat (limited to 'runtime/openjdkjvmti/events-inl.h')
-rw-r--r--runtime/openjdkjvmti/events-inl.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/runtime/openjdkjvmti/events-inl.h b/runtime/openjdkjvmti/events-inl.h
index 1ddbb869f9..233b45cda8 100644
--- a/runtime/openjdkjvmti/events-inl.h
+++ b/runtime/openjdkjvmti/events-inl.h
@@ -131,6 +131,9 @@ inline void EventHandler::DispatchClassFileLoadHookEvent(art::Thread* thread,
unsigned char* current_class_data = const_cast<unsigned char*>(class_data);
ArtJvmTiEnv* last_env = nullptr;
for (ArtJvmTiEnv* env : envs) {
+ if (env == nullptr) {
+ continue;
+ }
if (ShouldDispatch<kEvent>(env, thread)) {
jint new_len = 0;
unsigned char* new_data = nullptr;
@@ -171,7 +174,9 @@ inline void EventHandler::DispatchClassFileLoadHookEvent(art::Thread* thread,
template <ArtJvmtiEvent kEvent, typename ...Args>
inline void EventHandler::DispatchEvent(art::Thread* thread, Args... args) const {
for (ArtJvmTiEnv* env : envs) {
- DispatchEvent<kEvent, Args...>(env, thread, args...);
+ if (env != nullptr) {
+ DispatchEvent<kEvent, Args...>(env, thread, args...);
+ }
}
}
@@ -253,6 +258,9 @@ inline bool EventHandler::ShouldDispatch(ArtJvmTiEnv* env,
inline void EventHandler::RecalculateGlobalEventMask(ArtJvmtiEvent event) {
bool union_value = false;
for (const ArtJvmTiEnv* stored_env : envs) {
+ if (stored_env == nullptr) {
+ continue;
+ }
union_value |= stored_env->event_masks.global_event_mask.Test(event);
union_value |= stored_env->event_masks.unioned_thread_event_mask.Test(event);
if (union_value) {