Chromium Code Reviews| Index: src/hydrogen-instructions.h |
| =================================================================== |
| --- src/hydrogen-instructions.h (revision 10969) |
| +++ src/hydrogen-instructions.h (working copy) |
| @@ -140,6 +140,7 @@ |
| V(LoadNamedField) \ |
| V(LoadNamedFieldPolymorphic) \ |
| V(LoadNamedGeneric) \ |
| + V(MathFloorOfDiv) \ |
| V(Mod) \ |
| V(Mul) \ |
| V(ObjectLiteral) \ |
| @@ -1928,15 +1929,7 @@ |
| } |
| } |
| - virtual HValue* Canonicalize() { |
| - // If the input is integer32 then we replace the floor instruction |
| - // with its inputs. This happens before the representation changes are |
| - // introduced. |
| - if (op() == kMathFloor) { |
| - if (value()->representation().IsInteger32()) return value(); |
| - } |
| - return this; |
| - } |
| + virtual HValue* Canonicalize(); |
| BuiltinFunctionId op() const { return op_; } |
| const char* OpName() const; |
| @@ -2654,6 +2647,21 @@ |
| }; |
| +class HMathFloorOfDiv: public HBinaryOperation { |
| + public: |
| + HMathFloorOfDiv(HValue* context, HValue* left, HValue* right) |
| + : HBinaryOperation(context, left, right) { |
| + set_representation(Representation::Integer32()); |
|
fschneider
2012/03/28 09:59:18
I think you can make GVN handle this instruction b
Alexandre
2012/03/28 16:27:38
Done.
|
| + } |
| + |
| + virtual Representation RequiredInputRepresentation(int index) { |
| + return Representation::Integer32(); |
| + } |
| + |
| + DECLARE_CONCRETE_INSTRUCTION(MathFloorOfDiv) |
| +}; |
| + |
| + |
| class HArithmeticBinaryOperation: public HBinaryOperation { |
| public: |
| HArithmeticBinaryOperation(HValue* context, HValue* left, HValue* right) |