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

Unified Diff: src/hydrogen-instructions.h

Issue 6328009: Move swapping of operands for commutative binary operations to the lithium IR... Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 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 | « src/arm/lithium-arm.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.h
===================================================================
--- src/hydrogen-instructions.h (revision 6458)
+++ src/hydrogen-instructions.h (working copy)
@@ -1871,19 +1871,6 @@
HValue* left() const { return OperandAt(0); }
HValue* right() const { return OperandAt(1); }
- // TODO(kasperl): Move these helpers to the IA-32 Lithium
- // instruction sequence builder.
- HValue* LeastConstantOperand() const {
- if (IsCommutative() && left()->IsConstant()) return right();
- return left();
- }
- HValue* MostConstantOperand() const {
- if (IsCommutative() && left()->IsConstant()) return left();
- return right();
- }
-
- virtual bool IsCommutative() const { return false; }
-
virtual void PrintDataTo(StringStream* stream) const;
virtual int OperandCount() const { return operands_.length(); }
virtual HValue* OperandAt(int index) const { return operands_[index]; }
@@ -2335,12 +2322,6 @@
SetFlag(kCanOverflow);
}
- // Add is only commutative if two integer values are added and not if two
- // tagged values are added (because it might be a String concatenation).
- virtual bool IsCommutative() const {
- return !representation().IsTagged();
- }
-
virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
virtual HType CalculateInferredType() const;
@@ -2375,11 +2356,6 @@
virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
- // Only commutative if it is certain that not two objects are multiplicated.
- virtual bool IsCommutative() const {
- return !representation().IsTagged();
- }
-
DECLARE_CONCRETE_INSTRUCTION(Mul, "mul")
protected:
@@ -2423,7 +2399,6 @@
HBitAnd(HValue* left, HValue* right)
: HBitwiseBinaryOperation(left, right) { }
- virtual bool IsCommutative() const { return true; }
virtual HType CalculateInferredType() const;
DECLARE_CONCRETE_INSTRUCTION(BitAnd, "bit_and")
@@ -2438,7 +2413,6 @@
HBitXor(HValue* left, HValue* right)
: HBitwiseBinaryOperation(left, right) { }
- virtual bool IsCommutative() const { return true; }
virtual HType CalculateInferredType() const;
DECLARE_CONCRETE_INSTRUCTION(BitXor, "bit_xor")
@@ -2450,7 +2424,6 @@
HBitOr(HValue* left, HValue* right)
: HBitwiseBinaryOperation(left, right) { }
- virtual bool IsCommutative() const { return true; }
virtual HType CalculateInferredType() const;
DECLARE_CONCRETE_INSTRUCTION(BitOr, "bit_or")
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698