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

Unified Diff: src/hydrogen-instructions.cc

Issue 6604002: Remove some more uses of subgraphs and more cleanup of the graph builder. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge/build/ia32
Patch Set: Created 9 years, 10 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 | « src/hydrogen.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index c5a7146eb430653ff049af8c6169e55b3ca4bf94..49e52570468577f33e618ddba248b5750074ffbe 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -285,24 +285,19 @@ void HValue::SetOperandAt(int index, HValue* value) {
void HValue::ReplaceAndDelete(HValue* other) {
- ReplaceValue(other);
+ if (other != NULL) ReplaceValue(other);
Delete();
}
void HValue::ReplaceValue(HValue* other) {
- ZoneList<HValue*> start_uses(2);
for (int i = 0; i < uses_.length(); ++i) {
- HValue* use = uses_.at(i);
- if (!use->block()->IsStartBlock()) {
- InternalReplaceAtUse(use, other);
- other->uses_.Add(use);
- } else {
- start_uses.Add(use);
- }
+ HValue* use = uses_[i];
+ ASSERT(!use->block()->IsStartBlock());
+ InternalReplaceAtUse(use, other);
+ other->uses_.Add(use);
}
- uses_.Clear();
- uses_.AddAll(start_uses);
+ uses_.Rewind(0);
}
« no previous file with comments | « src/hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698