Add handle wrapper for interpreter iget/iput quick
JDWP has thread suspension in instrumentation listeners. The fix is
to use handle wrappers here. This change fixes JDWP tests.
Bug: 31113334
Test: art/tools/run-jdwp-tests.sh '--mode=host' '--variant=X64' --debug
Change-Id: Ic7dcb1201ec44946e8002547b2f7f5645b4dea48
diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc
index f212cda..1ed3d55 100644
--- a/runtime/interpreter/interpreter_common.cc
+++ b/runtime/interpreter/interpreter_common.cc
@@ -163,6 +163,9 @@
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 @@
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(),