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

Unified Diff: src/x64/codegen-x64.cc

Issue 603029: Push revision 3834 to trunk to fix binary operation bug that causes... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 10 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/version.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/codegen-x64.cc
===================================================================
--- src/x64/codegen-x64.cc (revision 3835)
+++ src/x64/codegen-x64.cc (working copy)
@@ -8019,6 +8019,8 @@
}
} else if (left.is(left_arg)) {
__ movq(right_arg, right);
+ } else if (right.is(right_arg)) {
+ __ movq(left_arg, left);
} else if (left.is(right_arg)) {
if (IsOperationCommutative()) {
__ movq(left_arg, right);
@@ -8037,8 +8039,6 @@
__ movq(right_arg, right);
__ movq(left_arg, left);
}
- } else if (right.is(right_arg)) {
- __ movq(left_arg, left);
} else {
// Order of moves is not important.
__ movq(left_arg, left);
@@ -8074,6 +8074,10 @@
__ Move(left_arg, right);
SetArgsReversed();
} else {
+ // For non-commutative operations, left and right_arg might be
+ // the same register. Therefore, the order of the moves is
+ // important here in order to not overwrite left before moving
+ // it to left_arg.
__ movq(left_arg, left);
__ Move(right_arg, right);
}
@@ -8106,8 +8110,12 @@
__ Move(right_arg, left);
SetArgsReversed();
} else {
+ // For non-commutative operations, right and left_arg might be
+ // the same register. Therefore, the order of the moves is
+ // important here in order to not overwrite right before moving
+ // it to right_arg.
+ __ movq(right_arg, right);
__ Move(left_arg, left);
- __ movq(right_arg, right);
}
// Update flags to indicate that arguments are in registers.
SetArgsInRegisters();
« no previous file with comments | « src/version.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698