diff options
author | 2019-12-04 16:18:15 +0000 | |
---|---|---|
committer | 2019-12-17 09:43:08 +0000 | |
commit | 013d1ee96b928f3bda9031e94d4a69f827133ce6 (patch) | |
tree | 4e374c043330f123dc3888922b554fd1291349b4 /runtime/stack.cc | |
parent | 9ca8b2bf46978e3a5698f8a27b48aa7eff3514df (diff) |
Introduce the notion of an nterp frame.
See comments in nterp_helpers.cc. An nterp frame follows the
calling conventions and exception handling of the compiler. There are
no ManagedStack transitions, and the compiler and interpreter can
just call each other directly.
For the stack walker, an nterp frame looks like a compiled frame.
This CL introduces an nterp frame, another CL will contain an
implementation for x64.
Bug: 119800099
Test: test.py
Change-Id: Ie9b691f58908b7f283b4cd63b84b651526155d27
Diffstat (limited to 'runtime/stack.cc')
-rw-r--r-- | runtime/stack.cc | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/runtime/stack.cc b/runtime/stack.cc index e69bc1ea17..410e0fd144 100644 --- a/runtime/stack.cc +++ b/runtime/stack.cc @@ -38,6 +38,7 @@ #include "mirror/class-inl.h" #include "mirror/object-inl.h" #include "mirror/object_array-inl.h" +#include "nterp_helpers.h" #include "oat_quick_method_header.h" #include "obj_ptr-inl.h" #include "quick/quick_method_frame_info.h" @@ -122,13 +123,16 @@ uint32_t StackVisitor::GetDexPc(bool abort_on_failure) const { return current_inline_frames_.back().GetDexPc(); } else if (cur_oat_quick_method_header_ == nullptr) { return dex::kDexNoIndex; - } else if (!(*GetCurrentQuickFrame())->IsNative()) { + } else if ((*GetCurrentQuickFrame())->IsNative()) { + return cur_oat_quick_method_header_->ToDexPc( + GetCurrentQuickFrame(), cur_quick_frame_pc_, abort_on_failure); + } else if (cur_oat_quick_method_header_->IsOptimized()) { StackMap* stack_map = GetCurrentStackMap(); DCHECK(stack_map->IsValid()); return stack_map->GetDexPc(); } else { - return cur_oat_quick_method_header_->ToDexPc( - GetCurrentQuickFrame(), cur_quick_frame_pc_, abort_on_failure); + DCHECK(cur_oat_quick_method_header_->IsNterpMethodHeader()); + return NterpGetDexPC(cur_quick_frame_); } } else { return 0; @@ -214,6 +218,10 @@ bool StackVisitor::GetVReg(ArtMethod* m, if (GetVRegFromDebuggerShadowFrame(vreg, kind, val)) { return true; } + if (cur_oat_quick_method_header_->IsNterpMethodHeader()) { + *val = NterpGetVReg(cur_quick_frame_, vreg); + return true; + } DCHECK(cur_oat_quick_method_header_->IsOptimized()); if (location.has_value() && kind != kReferenceVReg) { uint32_t val2 = *val; @@ -772,7 +780,12 @@ static uint32_t GetNumberOfReferenceArgsWithoutReceiver(ArtMethod* method) QuickMethodFrameInfo StackVisitor::GetCurrentQuickFrameInfo() const { if (cur_oat_quick_method_header_ != nullptr) { - return cur_oat_quick_method_header_->GetFrameInfo(); + if (cur_oat_quick_method_header_->IsOptimized()) { + return cur_oat_quick_method_header_->GetFrameInfo(); + } else { + DCHECK(cur_oat_quick_method_header_->IsNterpMethodHeader()); + return NterpFrameInfo(cur_quick_frame_); + } } ArtMethod* method = GetMethod(); |