From a836bc9760419af4a515f96c66100a39e865f3b9 Mon Sep 17 00:00:00 2001 From: Sebastien Hertz Date: Tue, 25 Nov 2014 16:30:53 +0100 Subject: Support proxy method in StackVisitor::GetThisObject Adds function artQuickGetProxyThisObject which returns the 'this' object of the proxy method using the QuickArgumentVisitor. Since proxy methods have the same layout than the kRefsAndArgs runtime method and 'this' is the 1st method argument, it is located in the first GPR. Bug: 17965861 Change-Id: Ic6ef6c83b9a549c25f9929d5e00ffe1d3a9a36f0 --- runtime/stack.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'runtime/stack.cc') diff --git a/runtime/stack.cc b/runtime/stack.cc index 43714b95e8..aaa5b898b3 100644 --- a/runtime/stack.cc +++ b/runtime/stack.cc @@ -113,6 +113,9 @@ uint32_t StackVisitor::GetDexPc(bool abort_on_failure) const { } } +extern "C" mirror::Object* artQuickGetProxyThisObject(StackReference* sp) + SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); + mirror::Object* StackVisitor::GetThisObject() const { mirror::ArtMethod* m = GetMethod(); if (m->IsStatic()) { @@ -125,6 +128,12 @@ mirror::Object* StackVisitor::GetThisObject() const { } else { return cur_shadow_frame_->GetVRegReference(0); } + } else if (m->IsProxyMethod()) { + if (cur_quick_frame_ != nullptr) { + return artQuickGetProxyThisObject(cur_quick_frame_); + } else { + return cur_shadow_frame_->GetVRegReference(0); + } } else if (m->IsOptimized(sizeof(void*))) { // TODO: Implement, currently only used for exceptions when jdwp is enabled. UNIMPLEMENTED(WARNING) -- cgit v1.2.3-59-g8ed1b