From 09b1d6f749437bdd47f61e7c4f924f6d16b59536 Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Wed, 7 Oct 2015 12:08:54 +0100 Subject: [PATCH] Enforce optimizing test marker for verification errors. Change-Id: Ie7babf162729fa02d285572ee043fa9e588d73cc --- compiler/optimizing/optimizing_compiler.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 28514e18e..a34717c3f 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -711,9 +711,6 @@ CompiledMethod* OptimizingCompiler::TryCompile(const DexFile::CodeItem* code_ite &arena, dex_file, method_idx, requires_barrier, compiler_driver->GetInstructionSet(), kInvalidInvokeType, compiler_driver->GetCompilerOptions().GetDebuggable()); - // For testing purposes, we put a special marker on method names that should be compiled - // with this compiler. This makes sure we're not regressing. - bool shouldCompile = method_name.find("$opt$") != std::string::npos; bool shouldOptimize = method_name.find("$opt$reg$") != std::string::npos && run_optimizations_; std::unique_ptr codegen( @@ -722,7 +719,6 @@ CompiledMethod* OptimizingCompiler::TryCompile(const DexFile::CodeItem* code_ite *compiler_driver->GetInstructionSetFeatures(), compiler_driver->GetCompilerOptions())); if (codegen.get() == nullptr) { - CHECK(!shouldCompile) << "Could not find code generator for optimizing compiler"; MaybeRecordStat(MethodCompilationStat::kNotCompiledNoCodegen); return nullptr; } @@ -763,8 +759,6 @@ CompiledMethod* OptimizingCompiler::TryCompile(const DexFile::CodeItem* code_ite { PassScope scope(HGraphBuilder::kBuilderPassName, &pass_observer); if (!builder.BuildGraph(*code_item)) { - DCHECK(!(IsCompilingWithCoreImage() && shouldCompile)) - << "Could not build graph in optimizing compiler"; pass_observer.SetGraphInBadState(); return nullptr; } @@ -857,6 +851,14 @@ CompiledMethod* OptimizingCompiler::Compile(const DexFile::CodeItem* code_item, } } + if (kIsDebugBuild && IsCompilingWithCoreImage()) { + // For testing purposes, we put a special marker on method names that should be compiled + // with this compiler. This makes sure we're not regressing. + std::string method_name = PrettyMethod(method_idx, dex_file); + bool shouldCompile = method_name.find("$opt$") != std::string::npos; + DCHECK((method != nullptr) || !shouldCompile) << "Didn't compile " << method_name; + } + return method; } -- 2.11.0