summaryrefslogtreecommitdiff
path: root/compiler/optimizing/codegen_test_utils.h
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2017-10-09 13:09:07 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-10-09 13:09:07 +0000
commit5eeba2f9d741d8dd0fd306bd7879d41ddf52ad2e (patch)
treed35def7e438000fd90e8422488ad950d21824751 /compiler/optimizing/codegen_test_utils.h
parenteba601320af25d29c362d0c630e63de0e4e37db4 (diff)
parent0967cd94860178a5809a9678d005b18c20c24707 (diff)
Merge "Use ScopedArenaAllocator for register allocation."
am: 0967cd9486 Change-Id: I4c2f72f29552e3f809db5bc45bd6da3f0d4fbfd2
Diffstat (limited to 'compiler/optimizing/codegen_test_utils.h')
-rw-r--r--compiler/optimizing/codegen_test_utils.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/compiler/optimizing/codegen_test_utils.h b/compiler/optimizing/codegen_test_utils.h
index 5f4593ff0e4..bcbcc12349a 100644
--- a/compiler/optimizing/codegen_test_utils.h
+++ b/compiler/optimizing/codegen_test_utils.h
@@ -295,10 +295,15 @@ static void RunCodeNoCheck(CodeGenerator* codegen,
const std::function<void(HGraph*)>& hook_before_codegen,
bool has_result,
Expected expected) {
- SsaLivenessAnalysis liveness(graph, codegen);
- PrepareForRegisterAllocation(graph).Run();
- liveness.Analyze();
- RegisterAllocator::Create(graph->GetAllocator(), codegen, liveness)->AllocateRegisters();
+ {
+ ScopedArenaAllocator local_allocator(graph->GetArenaStack());
+ SsaLivenessAnalysis liveness(graph, codegen, &local_allocator);
+ PrepareForRegisterAllocation(graph).Run();
+ liveness.Analyze();
+ std::unique_ptr<RegisterAllocator> register_allocator =
+ RegisterAllocator::Create(&local_allocator, codegen, liveness);
+ register_allocator->AllocateRegisters();
+ }
hook_before_codegen(graph);
InternalCodeAllocator allocator;
codegen->Compile(&allocator);