diff options
author | 2019-05-06 18:16:24 +0000 | |
---|---|---|
committer | 2019-05-09 09:07:24 +0000 | |
commit | 4060786d8fa8c0c63c751a837decce4f95a33112 (patch) | |
tree | 7ce0fcebc6399c5c672569dcf7aa3dc67d503978 /openjdkjvmti/events.h | |
parent | 3ff45bf767f4f1baf858e2220e36acffa97b0383 (diff) |
Revert^2 "Correctly handle thread deopt with thread-specific JVMTI events"
This reverts commit b2a8964f4218c2c52dacf599ebf5cf69f8753bf0.
It turns out that transitioning from instrumentation trampolines and
interpreter trampolines interacts in a racy way with single thread
deoptimization. This caused tests that perform this transition
repeatedly to be flaky when run with the --trace. Since it is expected
to be rare that one traces at the same time they are performing JVMTI
functions (since JVMTI is a superset of trace behaviors) we solved
this by simply not allowing the transition.
Reason for revert: Prevented unsafe transition between entry-exit
trampolines and interpreter only.
Bug: 131865028
Bug: 132283660
Test: ./test.py --host --trace --ntrace
Test: echo "#!/bin/bash" > run-one-test.sh
echo "./art/test/run-test --dev --jit --trace --64 1956-pop-frame-jit-calling 2>&1" >> run-one-test.sh
chmod u+x run-one-test.sh
./art/tools/parallel_run.py -j20 ./run-one-test.sh
Change-Id: Id496b272f353a5a5e000574c107a97d67405d54b
Diffstat (limited to 'openjdkjvmti/events.h')
-rw-r--r-- | openjdkjvmti/events.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/openjdkjvmti/events.h b/openjdkjvmti/events.h index 2c3c7a0ba5..d54c87aceb 100644 --- a/openjdkjvmti/events.h +++ b/openjdkjvmti/events.h @@ -247,13 +247,10 @@ class EventHandler { REQUIRES(!envs_lock_); private: - jvmtiError SetupTraceListener(JvmtiMethodTraceListener* listener, - ArtJvmtiEvent event, - jthread thread, - bool enable); + void SetupTraceListener(JvmtiMethodTraceListener* listener, ArtJvmtiEvent event, bool enable); // Specifically handle the FramePop event which it might not always be possible to turn off. - jvmtiError SetupFramePopTraceListener(jthread thread, bool enable); + void SetupFramePopTraceListener(bool enable); template <ArtJvmtiEvent kEvent, typename ...Args> ALWAYS_INLINE @@ -293,6 +290,11 @@ class EventHandler { ALWAYS_INLINE inline void RecalculateGlobalEventMaskLocked(ArtJvmtiEvent event) REQUIRES_SHARED(envs_lock_); + // Returns whether there are any active requests for the given event on the given thread. This + // should only be used while modifying the events for a thread. + bool GetThreadEventState(ArtJvmtiEvent event, art::Thread* thread) + REQUIRES(envs_lock_, art::Locks::thread_list_lock_); + template <ArtJvmtiEvent kEvent> ALWAYS_INLINE inline void DispatchClassFileLoadHookEvent(art::Thread* thread, JNIEnv* jnienv, @@ -313,7 +315,11 @@ class EventHandler { jclass klass) const REQUIRES(!envs_lock_); - jvmtiError HandleEventType(ArtJvmtiEvent event, jthread thread, bool enable); + // Sets up the global state needed for the first/last enable of an event across all threads + void HandleEventType(ArtJvmtiEvent event, bool enable); + // Perform deopts required for enabling the event on the given thread. Null thread indicates + // global event enabled. + jvmtiError HandleEventDeopt(ArtJvmtiEvent event, jthread thread, bool enable); void HandleLocalAccessCapabilityAdded(); void HandleBreakpointEventsChanged(bool enable); |