Chromium Code Reviews| Index: runtime/vm/intermediate_language.cc |
| =================================================================== |
| --- runtime/vm/intermediate_language.cc (revision 11934) |
| +++ runtime/vm/intermediate_language.cc (working copy) |
| @@ -201,6 +201,16 @@ |
| } |
| +BlockEntryInstr* Definition::GetBlock() const { |
| + // TODO(fschneider): Implement a faster way to get the block of an |
| + // instruction. |
| + ASSERT(previous() != NULL); |
| + Instruction* result = previous(); |
| + while (!result->IsBlockEntry()) result = result->previous(); |
| + return result->AsBlockEntry(); |
| +} |
| + |
| + |
| void ForwardInstructionIterator::RemoveCurrentFromGraph() { |
| current_ = current_->RemoveFromGraph(true); // Set current_ to previous. |
| } |
| @@ -587,6 +597,16 @@ |
| } |
| +bool BlockEntryInstr::Dominates(BlockEntryInstr* other) const { |
| + ASSERT(other != NULL); |
|
Kevin Millikin (Google)
2012/09/06 12:42:42
Add a TODO to make this faster :)
Florian Schneider
2012/09/06 13:05:53
Done.
|
| + BlockEntryInstr* current = other; |
| + while (current != NULL && current != this) { |
| + current = current->dominator(); |
| + } |
| + return current == this; |
| +} |
| + |
| + |
| void ControlInstruction::DiscoverBlocks( |
| BlockEntryInstr* current_block, |
| GrowableArray<BlockEntryInstr*>* preorder, |
| @@ -1274,6 +1294,12 @@ |
| void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| + // Add deoptimization descriptor for deoptimizing instructions |
| + // that may be inserted before this instruction. |
| + compiler->AddCurrentDescriptor(PcDescriptors::kDeoptBefore, |
| + GetDeoptId(), |
| + 0); // No token position. |
| + |
| if (HasParallelMove()) { |
| compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
| } |