summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/builder.h
diff options
context:
space:
mode:
authorDavid Brazdil <dbrazdil@google.com>2015-01-23 14:39:08 +0000
committerDavid Brazdil <dbrazdil@google.com>2015-02-04 13:47:49 +0000
commit5e8b137d28c840b128e2488f954cccee3e86db14 (patch)
treec56e4c709ce07d605ab4b754e89f7739264feb73 /compiler/optimizing/builder.h
parentf9af19413333c271192c3b11425f865bd8054c0c (diff)
downloadandroid_art-5e8b137d28c840b128e2488f954cccee3e86db14.tar.gz
android_art-5e8b137d28c840b128e2488f954cccee3e86db14.tar.bz2
android_art-5e8b137d28c840b128e2488f954cccee3e86db14.zip
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
Diffstat (limited to 'compiler/optimizing/builder.h')
-rw-r--r--compiler/optimizing/builder.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/compiler/optimizing/builder.h b/compiler/optimizing/builder.h
index 8ee27a1b35..c5101363ee 100644
--- a/compiler/optimizing/builder.h
+++ b/compiler/optimizing/builder.h
@@ -34,19 +34,19 @@ class SwitchTable;
class HGraphBuilder : public ValueObject {
public:
- HGraphBuilder(ArenaAllocator* arena,
+ HGraphBuilder(HGraph* graph,
DexCompilationUnit* dex_compilation_unit,
const DexCompilationUnit* const outer_compilation_unit,
const DexFile* dex_file,
CompilerDriver* driver,
OptimizingCompilerStats* compiler_stats)
- : arena_(arena),
- branch_targets_(arena, 0),
- locals_(arena, 0),
+ : arena_(graph->GetArena()),
+ branch_targets_(graph->GetArena(), 0),
+ locals_(graph->GetArena(), 0),
entry_block_(nullptr),
exit_block_(nullptr),
current_block_(nullptr),
- graph_(nullptr),
+ graph_(graph),
constant0_(nullptr),
constant1_(nullptr),
dex_file_(dex_file),
@@ -59,14 +59,14 @@ class HGraphBuilder : public ValueObject {
compilation_stats_(compiler_stats) {}
// Only for unit testing.
- HGraphBuilder(ArenaAllocator* arena, Primitive::Type return_type = Primitive::kPrimInt)
- : arena_(arena),
- branch_targets_(arena, 0),
- locals_(arena, 0),
+ HGraphBuilder(HGraph* graph, Primitive::Type return_type = Primitive::kPrimInt)
+ : arena_(graph->GetArena()),
+ branch_targets_(graph->GetArena(), 0),
+ locals_(graph->GetArena(), 0),
entry_block_(nullptr),
exit_block_(nullptr),
current_block_(nullptr),
- graph_(nullptr),
+ graph_(graph),
constant0_(nullptr),
constant1_(nullptr),
dex_file_(nullptr),
@@ -78,7 +78,7 @@ class HGraphBuilder : public ValueObject {
latest_result_(nullptr),
compilation_stats_(nullptr) {}
- HGraph* BuildGraph(const DexFile::CodeItem& code, int start_instruction_id = 0);
+ bool BuildGraph(const DexFile::CodeItem& code);
private:
// Analyzes the dex instruction and adds HInstruction to the graph
@@ -249,7 +249,7 @@ class HGraphBuilder : public ValueObject {
HBasicBlock* entry_block_;
HBasicBlock* exit_block_;
HBasicBlock* current_block_;
- HGraph* graph_;
+ HGraph* const graph_;
HIntConstant* constant0_;
HIntConstant* constant1_;