summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/interpreter/interpreter_common.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc
index f212cda2a4..1ed3d550b9 100644
--- a/runtime/interpreter/interpreter_common.cc
+++ b/runtime/interpreter/interpreter_common.cc
@@ -163,6 +163,9 @@ bool DoIGetQuick(ShadowFrame& shadow_frame, const Instruction* inst, uint16_t in
field_offset.Uint32Value());
DCHECK(f != nullptr);
DCHECK(!f->IsStatic());
+ StackHandleScope<1> hs(Thread::Current());
+ // Save obj in case the instrumentation event has thread suspension.
+ HandleWrapperObjPtr<mirror::Object> h = hs.NewHandleWrapper(&obj);
instrumentation->FieldReadEvent(Thread::Current(),
obj.Ptr(),
shadow_frame.GetMethod(),
@@ -392,6 +395,9 @@ bool DoIPutQuick(const ShadowFrame& shadow_frame, const Instruction* inst, uint1
DCHECK(f != nullptr);
DCHECK(!f->IsStatic());
JValue field_value = GetFieldValue<field_type>(shadow_frame, vregA);
+ StackHandleScope<1> hs(Thread::Current());
+ // Save obj in case the instrumentation event has thread suspension.
+ HandleWrapperObjPtr<mirror::Object> h = hs.NewHandleWrapper(&obj);
instrumentation->FieldWriteEvent(Thread::Current(),
obj.Ptr(),
shadow_frame.GetMethod(),