diff options
| author | 2015-02-04 13:51:17 +0000 | |
|---|---|---|
| committer | 2015-02-04 13:51:18 +0000 | |
| commit | c2024144da54504d819869dc928ce4ac975634d4 (patch) | |
| tree | 13948cf9a32333337655f1ea4c3a2886bcea25cb /compiler/optimizing/codegen_test.cc | |
| parent | 53150eb4fb5c3bbcb0138b8dccb481726299f6ab (diff) | |
| parent | 5e8b137d28c840b128e2488f954cccee3e86db14 (diff) | |
Merge "Create HGraph outside Builder, print timings"
Diffstat (limited to 'compiler/optimizing/codegen_test.cc')
| -rw-r--r-- | compiler/optimizing/codegen_test.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/compiler/optimizing/codegen_test.cc b/compiler/optimizing/codegen_test.cc index dfa4748811..e0e0b4c3e8 100644 --- a/compiler/optimizing/codegen_test.cc +++ b/compiler/optimizing/codegen_test.cc @@ -180,10 +180,11 @@ static void RunCodeOptimized(HGraph* graph, static void TestCode(const uint16_t* data, bool has_result = false, int32_t expected = 0) { ArenaPool pool; ArenaAllocator arena(&pool); - HGraphBuilder builder(&arena); + HGraph* graph = new (&arena) HGraph(&arena); + HGraphBuilder builder(graph); const DexFile::CodeItem* item = reinterpret_cast<const DexFile::CodeItem*>(data); - HGraph* graph = builder.BuildGraph(*item); - ASSERT_NE(graph, nullptr); + bool graph_built = builder.BuildGraph(*item); + ASSERT_TRUE(graph_built); // Remove suspend checks, they cannot be executed in this context. RemoveSuspendChecks(graph); RunCodeBaseline(graph, has_result, expected); @@ -192,10 +193,11 @@ static void TestCode(const uint16_t* data, bool has_result = false, int32_t expe static void TestCodeLong(const uint16_t* data, bool has_result, int64_t expected) { ArenaPool pool; ArenaAllocator arena(&pool); - HGraphBuilder builder(&arena, Primitive::kPrimLong); + HGraph* graph = new (&arena) HGraph(&arena); + HGraphBuilder builder(graph, Primitive::kPrimLong); const DexFile::CodeItem* item = reinterpret_cast<const DexFile::CodeItem*>(data); - HGraph* graph = builder.BuildGraph(*item); - ASSERT_NE(graph, nullptr); + bool graph_built = builder.BuildGraph(*item); + ASSERT_TRUE(graph_built); // Remove suspend checks, they cannot be executed in this context. RemoveSuspendChecks(graph); RunCodeBaseline(graph, has_result, expected); |