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

Unified Diff: src/hydrogen-instructions.cc

Issue 143903016: Fixed floor-of-div optimization. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 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 | « no previous file | test/mjsunit/regress/regress-334708.js » ('j') | 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 062b5ae7ace247dc6a38891952d77c0f827c7143..453239b62c6517a567eed450a1a204223dfa6100 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -1442,7 +1442,6 @@ HValue* HUnaryMathOperation::Canonicalize() {
if (op() == kMathFloor) {
HValue* val = value();
- if (val->IsChange()) val = HChange::cast(val)->value();
if (val->IsDiv() && (val->UseCount() == 1)) {
HDiv* hdiv = HDiv::cast(val);
HValue* left = hdiv->left();
@@ -1481,17 +1480,8 @@ HValue* HUnaryMathOperation::Canonicalize() {
}
HMathFloorOfDiv* instr =
HMathFloorOfDiv::New(block()->zone(), context(), new_left, new_right);
- // Replace this HMathFloor instruction by the new HMathFloorOfDiv.
instr->InsertBefore(this);
- ReplaceAllUsesWith(instr);
- Kill();
- // We know the division had no other uses than this HMathFloor. Delete it.
- // Dead code elimination will deal with |left| and |right| if
- // appropriate.
- hdiv->DeleteAndReplaceWith(NULL);
-
- // Return NULL to remove this instruction from the graph.
- return NULL;
+ return instr;
}
}
return this;
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-334708.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698