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

Unified Diff: src/hydrogen-instructions.h

Issue 14680011: Rollback of r14587 in trunk branch. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 7 years, 7 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/arm/lithium-arm.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 3ea99d40a64415c3571b21f2195d2f6b9384c28a..467e67fb8181d35198ae60ccc3ccb7f2598e3fc7 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -3363,27 +3363,16 @@ class HBinaryOperation: public HTemplateInstruction<3> {
HValue* left() { return OperandAt(1); }
HValue* right() { return OperandAt(2); }
- // True if switching left and right operands likely generates better code.
- bool AreOperandsBetterSwitched() {
- if (!IsCommutative()) return false;
-
- // Constant operands are better off on the right, they can be inlined in
- // many situations on most platforms.
- if (left()->IsConstant()) return true;
- if (right()->IsConstant()) return false;
-
- // Otherwise, if there is only one use of the right operand, it would be
- // better off on the left for platforms that only have 2-arg arithmetic
- // ops (e.g ia32, x64) that clobber the left operand.
- return (right()->UseCount() == 1);
- }
-
- HValue* BetterLeftOperand() {
- return AreOperandsBetterSwitched() ? right() : left();
+ // TODO(kasperl): Move these helpers to the IA-32 Lithium
+ // instruction sequence builder.
+ HValue* LeastConstantOperand() {
+ if (IsCommutative() && left()->IsConstant()) return right();
+ return left();
}
- HValue* BetterRightOperand() {
- return AreOperandsBetterSwitched() ? left() : right();
+ HValue* MostConstantOperand() {
+ if (IsCommutative() && left()->IsConstant()) return left();
+ return right();
}
void set_observed_input_representation(int index, Representation rep) {
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698