| Index: src/hydrogen-instructions.h
|
| ===================================================================
|
| --- src/hydrogen-instructions.h (revision 10035)
|
| +++ src/hydrogen-instructions.h (working copy)
|
| @@ -118,8 +118,10 @@
|
| V(IsConstructCallAndBranch) \
|
| V(IsNilAndBranch) \
|
| V(IsObjectAndBranch) \
|
| + V(IsStringAndBranch) \
|
| V(IsSmiAndBranch) \
|
| V(IsUndetectableAndBranch) \
|
| + V(StringCompareAndBranch) \
|
| V(JSArrayLength) \
|
| V(LeaveInlined) \
|
| V(LoadContextSlot) \
|
| @@ -2326,6 +2328,12 @@
|
| ASSERT(HasDoubleValue());
|
| return double_value_;
|
| }
|
| + bool HasNumberValue() const { return has_int32_value_ || has_double_value_; }
|
| + int32_t NumberValueAsInteger32() const {
|
| + ASSERT(HasNumberValue());
|
| + if (has_int32_value_) return int32_value_;
|
| + return DoubleToInt32(double_value_);
|
| + }
|
| bool HasStringValue() const { return handle_->IsString(); }
|
|
|
| bool ToBoolean() const;
|
| @@ -2716,7 +2724,19 @@
|
| DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch)
|
| };
|
|
|
| +class HIsStringAndBranch: public HUnaryControlInstruction {
|
| + public:
|
| + explicit HIsStringAndBranch(HValue* value)
|
| + : HUnaryControlInstruction(value, NULL, NULL) { }
|
|
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| + return Representation::Tagged();
|
| + }
|
| +
|
| + DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch)
|
| +};
|
| +
|
| +
|
| class HIsSmiAndBranch: public HUnaryControlInstruction {
|
| public:
|
| explicit HIsSmiAndBranch(HValue* value)
|
| @@ -2746,6 +2766,42 @@
|
| };
|
|
|
|
|
| +class HStringCompareAndBranch: public HTemplateControlInstruction<2, 3> {
|
| + public:
|
| + HStringCompareAndBranch(HValue* context,
|
| + HValue* left,
|
| + HValue* right,
|
| + Token::Value token)
|
| + : token_(token) {
|
| + ASSERT(Token::IsCompareOp(token));
|
| + SetOperandAt(0, context);
|
| + SetOperandAt(1, left);
|
| + SetOperandAt(2, right);
|
| + set_representation(Representation::Tagged());
|
| + }
|
| +
|
| + HValue* context() { return OperandAt(0); }
|
| + HValue* left() { return OperandAt(1); }
|
| + HValue* right() { return OperandAt(2); }
|
| + Token::Value token() const { return token_; }
|
| +
|
| + virtual void PrintDataTo(StringStream* stream);
|
| +
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| + return Representation::Tagged();
|
| + }
|
| +
|
| + Representation GetInputRepresentation() const {
|
| + return Representation::Tagged();
|
| + }
|
| +
|
| + DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch)
|
| +
|
| + private:
|
| + Token::Value token_;
|
| +};
|
| +
|
| +
|
| class HIsConstructCallAndBranch: public HTemplateControlInstruction<2, 0> {
|
| public:
|
| virtual Representation RequiredInputRepresentation(int index) {
|
| @@ -2943,6 +2999,11 @@
|
|
|
| virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
|
|
|
| + static HInstruction* NewHAdd(Zone* zone,
|
| + HValue* context,
|
| + HValue* left,
|
| + HValue* right);
|
| +
|
| virtual HType CalculateInferredType();
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(Add)
|
| @@ -2963,6 +3024,11 @@
|
|
|
| virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
|
|
|
| + static HInstruction* NewHSub(Zone* zone,
|
| + HValue* context,
|
| + HValue* left,
|
| + HValue* right);
|
| +
|
| DECLARE_CONCRETE_INSTRUCTION(Sub)
|
|
|
| protected:
|
| @@ -2986,6 +3052,11 @@
|
| return !representation().IsTagged();
|
| }
|
|
|
| + static HInstruction* NewHMul(Zone* zone,
|
| + HValue* context,
|
| + HValue* left,
|
| + HValue* right);
|
| +
|
| DECLARE_CONCRETE_INSTRUCTION(Mul)
|
|
|
| protected:
|
| @@ -3014,6 +3085,11 @@
|
|
|
| virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
|
|
|
| + static HInstruction* NewHMod(Zone* zone,
|
| + HValue* context,
|
| + HValue* left,
|
| + HValue* right);
|
| +
|
| DECLARE_CONCRETE_INSTRUCTION(Mod)
|
|
|
| protected:
|
| @@ -3033,6 +3109,12 @@
|
|
|
| virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
|
|
|
| +
|
| + static HInstruction* NewHDiv(Zone* zone,
|
| + HValue* context,
|
| + HValue* left,
|
| + HValue* right);
|
| +
|
| DECLARE_CONCRETE_INSTRUCTION(Div)
|
|
|
| protected:
|
| @@ -3055,6 +3137,12 @@
|
|
|
| virtual bool IsCommutative() const { return true; }
|
|
|
| + static HInstruction* NewHBitwise(Zone* zone,
|
| + Token::Value op,
|
| + HValue* context,
|
| + HValue* left,
|
| + HValue* right);
|
| +
|
| DECLARE_CONCRETE_INSTRUCTION(Bitwise)
|
|
|
| protected:
|
| @@ -3076,6 +3164,11 @@
|
|
|
| virtual Range* InferRange();
|
|
|
| + static HInstruction* NewHShl(Zone* zone,
|
| + HValue* context,
|
| + HValue* left,
|
| + HValue* right);
|
| +
|
| DECLARE_CONCRETE_INSTRUCTION(Shl)
|
|
|
| protected:
|
| @@ -3090,6 +3183,11 @@
|
|
|
| virtual Range* InferRange();
|
|
|
| + static HInstruction* NewHShr(Zone* zone,
|
| + HValue* context,
|
| + HValue* left,
|
| + HValue* right);
|
| +
|
| DECLARE_CONCRETE_INSTRUCTION(Shr)
|
|
|
| protected:
|
| @@ -3104,6 +3202,11 @@
|
|
|
| virtual Range* InferRange();
|
|
|
| + static HInstruction* NewHSar(Zone* zone,
|
| + HValue* context,
|
| + HValue* left,
|
| + HValue* right);
|
| +
|
| DECLARE_CONCRETE_INSTRUCTION(Sar)
|
|
|
| protected:
|
|
|