From b6e20ae17d0881a66c22532e4152ce6779454a92 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Mon, 7 Mar 2016 14:29:04 +0000 Subject: Clear inline caches at each full GC. This fixes occasional failures of 141-class-unload. Also fix a bug where clearing inline caches also cleared the dex pc associated with it. bug:26846185 bug:23128949 Change-Id: I77bf1dee229d7764c3cc21440829c7fba7b37001 --- compiler/jit/jit_compiler.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'compiler/jit/jit_compiler.cc') diff --git a/compiler/jit/jit_compiler.cc b/compiler/jit/jit_compiler.cc index 6ff1e2e95e..eeb25763a7 100644 --- a/compiler/jit/jit_compiler.cc +++ b/compiler/jit/jit_compiler.cc @@ -168,13 +168,14 @@ JitCompiler::JitCompiler() { compiler_driver_->SetDedupeEnabled(false); compiler_driver_->SetSupportBootImageFixup(false); + size_t thread_count = compiler_driver_->GetThreadCount(); if (compiler_options_->GetGenerateDebugInfo()) { #ifdef __ANDROID__ const char* prefix = "/data/misc/trace"; #else const char* prefix = "/tmp"; #endif - DCHECK_EQ(compiler_driver_->GetThreadCount(), 1u) + DCHECK_EQ(thread_count, 1u) << "Generating debug info only works with one compiler thread"; std::string perf_filename = std::string(prefix) + "/perf-" + std::to_string(getpid()) + ".map"; perf_file_.reset(OS::CreateEmptyFileWriteOnly(perf_filename.c_str())); @@ -183,6 +184,10 @@ JitCompiler::JitCompiler() { " Are you on a user build? Perf only works on userdebug/eng builds"; } } + + size_t inline_depth_limit = compiler_driver_->GetCompilerOptions().GetInlineDepthLimit(); + DCHECK_LT(thread_count * inline_depth_limit, std::numeric_limits::max()) + << "ProfilingInfo's inline counter can potentially overflow"; } JitCompiler::~JitCompiler() { -- cgit v1.2.3-59-g8ed1b