diff options
author | 2019-05-06 18:16:24 +0000 | |
---|---|---|
committer | 2019-05-09 09:07:24 +0000 | |
commit | 4060786d8fa8c0c63c751a837decce4f95a33112 (patch) | |
tree | 7ce0fcebc6399c5c672569dcf7aa3dc67d503978 /openjdkjvmti/deopt_manager.cc | |
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/deopt_manager.cc')
-rw-r--r-- | openjdkjvmti/deopt_manager.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/openjdkjvmti/deopt_manager.cc b/openjdkjvmti/deopt_manager.cc index a7feba81e1..3b04ed8be8 100644 --- a/openjdkjvmti/deopt_manager.cc +++ b/openjdkjvmti/deopt_manager.cc @@ -45,6 +45,7 @@ #include "gc/collector_type.h" #include "gc/heap.h" #include "gc/scoped_gc_critical_section.h" +#include "instrumentation.h" #include "jit/jit.h" #include "jni/jni_internal.h" #include "mirror/class-inl.h" @@ -472,8 +473,12 @@ void DeoptManager::AddDeoptimizationRequester() { deopter_count_++; if (deopter_count_ == 1) { ScopedDeoptimizationContext sdc(self, this); - art::Runtime::Current()->GetInstrumentation()->EnableDeoptimization(); - return; + art::instrumentation::Instrumentation* instrumentation = + art::Runtime::Current()->GetInstrumentation(); + // Enable deoptimization + instrumentation->EnableDeoptimization(); + // Tell instrumentation we will be deopting single threads. + instrumentation->EnableSingleThreadDeopt(); } else { deoptimization_status_lock_.ExclusiveUnlock(self); } |