summaryrefslogtreecommitdiffstats
path: root/runtime/stack.cc
diff options
context:
space:
mode:
authorSebastien Hertz <shertz@google.com>2014-11-25 16:30:53 +0100
committerSebastien Hertz <shertz@google.com>2014-12-09 12:58:25 +0100
commita836bc9760419af4a515f96c66100a39e865f3b9 (patch)
tree3719f9a8ee66ca734fdb62fa77dae0b60e45ae3c /runtime/stack.cc
parentc4925d4c02dc8f8d51cb2653b5e7a99f6c9fd7d7 (diff)
downloadart-a836bc9760419af4a515f96c66100a39e865f3b9.zip
art-a836bc9760419af4a515f96c66100a39e865f3b9.tar.gz
art-a836bc9760419af4a515f96c66100a39e865f3b9.tar.bz2
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
Diffstat (limited to 'runtime/stack.cc')
-rw-r--r--runtime/stack.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/runtime/stack.cc b/runtime/stack.cc
index 43714b9..aaa5b89 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<mirror::ArtMethod>* 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)