Move saved SSA map to ScopedArenaAllocator to save memory.
Bug: 13564922
Change-Id: I917d451267ca6fceb2f6b2ff33b872ee8c209893
diff --git a/compiler/dex/ssa_transformation.cc b/compiler/dex/ssa_transformation.cc
index dab98d9..5f89c21 100644
--- a/compiler/dex/ssa_transformation.cc
+++ b/compiler/dex/ssa_transformation.cc
@@ -621,8 +621,9 @@
int map_size = sizeof(int) * cu_->num_dalvik_registers;
/* Save SSA map snapshot */
+ ScopedArenaAllocator allocator(&cu_->arena_stack);
int* saved_ssa_map =
- static_cast<int*>(arena_->Alloc(map_size, kArenaAllocDalvikToSSAMap));
+ static_cast<int*>(allocator.Alloc(map_size, kArenaAllocDalvikToSSAMap));
memcpy(saved_ssa_map, vreg_to_ssa_map_, map_size);
if (block->fall_through != NullBasicBlockId) {
@@ -648,7 +649,6 @@
memcpy(vreg_to_ssa_map_, saved_ssa_map, map_size);
}
}
- vreg_to_ssa_map_ = saved_ssa_map;
return;
}