Index: src/hydrogen-instructions.h |
=================================================================== |
--- src/hydrogen-instructions.h (revision 9842) |
+++ src/hydrogen-instructions.h (working copy) |
@@ -67,10 +67,8 @@ |
V(ArgumentsLength) \ |
V(ArgumentsObject) \ |
V(ArrayLiteral) \ |
- V(BitAnd) \ |
+ V(Bitwise) \ |
V(BitNot) \ |
- V(BitOr) \ |
- V(BitXor) \ |
V(BlockEntry) \ |
V(BoundsCheck) \ |
V(Branch) \ |
@@ -3028,62 +3026,37 @@ |
}; |
-class HBitAnd: public HBitwiseBinaryOperation { |
+class HBitwise: public HBitwiseBinaryOperation { |
public: |
- HBitAnd(HValue* context, HValue* left, HValue* right) |
- : HBitwiseBinaryOperation(context, left, right) { } |
+ HBitwise(Token::Value op, HValue* context, HValue* left, HValue* right) |
+ : HBitwiseBinaryOperation(context, left, right), op_(op) { |
+ ASSERT(op == Token::BIT_AND || |
+ op == Token::BIT_OR || |
+ op == Token::BIT_XOR); |
+ } |
+ Token::Value op() const { return op_; } |
+ |
virtual bool IsCommutative() const { return true; } |
- virtual HType CalculateInferredType(); |
- DECLARE_CONCRETE_INSTRUCTION(BitAnd) |
+ DECLARE_CONCRETE_INSTRUCTION(Bitwise) |
protected: |
virtual bool DataEquals(HValue* other) { return true; } |
virtual Range* InferRange(); |
-}; |
- |
-class HBitXor: public HBitwiseBinaryOperation { |
- public: |
- HBitXor(HValue* context, HValue* left, HValue* right) |
- : HBitwiseBinaryOperation(context, left, right) { } |
- |
- virtual bool IsCommutative() const { return true; } |
- virtual HType CalculateInferredType(); |
- |
- DECLARE_CONCRETE_INSTRUCTION(BitXor) |
- |
- protected: |
- virtual bool DataEquals(HValue* other) { return true; } |
+ private: |
+ Token::Value op_; |
}; |
-class HBitOr: public HBitwiseBinaryOperation { |
- public: |
- HBitOr(HValue* context, HValue* left, HValue* right) |
- : HBitwiseBinaryOperation(context, left, right) { } |
- |
- virtual bool IsCommutative() const { return true; } |
- virtual HType CalculateInferredType(); |
- |
- DECLARE_CONCRETE_INSTRUCTION(BitOr) |
- |
- protected: |
- virtual bool DataEquals(HValue* other) { return true; } |
- |
- virtual Range* InferRange(); |
-}; |
- |
- |
class HShl: public HBitwiseBinaryOperation { |
public: |
HShl(HValue* context, HValue* left, HValue* right) |
: HBitwiseBinaryOperation(context, left, right) { } |
virtual Range* InferRange(); |
- virtual HType CalculateInferredType(); |
DECLARE_CONCRETE_INSTRUCTION(Shl) |
@@ -3098,7 +3071,6 @@ |
: HBitwiseBinaryOperation(context, left, right) { } |
virtual Range* InferRange(); |
- virtual HType CalculateInferredType(); |
DECLARE_CONCRETE_INSTRUCTION(Shr) |
@@ -3113,7 +3085,6 @@ |
: HBitwiseBinaryOperation(context, left, right) { } |
virtual Range* InferRange(); |
- virtual HType CalculateInferredType(); |
DECLARE_CONCRETE_INSTRUCTION(Sar) |