From 013d1ee96b928f3bda9031e94d4a69f827133ce6 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Wed, 4 Dec 2019 16:18:15 +0000 Subject: 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 --- runtime/quick_exception_handler.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'runtime/quick_exception_handler.cc') diff --git a/runtime/quick_exception_handler.cc b/runtime/quick_exception_handler.cc index 727bdf02e1..0e04b7b696 100644 --- a/runtime/quick_exception_handler.cc +++ b/runtime/quick_exception_handler.cc @@ -33,6 +33,7 @@ #include "mirror/class-inl.h" #include "mirror/class_loader.h" #include "mirror/throwable.h" +#include "nterp_helpers.h" #include "oat_quick_method_header.h" #include "stack.h" #include "stack_map.h" @@ -663,6 +664,12 @@ void QuickExceptionHandler::DoLongJump(bool smash_caller_saves) { if (smash_caller_saves) { context_->SmashCallerSaves(); } + if (handler_method_ != nullptr && + handler_method_header_ != nullptr && + handler_method_header_->IsNterpMethodHeader()) { + context_->SetNterpDexPC(reinterpret_cast( + handler_method_->DexInstructions().Insns() + handler_dex_pc_)); + } context_->DoLongJump(); UNREACHABLE(); } -- cgit v1.2.3-59-g8ed1b