Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(923)

Unified Diff: runtime/vm/intermediate_language.cc

Issue 10909094: Implement loop invariant code motion for check instructions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());
}

Powered by Google App Engine
This is Rietveld 408576698