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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 10765007: Cleanups. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
===================================================================
--- runtime/vm/intermediate_language.cc (revision 9469)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -73,6 +73,34 @@
#undef DEFINE_ACCEPT
+void ForwardInstructionIterator::RemoveCurrentFromGraph() {
+ ASSERT(!current_->IsBlockEntry());
+ ASSERT(!current_->IsBranch());
+ ASSERT(!current_->IsThrow());
+ ASSERT(!current_->IsReturn());
+ ASSERT(!current_->IsReThrow());
+ ASSERT(current_->previous() != NULL);
+ Instruction* prev = current_->previous();
+ Instruction* next = current_->next();
+ prev->set_next(next);
+ ASSERT(next != NULL);
+ if (current_ != block_entry_->last_instruction()) {
+ ASSERT(!next->IsBlockEntry());
+ next->set_previous(prev);
+ } else {
+ ASSERT(current_->IsBind());
+ // Removing the last instruction of a block.
+ // Update last_instruction of the current basic block.
+ block_entry_->set_last_instruction(prev);
+ }
+ // Reset successor and previous instruction to indicate
+ // that the instruction is removed from the graph.
+ current_->set_previous(NULL);
+ current_->set_next(NULL);
+ current_ = prev;
+}
+
+
// True iff. the v2 is above v1 on stack, or one of them is constant.
static bool VerifyValues(Value* v1, Value* v2) {
ASSERT(v1->IsUse() && v2->IsUse());
@@ -507,8 +535,6 @@
intptr_t Instruction::SuccessorCount() const {
- ASSERT(!IsBranch());
- ASSERT(!IsGraphEntry());
ASSERT(next() == NULL || next()->IsBlockEntry());
return (next() != NULL) ? 1 : 0;
}
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698