From 6fc471e510d6a4e9c31fcab6c0542e2efdf50099 Mon Sep 17 00:00:00 2001 From: Alex Light Date: Tue, 3 Mar 2020 16:51:33 -0800 Subject: Check vreg count on debuggable Previously we were only performing a check that we got the correct number of vregs on deoptimization when kIsDebugBuild. Extend this check to also occur when the runtime is JavaDebuggable. Bug: 144947842 Test: none Change-Id: I7d240008391a1499c159e478b59a509e2362e99f --- runtime/quick_exception_handler.cc | 9 ++++++++- 1 file changed, 8 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 90732e1cca..8c68c5c627 100644 --- a/runtime/quick_exception_handler.cc +++ b/runtime/quick_exception_handler.cc @@ -15,10 +15,12 @@ */ #include "quick_exception_handler.h" +#include #include "arch/context.h" #include "art_method-inl.h" #include "base/enums.h" +#include "base/globals.h" #include "base/logging.h" // For VLOG_IS_ON. #include "base/systrace.h" #include "dex/dex_file_types.h" @@ -465,7 +467,12 @@ class DeoptimizeStackVisitor final : public StackVisitor { ? code_info.GetInlineDexRegisterMapOf(stack_map, GetCurrentInlinedFrame()) : code_info.GetDexRegisterMapOf(stack_map); - DCHECK_EQ(vreg_map.size(), number_of_vregs); + if (kIsDebugBuild || UNLIKELY(Runtime::Current()->IsJavaDebuggable())) { + CHECK_EQ(vreg_map.size(), number_of_vregs) << *Thread::Current() + << "Deopting: " << m->PrettyMethod() + << " inlined? " + << std::boolalpha << IsInInlinedFrame(); + } if (vreg_map.empty()) { return; } -- cgit v1.2.3-59-g8ed1b