summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-06-30 04:10:52 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-06-30 04:10:52 +0000
commitc0935935e6967a5760def402b8cc5f4361e9e99a (patch)
tree84b51492d442774e277e7e1e367aa35154322205
parentc92a468619bdde2f453862ff1fedbe8dbcb969bb (diff)
parent0e22eb8d80068beca156cb44bcba835ce50afb25 (diff)
downloadandroid_art-c0935935e6967a5760def402b8cc5f4361e9e99a.tar.gz
android_art-c0935935e6967a5760def402b8cc5f4361e9e99a.tar.bz2
android_art-c0935935e6967a5760def402b8cc5f4361e9e99a.zip
Merge cherrypicks of [2481491, 2481800, 2481782, 2481665, 2481547, 2481358, 2481802, 2481613, 2481668, 2481614, 2481594, 2481595, 2481548, 2481744, 2481493, 2481494, 2481709] into oc-release
Change-Id: I7dbe587a8e4fec711e67e974a8caf0351bd0c9bf
-rw-r--r--runtime/interpreter/interpreter_switch_impl.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/runtime/interpreter/interpreter_switch_impl.cc b/runtime/interpreter/interpreter_switch_impl.cc
index b191dd79a1..dcfe25b80d 100644
--- a/runtime/interpreter/interpreter_switch_impl.cc
+++ b/runtime/interpreter/interpreter_switch_impl.cc
@@ -196,7 +196,20 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item,
inst = inst->Next_1xx();
break;
case Instruction::MOVE_RESULT_OBJECT:
- PREAMBLE();
+ if (UNLIKELY(instrumentation->HasDexPcListeners())) {
+ // Special case the preamble to save and restore the result object. It could move
+ // during DexPcMovedEvent.
+ // Note that ideally we should have the result object be visible to GC as soon as it
+ // is returned, but that involves pretty heave surgery to the interpreter and the runtime
+ // that it may not be worth it. The way it is currently written, there is an implicit
+ // assumption the result register is updated last in the leaf method, and all methods
+ // in-between just return.
+ StackHandleScope<1> hs(self);
+ Handle<mirror::Object> result_object(hs.NewHandle(result_register.GetL()));
+ instrumentation->DexPcMovedEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
+ shadow_frame.GetMethod(), dex_pc);
+ result_register.SetL(result_object.Get());
+ }
shadow_frame.SetVRegReference(inst->VRegA_11x(inst_data), result_register.GetL());
inst = inst->Next_1xx();
break;