diff options
author | 2015-09-02 17:03:22 +0100 | |
---|---|---|
committer | 2015-09-03 13:09:37 +0100 | |
commit | 91e11c0c840193c6822e66846020b6647de243d5 (patch) | |
tree | 0c5398ef59c464c1848afd0113c74b6aeb75cf42 /compiler/optimizing/bounds_check_elimination.cc | |
parent | f9f6441c665b5ff9004d3ed55014f46d416fb1bb (diff) |
Optimizing: Tag basic block allocations with their source.
Replace GrowableArray with ArenaVector in HBasicBlock and,
to track the source of allocations, assign one new and two
Quick's arena allocation types to these vectors. Rename
kArenaAllocSuccessor to kArenaAllocSuccessors.
Bug: 23736311
Change-Id: I984aef6e615ae2380a532f5c6726af21015f43f5
Diffstat (limited to 'compiler/optimizing/bounds_check_elimination.cc')
-rw-r--r-- | compiler/optimizing/bounds_check_elimination.cc | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/compiler/optimizing/bounds_check_elimination.cc b/compiler/optimizing/bounds_check_elimination.cc index ebc0adc64a..70ad408fdf 100644 --- a/compiler/optimizing/bounds_check_elimination.cc +++ b/compiler/optimizing/bounds_check_elimination.cc @@ -275,9 +275,8 @@ class ArrayAccessInsideLoopFinder : public ValueObject { // Loop header of loop_info. Exiting loop is normal. return false; } - const GrowableArray<HBasicBlock*>& successors = block->GetSuccessors(); - for (size_t i = 0; i < successors.Size(); i++) { - if (!loop_info->Contains(*successors.Get(i))) { + for (HBasicBlock* successor : block->GetSuccessors()) { + if (!loop_info->Contains(*successor)) { // One of the successors exits the loop. return true; } @@ -797,8 +796,8 @@ class MonotonicValueRange : public ValueRange { HBasicBlock* new_pre_header = header->GetDominator(); DCHECK(new_pre_header == header->GetLoopInformation()->GetPreHeader()); HBasicBlock* if_block = new_pre_header->GetDominator(); - HBasicBlock* dummy_block = if_block->GetSuccessors().Get(0); // True successor. - HBasicBlock* deopt_block = if_block->GetSuccessors().Get(1); // False successor. + HBasicBlock* dummy_block = if_block->GetSuccessor(0); // True successor. + HBasicBlock* deopt_block = if_block->GetSuccessor(1); // False successor. dummy_block->AddInstruction(new (graph->GetArena()) HGoto()); deopt_block->AddInstruction(new (graph->GetArena()) HGoto()); @@ -845,14 +844,14 @@ class MonotonicValueRange : public ValueRange { DCHECK(header->IsLoopHeader()); HBasicBlock* pre_header = header->GetDominator(); if (loop_entry_test_block_added) { - DCHECK(deopt_block->GetSuccessors().Get(0) == pre_header); + DCHECK(deopt_block->GetSuccessor(0) == pre_header); } else { DCHECK(deopt_block == pre_header); } HGraph* graph = header->GetGraph(); HSuspendCheck* suspend_check = header->GetLoopInformation()->GetSuspendCheck(); if (loop_entry_test_block_added) { - DCHECK_EQ(deopt_block, header->GetDominator()->GetDominator()->GetSuccessors().Get(1)); + DCHECK_EQ(deopt_block, header->GetDominator()->GetDominator()->GetSuccessor(1)); } HIntConstant* const_instr = graph->GetIntConstant(constant); @@ -926,7 +925,7 @@ class MonotonicValueRange : public ValueRange { DCHECK(header->IsLoopHeader()); HBasicBlock* pre_header = header->GetDominator(); if (loop_entry_test_block_added) { - DCHECK(deopt_block->GetSuccessors().Get(0) == pre_header); + DCHECK(deopt_block->GetSuccessor(0) == pre_header); } else { DCHECK(deopt_block == pre_header); } @@ -1256,11 +1255,11 @@ class BCEVisitor : public HGraphVisitor { HBasicBlock* true_successor = instruction->IfTrueSuccessor(); // There should be no critical edge at this point. - DCHECK_EQ(true_successor->GetPredecessors().Size(), 1u); + DCHECK_EQ(true_successor->GetPredecessors().size(), 1u); HBasicBlock* false_successor = instruction->IfFalseSuccessor(); // There should be no critical edge at this point. - DCHECK_EQ(false_successor->GetPredecessors().Size(), 1u); + DCHECK_EQ(false_successor->GetPredecessors().size(), 1u); ValueRange* left_range = LookupValueRange(left, block); MonotonicValueRange* left_monotonic_range = nullptr; @@ -1468,10 +1467,10 @@ class BCEVisitor : public HGraphVisitor { // Start with input 1. Input 0 is from the incoming block. HInstruction* input1 = phi->InputAt(1); DCHECK(phi->GetBlock()->GetLoopInformation()->IsBackEdge( - *phi->GetBlock()->GetPredecessors().Get(1))); + *phi->GetBlock()->GetPredecessor(1))); for (size_t i = 2, e = phi->InputCount(); i < e; ++i) { DCHECK(phi->GetBlock()->GetLoopInformation()->IsBackEdge( - *phi->GetBlock()->GetPredecessors().Get(i))); + *phi->GetBlock()->GetPredecessor(i))); if (input1 != phi->InputAt(i)) { return false; } |