From 5e8b137d28c840b128e2488f954cccee3e86db14 Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Fri, 23 Jan 2015 14:39:08 +0000 Subject: Create HGraph outside Builder, print timings This patch refactors the way HGraph objects are created, moving the instantiation out of the Builder class and creating the CodeGenerator earlier. The patch uses this to build a single interface for printing timings info and dumping the CFG. Change-Id: I2eb63eabf28e2d0f5cdc7affaa690c3a4b1bdd21 --- compiler/optimizing/inliner.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'compiler/optimizing/inliner.cc') diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc index 41e516492a..32f6972c84 100644 --- a/compiler/optimizing/inliner.cc +++ b/compiler/optimizing/inliner.cc @@ -124,16 +124,18 @@ bool HInliner::TryInline(HInvoke* invoke_instruction, resolved_method->GetAccessFlags(), nullptr); + HGraph* callee_graph = + new (graph_->GetArena()) HGraph(graph_->GetArena(), graph_->GetCurrentInstructionId()); + OptimizingCompilerStats inline_stats; - HGraphBuilder builder(graph_->GetArena(), + HGraphBuilder builder(callee_graph, &dex_compilation_unit, &outer_compilation_unit_, &outer_dex_file, compiler_driver_, &inline_stats); - HGraph* callee_graph = builder.BuildGraph(*code_item, graph_->GetCurrentInstructionId()); - if (callee_graph == nullptr) { + if (!builder.BuildGraph(*code_item)) { VLOG(compiler) << "Method " << PrettyMethod(method_index, outer_dex_file) << " could not be built, so cannot be inlined"; return false; -- cgit v1.2.3-59-g8ed1b