diff options
author | 2017-10-03 14:49:14 +0100 | |
---|---|---|
committer | 2017-10-06 17:53:50 +0100 | |
commit | ca6fff898afcb62491458ae8bcd428bfb3043da1 (patch) | |
tree | 195a6b16d3a4b34acc2faf91ce56f448efb15e07 /compiler/optimizing/instruction_simplifier_shared.cc | |
parent | aa7273e56fbafc2692c8d20a31b50d2f4bdd2aa1 (diff) |
ART: Use ScopedArenaAllocator for pass-local data.
Passes using local ArenaAllocator were hiding their memory
usage from the allocation counting, making it difficult to
track down where memory was used. Using ScopedArenaAllocator
reveals the memory usage.
This changes the HGraph constructor which requires a lot of
changes in tests. Refactor these tests to limit the amount
of work needed the next time we change that constructor.
Test: m test-art-host-gtest
Test: testrunner.py --host
Test: Build with kArenaAllocatorCountAllocations = true.
Bug: 64312607
Change-Id: I34939e4086b500d6e827ff3ef2211d1a421ac91a
Diffstat (limited to 'compiler/optimizing/instruction_simplifier_shared.cc')
-rw-r--r-- | compiler/optimizing/instruction_simplifier_shared.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/optimizing/instruction_simplifier_shared.cc b/compiler/optimizing/instruction_simplifier_shared.cc index 73d866fbea..037e98c3bf 100644 --- a/compiler/optimizing/instruction_simplifier_shared.cc +++ b/compiler/optimizing/instruction_simplifier_shared.cc @@ -75,7 +75,7 @@ bool TrySimpleMultiplyAccumulatePatterns(HMul* mul, return false; } - ArenaAllocator* arena = mul->GetBlock()->GetGraph()->GetArena(); + ArenaAllocator* arena = mul->GetBlock()->GetGraph()->GetAllocator(); HMultiplyAccumulate* mulacc = new(arena) HMultiplyAccumulate( mul->GetType(), op_kind, input_a, input_a, input_b, mul->GetDexPc()); @@ -105,7 +105,7 @@ bool TryCombineMultiplyAccumulate(HMul* mul, InstructionSet isa) { return false; } - ArenaAllocator* arena = mul->GetBlock()->GetGraph()->GetArena(); + ArenaAllocator* arena = mul->GetBlock()->GetGraph()->GetAllocator(); if (mul->HasOnlyOneNonEnvironmentUse()) { HInstruction* use = mul->GetUses().front().GetUser(); @@ -216,7 +216,7 @@ bool TryMergeNegatedInput(HBinaryOperation* op) { // BIC dst, src, mask (respectively ORN, EON) HInstruction* src = hnot->AsNot()->GetInput(); - HBitwiseNegatedRight* neg_op = new (hnot->GetBlock()->GetGraph()->GetArena()) + HBitwiseNegatedRight* neg_op = new (hnot->GetBlock()->GetGraph()->GetAllocator()) HBitwiseNegatedRight(op->GetType(), op->GetKind(), hother, src, op->GetDexPc()); op->GetBlock()->ReplaceAndRemoveInstructionWith(op, neg_op); @@ -255,7 +255,7 @@ bool TryExtractArrayAccessAddress(HInstruction* access, // Proceed to extract the base address computation. HGraph* graph = access->GetBlock()->GetGraph(); - ArenaAllocator* arena = graph->GetArena(); + ArenaAllocator* arena = graph->GetAllocator(); HIntConstant* offset = graph->GetIntConstant(data_offset); HIntermediateAddress* address = new (arena) HIntermediateAddress(array, offset, kNoDexPc); @@ -289,7 +289,7 @@ bool TryExtractVecArrayAccessAddress(HVecMemoryOperation* access, HInstruction* } HGraph* graph = access->GetBlock()->GetGraph(); - ArenaAllocator* arena = graph->GetArena(); + ArenaAllocator* arena = graph->GetAllocator(); DataType::Type packed_type = access->GetPackedType(); uint32_t data_offset = mirror::Array::DataOffset( DataType::Size(packed_type)).Uint32Value(); |