diff options
| author | 2016-04-07 16:03:51 +0000 | |
|---|---|---|
| committer | 2016-04-07 16:03:51 +0000 | |
| commit | 8913162a5959035f100f608fd5ccc348cf3922cf (patch) | |
| tree | d3e6dd3e0c8e35288db04a263438c7a0081b2bb3 /compiler/optimizing/nodes.cc | |
| parent | 950dd553041b324e9e343a60d94d45596b5c7926 (diff) | |
| parent | dee58d6bb6d567fcd0c4f39d8d690c3acaf0e432 (diff) | |
Merge "Revert "Revert "Refactor HGraphBuilder and SsaBuilder to remove HLocals"""
Diffstat (limited to 'compiler/optimizing/nodes.cc')
| -rw-r--r-- | compiler/optimizing/nodes.cc | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index 9f448af73a..1086cbf503 100644 --- a/compiler/optimizing/nodes.cc +++ b/compiler/optimizing/nodes.cc @@ -318,21 +318,11 @@ void HGraph::SimplifyLoop(HBasicBlock* header) { } } - // Place the suspend check at the beginning of the header, so that live registers - // will be known when allocating registers. Note that code generation can still - // generate the suspend check at the back edge, but needs to be careful with - // loop phi spill slots (which are not written to at back edge). HInstruction* first_instruction = header->GetFirstInstruction(); - if (first_instruction == nullptr) { - HSuspendCheck* check = new (arena_) HSuspendCheck(header->GetDexPc()); - header->AddInstruction(check); - first_instruction = check; - } else if (!first_instruction->IsSuspendCheck()) { - HSuspendCheck* check = new (arena_) HSuspendCheck(header->GetDexPc()); - header->InsertInstructionBefore(check, first_instruction); - first_instruction = check; + if (first_instruction != nullptr && first_instruction->IsSuspendCheck()) { + // Called from DeadBlockElimination. Update SuspendCheck pointer. + info->SetSuspendCheck(first_instruction->AsSuspendCheck()); } - info->SetSuspendCheck(first_instruction->AsSuspendCheck()); } void HGraph::ComputeTryBlockInformation() { @@ -1882,6 +1872,7 @@ HInstruction* HGraph::InlineInto(HGraph* outer_graph, HInvoke* invoke) { instr_it.Advance()) { HInstruction* current = instr_it.Current(); if (current->NeedsEnvironment()) { + DCHECK(current->HasEnvironment()); current->GetEnvironment()->SetAndCopyParentChain( outer_graph->GetArena(), invoke->GetEnvironment()); } |