Create a scoped arena allocator and use that for LVN.
This saves more than 0.5s of boot.oat compilation time
on Nexus 5.
TODO: Move other stuff to the scoped allocator. This CL
alone increases the peak memory allocation. By reusing
the memory for other parts of the compilation we should
reduce this overhead.
Change-Id: Ifbc00aab4f3afd0000da818dfe68b96713824a08
diff --git a/compiler/dex/quick/local_optimizations.cc b/compiler/dex/quick/local_optimizations.cc
index 7a2dce1..6df91e6 100644
--- a/compiler/dex/quick/local_optimizations.cc
+++ b/compiler/dex/quick/local_optimizations.cc
@@ -248,7 +248,7 @@
/* Only sink store instructions */
if (sink_distance && !is_this_lir_load) {
LIR* new_store_lir =
- static_cast<LIR*>(arena_->Alloc(sizeof(LIR), ArenaAllocator::kAllocLIR));
+ static_cast<LIR*>(arena_->Alloc(sizeof(LIR), kArenaAllocLIR));
*new_store_lir = *this_lir;
/*
* Stop point found - insert *before* the check_lir
@@ -445,7 +445,7 @@
if (slot >= 0) {
LIR* cur_lir = prev_inst_list[slot];
LIR* new_load_lir =
- static_cast<LIR*>(arena_->Alloc(sizeof(LIR), ArenaAllocator::kAllocLIR));
+ static_cast<LIR*>(arena_->Alloc(sizeof(LIR), kArenaAllocLIR));
*new_load_lir = *this_lir;
/*
* Insertion is guaranteed to succeed since check_lir