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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 10832180: Eliminate phis that do not reach any non-environment uses. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address Kevin's comment Created 8 years, 4 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
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 3a79e2ab048bc09caf9e687e03cab7a9b97e543a..6cca1c246f972b725da3f51c2cca6c85d190fbba 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -410,6 +410,22 @@ void JoinEntryInstr::InsertPhi(intptr_t var_index, intptr_t var_count) {
}
+void JoinEntryInstr::RemoveDeadPhis() {
+ if (phis_ == NULL) return;
+
+ for (intptr_t i = 0; i < phis_->length(); i++) {
+ PhiInstr* phi = (*phis_)[i];
+ if ((phi != NULL) && !phi->is_alive()) {
+ (*phis_)[i] = NULL;
+ phi_count_--;
+ }
+ }
+
+ // Check if we removed all phis.
+ if (phi_count_ == 0) phis_ = NULL;
+}
+
+
intptr_t Instruction::SuccessorCount() const {
return 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