diff options
| author | 2018-10-10 15:58:14 +0000 | |
|---|---|---|
| committer | 2018-10-11 16:41:54 -0700 | |
| commit | 0aa7a5a6a7bc350b79351f52e26c97747e927acf (patch) | |
| tree | a583889668d9703d16d37586d56421bd27c62661 /runtime/interpreter/interpreter_common.cc | |
| parent | e12575640dca5118bf96245f373acda276c22178 (diff) | |
Revert^4 "JVMTI PopFrame support"
This reverts commit 202b617acf477e8e8e11915f467120a0bd518e74.
This unreverts commit 202b617acf.
This unreverts commit 88a2a9d7a1.
There were several bugs with the implementation of pop-frame related
to interactions between the jit, exception handling, class-loading,
and deoptimization.
- We were instrumenting the target thread stack in cases where it was
unnecessary which caused the exception handler to incorrectly
determine that a method was not deoptimizable. This caused the
pop-frame to be ignored.
- We were incorrectly sending ExceptionCatch events if an exception
suppressed by pop-frame would have been caught in the current frame.
- We were allowing pop-frame to be used on threads suspended in the
ClassLoad or ClassPrepare events despite having surprising semantics
in that situation (see b/117615146).
Needed to modify test 1953 slightly for inclusion in CTS. I needed to
make the CTS entrypoint not run the class-load tests (since the cts
configuration means the classes are loaded by the verifier and not the
interpreter). I updated the expected.txt and check script to reflect
this.
Reason for revert: Fixed issue causing Exception events to sometimes
eat PopFrame and other issues.
Test: ./test.py --host
Test: ./art/tools/run-libjdwp-tests.sh --mode=host
Bug: 73255278
Bug: 111357976
Bug: 117533193
Bug: 117615146
Change-Id: I655c4fe769938cf41d7589f931d6710cf2001506
Diffstat (limited to 'runtime/interpreter/interpreter_common.cc')
| -rw-r--r-- | runtime/interpreter/interpreter_common.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc index 657772619c..fe412bc1b1 100644 --- a/runtime/interpreter/interpreter_common.cc +++ b/runtime/interpreter/interpreter_common.cc @@ -371,6 +371,12 @@ bool DoIPutQuick(const ShadowFrame& shadow_frame, const Instruction* inst, uint1 if (UNLIKELY(self->IsExceptionPending())) { return false; } + if (UNLIKELY(shadow_frame.GetForcePopFrame())) { + // Don't actually set the field. The next instruction will force us to pop. + DCHECK(Runtime::Current()->AreNonStandardExitsEnabled()); + DCHECK(PrevFrameWillRetry(self, shadow_frame)); + return true; + } } // Note: iput-x-quick instructions are only for non-volatile fields. switch (field_type) { @@ -440,6 +446,11 @@ bool MoveToExceptionHandler(Thread* self, self->IsExceptionThrownByCurrentMethod(exception.Get())) { // See b/65049545 for why we don't need to check to see if the exception has changed. instrumentation->ExceptionThrownEvent(self, exception.Get()); + if (shadow_frame.GetForcePopFrame()) { + // We will check in the caller for GetForcePopFrame again. We need to bail out early to + // prevent an ExceptionHandledEvent from also being sent before popping. + return true; + } } bool clear_exception = false; uint32_t found_dex_pc = shadow_frame.GetMethod()->FindCatchBlock( |