summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/register_allocator_test.cc
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/register_allocator_test.cc
parentf9af19413333c271192c3b11425f865bd8054c0c (diff)
downloadart-5e8b137d28c840b128e2488f954cccee3e86db14.tar.gz
art-5e8b137d28c840b128e2488f954cccee3e86db14.tar.bz2
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/register_allocator_test.cc')
-rw-r--r--compiler/optimizing/register_allocator_test.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/optimizing/register_allocator_test.cc b/compiler/optimizing/register_allocator_test.cc
index cb5010afcd..65456ae5bd 100644
--- a/compiler/optimizing/register_allocator_test.cc
+++ b/compiler/optimizing/register_allocator_test.cc
@@ -37,9 +37,10 @@ namespace art {
static bool Check(const uint16_t* data) {
ArenaPool pool;
ArenaAllocator allocator(&pool);
- HGraphBuilder builder(&allocator);
+ HGraph* graph = new (&allocator) HGraph(&allocator);
+ HGraphBuilder builder(graph);
const DexFile::CodeItem* item = reinterpret_cast<const DexFile::CodeItem*>(data);
- HGraph* graph = builder.BuildGraph(*item);
+ builder.BuildGraph(*item);
graph->TryBuildingSsa();
x86::CodeGeneratorX86 codegen(graph, CompilerOptions());
SsaLivenessAnalysis liveness(*graph, &codegen);
@@ -249,9 +250,10 @@ TEST(RegisterAllocatorTest, Loop2) {
}
static HGraph* BuildSSAGraph(const uint16_t* data, ArenaAllocator* allocator) {
- HGraphBuilder builder(allocator);
+ HGraph* graph = new (allocator) HGraph(allocator);
+ HGraphBuilder builder(graph);
const DexFile::CodeItem* item = reinterpret_cast<const DexFile::CodeItem*>(data);
- HGraph* graph = builder.BuildGraph(*item);
+ builder.BuildGraph(*item);
graph->TryBuildingSsa();
return graph;
}