From efc3f02504e8e3768cc18ab5347c5a6d19d6a935 Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Wed, 28 Oct 2015 12:19:06 -0500 Subject: ART: Fix deopt from optimized code under inlining Deoptimization of inlined frames would use the outer method's vreg map, thus starting interpreter in bogus state. Bug: 25331616 Change-Id: I1d4aefc731bb1386f3e6186a89b59981836480b3 --- runtime/quick_exception_handler.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'runtime/quick_exception_handler.cc') diff --git a/runtime/quick_exception_handler.cc b/runtime/quick_exception_handler.cc index 53b4f3a3b5..1552318c1e 100644 --- a/runtime/quick_exception_handler.cc +++ b/runtime/quick_exception_handler.cc @@ -372,9 +372,14 @@ class DeoptimizeStackVisitor FINAL : public StackVisitor { StackMapEncoding encoding = code_info.ExtractEncoding(); StackMap stack_map = code_info.GetStackMapForNativePcOffset(native_pc_offset, encoding); const size_t number_of_vregs = m->GetCodeItem()->registers_size_; - DexRegisterMap vreg_map = code_info.GetDexRegisterMapOf(stack_map, encoding, number_of_vregs); MemoryRegion stack_mask = stack_map.GetStackMask(encoding); uint32_t register_mask = stack_map.GetRegisterMask(encoding); + DexRegisterMap vreg_map = IsInInlinedFrame() + ? code_info.GetDexRegisterMapAtDepth(GetCurrentInliningDepth() - 1, + code_info.GetInlineInfoOf(stack_map, encoding), + encoding, + number_of_vregs) + : code_info.GetDexRegisterMapOf(stack_map, encoding, number_of_vregs); for (uint16_t vreg = 0; vreg < number_of_vregs; ++vreg) { if (updated_vregs != nullptr && updated_vregs[vreg]) { -- cgit v1.2.3-59-g8ed1b