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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 17101028: Refactor load forwarding pass to use a Place abstraction. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 87e5407ce22e6968396bfe23f4293e389e4d84c9..58823144b9e2d87b3e1fb0d527a363f4944b90d0 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -937,6 +937,20 @@ void JoinEntryInstr::InsertPhi(PhiInstr* phi) {
phis_->Add(phi);
}
+void JoinEntryInstr::RemovePhi(PhiInstr* phi) {
+ ASSERT(phis_ != NULL);
+ intptr_t to_index = 0;
+ for (intptr_t from_index = 0; from_index < phis_->length(); ++from_index) {
Kevin Millikin (Google) 2013/06/25 09:18:29 Is this better than searching for the phi and repl
Vyacheslav Egorov (Google) 2013/06/25 18:02:39 Done.
+ PhiInstr* current = (*phis_)[from_index];
+ if (phi != current) {
+ if (to_index != from_index) {
+ (*phis_)[to_index] = current;
+ }
+ to_index++;
+ }
+ }
+ phis_->RemoveLast();
+}
void JoinEntryInstr::RemoveDeadPhis(Definition* replacement) {
if (phis_ == NULL) return;

Powered by Google App Engine
This is Rietveld 408576698