diff options
author | 2018-03-14 14:44:29 -0700 | |
---|---|---|
committer | 2018-10-04 11:04:49 -0700 | |
commit | 88a2a9d7a14b67e10525d93b0ee57d9dd6bc345a (patch) | |
tree | a19af813a97be817a76072534139a77b16f3ad87 /runtime/common_dex_operations.h | |
parent | fc7d33fc052d993eaa205337e6a805022d2cd822 (diff) |
JVMTI PopFrame support
Implement support for the JVMTI can_pop_frames capability. This works
by marking shadow-frames with a bit that forces it to be popped or an
instruction to be retried. When a PopFrame is requested the plugin
will deoptimize the targeted thread and force the interpreter to deal
with the frame pop. If the can_pop_frames capability is enabled the
runtime will be forced to handle all exceptions through the
interpreter. This is required to support PopFrame during some
exception events.
Test: ./test.py --host
Test: ./art/tools/run-libjdwp-tests.sh --mode=host
Bug: 73255278
Bug: 111357976
Change-Id: I62d6b1f4ff387c794ba45093c3d6773aaf642067
Diffstat (limited to 'runtime/common_dex_operations.h')
-rw-r--r-- | runtime/common_dex_operations.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/runtime/common_dex_operations.h b/runtime/common_dex_operations.h index c29043e7c6..15ab5f0387 100644 --- a/runtime/common_dex_operations.h +++ b/runtime/common_dex_operations.h @@ -27,6 +27,7 @@ #include "dex/primitive.h" #include "handle_scope-inl.h" #include "instrumentation.h" +#include "interpreter/interpreter.h" #include "interpreter/shadow_frame.h" #include "interpreter/unstarted_runtime.h" #include "jvalue-inl.h" @@ -172,6 +173,14 @@ ALWAYS_INLINE bool DoFieldPutCommon(Thread* self, if (UNLIKELY(self->IsExceptionPending())) { return false; } + if (shadow_frame.GetForcePopFrame()) { + // We need to check this here since we expect that the FieldWriteEvent happens before the + // actual field write. If one pops the stack we should not modify the field. The next + // instruction will force a pop. Return true. + DCHECK(Runtime::Current()->AreNonStandardExitsEnabled()); + DCHECK(interpreter::PrevFrameWillRetry(self, shadow_frame)); + return true; + } } switch (field_type) { |