summaryrefslogtreecommitdiff
path: root/compiler/dex/quick/ralloc_util.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2015-02-13 10:28:29 +0000
committer Vladimir Marko <vmarko@google.com> 2015-02-13 11:29:04 +0000
commite4fcc5ba2284c201c022b52d27f7a1201d696324 (patch)
tree2f490060978baeb85c79d6184fcc08135f506637 /compiler/dex/quick/ralloc_util.cc
parent8240a8af33aedea9a4fe5c3b394d7c025ad081fb (diff)
Clean up Scoped-/ArenaAlocator array allocations.
Change-Id: Id718f8a4450adf1608306286fa4e6b9194022532
Diffstat (limited to 'compiler/dex/quick/ralloc_util.cc')
-rw-r--r--compiler/dex/quick/ralloc_util.cc11
1 files changed, 3 insertions, 8 deletions
diff --git a/compiler/dex/quick/ralloc_util.cc b/compiler/dex/quick/ralloc_util.cc
index 8efafb23fe..67fb8040f7 100644
--- a/compiler/dex/quick/ralloc_util.cc
+++ b/compiler/dex/quick/ralloc_util.cc
@@ -1191,8 +1191,7 @@ void Mir2Lir::DoPromotion() {
int num_regs = mir_graph_->GetNumOfCodeAndTempVRs();
const int promotion_threshold = 1;
// Allocate the promotion map - one entry for each Dalvik vReg or compiler temp
- promotion_map_ = static_cast<PromotionMap*>
- (arena_->Alloc(num_regs * sizeof(promotion_map_[0]), kArenaAllocRegAlloc));
+ promotion_map_ = arena_->AllocArray<PromotionMap>(num_regs, kArenaAllocRegAlloc);
// Allow target code to add any special registers
AdjustSpillMask();
@@ -1210,12 +1209,8 @@ void Mir2Lir::DoPromotion() {
*/
size_t core_reg_count_size = WideGPRsAreAliases() ? num_regs : num_regs * 2;
size_t fp_reg_count_size = WideFPRsAreAliases() ? num_regs : num_regs * 2;
- RefCounts *core_regs =
- static_cast<RefCounts*>(arena_->Alloc(sizeof(RefCounts) * core_reg_count_size,
- kArenaAllocRegAlloc));
- RefCounts *fp_regs =
- static_cast<RefCounts *>(arena_->Alloc(sizeof(RefCounts) * fp_reg_count_size,
- kArenaAllocRegAlloc));
+ RefCounts *core_regs = arena_->AllocArray<RefCounts>(core_reg_count_size, kArenaAllocRegAlloc);
+ RefCounts *fp_regs = arena_->AllocArray<RefCounts>(fp_reg_count_size, kArenaAllocRegAlloc);
// Set ssa names for original Dalvik registers
for (int i = 0; i < num_regs; i++) {
core_regs[i].s_reg = fp_regs[i].s_reg = i;