summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2016-10-03 22:49:46 -0700
committer Mathieu Chartier <mathieuc@google.com> 2016-10-03 22:51:00 -0700
commit0715c0b7c047053c54212ae247868675710fb29c (patch)
treec7557393f7f8cef7971d431a1af05e4cba07f5d1
parent5075b0e5e2cb942d3cb929a9fe7e1abe66beb562 (diff)
Add handle wrapper for interpreter field get/set
The listeners have thread suspension for jdwp tests. Bug: 31113334 Test: tools/run-jdwp-tests.sh '--mode=host' '--variant=X32' --no-jit --debug Change-Id: I08f17432cc0c79ee9a0163eb88d4d6355f6851ca
-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 6c8e53df8e..edd28e1a00 100644
--- a/runtime/interpreter/interpreter_common.cc
+++ b/runtime/interpreter/interpreter_common.cc
@@ -60,6 +60,9 @@ bool DoFieldGet(Thread* self, ShadowFrame& shadow_frame, const Instruction* inst
// Report this field access to instrumentation if needed.
instrumentation::Instrumentation* instrumentation = Runtime::Current()->GetInstrumentation();
if (UNLIKELY(instrumentation->HasFieldReadListeners())) {
+ StackHandleScope<1> hs(self);
+ // Wrap in handle wrapper in case the listener does thread suspension.
+ HandleWrapperObjPtr<mirror::Object> h(hs.NewHandleWrapper(&obj));
ObjPtr<Object> this_object;
if (!f->IsStatic()) {
this_object = obj;
@@ -263,6 +266,9 @@ bool DoFieldPut(Thread* self, const ShadowFrame& shadow_frame, const Instruction
// the field from the base of the object, we need to look for it first.
instrumentation::Instrumentation* instrumentation = Runtime::Current()->GetInstrumentation();
if (UNLIKELY(instrumentation->HasFieldWriteListeners())) {
+ StackHandleScope<1> hs(self);
+ // Wrap in handle wrapper in case the listener does thread suspension.
+ HandleWrapperObjPtr<mirror::Object> h(hs.NewHandleWrapper(&obj));
JValue field_value = GetFieldValue<field_type>(shadow_frame, vregA);
ObjPtr<Object> this_object = f->IsStatic() ? nullptr : obj;
instrumentation->FieldWriteEvent(self, this_object.Decode(),