diff options
| author | 2016-10-26 22:57:02 -0700 | |
|---|---|---|
| committer | 2016-10-26 23:18:55 -0700 | |
| commit | a314773a624f9f51391be91bda3472bbdbe0050e (patch) | |
| tree | 11cd3182265c3426b00a34acc5c36961b351408f | |
| parent | e22305b8a093a892a10029e905064776fd2082c5 (diff) | |
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
| -rw-r--r-- | runtime/interpreter/interpreter_common.cc | 6 |
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(), |