| Index: src/hydrogen-instructions.h
|
| ===================================================================
|
| --- src/hydrogen-instructions.h (revision 9531)
|
| +++ src/hydrogen-instructions.h (working copy)
|
| @@ -118,7 +118,7 @@
|
| V(InstanceOfKnownGlobal) \
|
| V(InvokeFunction) \
|
| V(IsConstructCallAndBranch) \
|
| - V(IsNullAndBranch) \
|
| + V(IsNilAndBranch) \
|
| V(IsObjectAndBranch) \
|
| V(IsSmiAndBranch) \
|
| V(IsUndetectableAndBranch) \
|
| @@ -625,7 +625,7 @@
|
| void ComputeInitialRange();
|
|
|
| // Representation helpers.
|
| - virtual Representation RequiredInputRepresentation(int index) const = 0;
|
| + virtual Representation RequiredInputRepresentation(int index) = 0;
|
|
|
| virtual Representation InferredRepresentation() {
|
| return representation();
|
| @@ -841,7 +841,7 @@
|
|
|
| class HBlockEntry: public HTemplateInstruction<0> {
|
| public:
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -854,7 +854,7 @@
|
| // HSoftDeoptimize does not end a basic block as opposed to HDeoptimize.
|
| class HSoftDeoptimize: public HTemplateInstruction<0> {
|
| public:
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -866,7 +866,7 @@
|
| public:
|
| explicit HDeoptimize(int environment_length) : values_(environment_length) { }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -908,10 +908,10 @@
|
| class HGoto: public HTemplateControlInstruction<1, 0> {
|
| public:
|
| explicit HGoto(HBasicBlock* target) {
|
| - SetSuccessorAt(0, target);
|
| - }
|
| + SetSuccessorAt(0, target);
|
| + }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -951,7 +951,7 @@
|
| : HUnaryControlInstruction(value, NULL, NULL) { }
|
|
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -983,7 +983,7 @@
|
|
|
| Handle<Map> map() const { return map_; }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -1000,7 +1000,7 @@
|
| SetOperandAt(0, value);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -1014,7 +1014,7 @@
|
|
|
| class HAbnormalExit: public HTemplateControlInstruction<0, 0> {
|
| public:
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -1049,7 +1049,7 @@
|
| SetAllSideEffects();
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -1064,7 +1064,7 @@
|
| public:
|
| explicit HUseConst(HValue* old_value) : HUnaryOperation(old_value) { }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -1083,7 +1083,7 @@
|
|
|
| virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return representation(); // Same as the output representation.
|
| }
|
|
|
| @@ -1094,28 +1094,28 @@
|
| class HChange: public HUnaryOperation {
|
| public:
|
| HChange(HValue* value,
|
| - Representation from,
|
| Representation to,
|
| bool is_truncating,
|
| bool deoptimize_on_undefined)
|
| - : HUnaryOperation(value),
|
| - from_(from),
|
| - deoptimize_on_undefined_(deoptimize_on_undefined) {
|
| - ASSERT(!from.IsNone() && !to.IsNone());
|
| - ASSERT(!from.Equals(to));
|
| + : HUnaryOperation(value) {
|
| + ASSERT(!value->representation().IsNone() && !to.IsNone());
|
| + ASSERT(!value->representation().Equals(to));
|
| set_representation(to);
|
| SetFlag(kUseGVN);
|
| + if (deoptimize_on_undefined) SetFlag(kDeoptimizeOnUndefined);
|
| if (is_truncating) SetFlag(kTruncatingToInt32);
|
| }
|
|
|
| virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
|
|
|
| - Representation from() const { return from_; }
|
| - Representation to() const { return representation(); }
|
| - bool deoptimize_on_undefined() const { return deoptimize_on_undefined_; }
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| - return from_;
|
| + Representation from() { return value()->representation(); }
|
| + Representation to() { return representation(); }
|
| + bool deoptimize_on_undefined() const {
|
| + return CheckFlag(kDeoptimizeOnUndefined);
|
| }
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| + return from();
|
| + }
|
|
|
| virtual Range* InferRange();
|
|
|
| @@ -1124,16 +1124,7 @@
|
| DECLARE_CONCRETE_INSTRUCTION(Change)
|
|
|
| protected:
|
| - virtual bool DataEquals(HValue* other) {
|
| - if (!other->IsChange()) return false;
|
| - HChange* change = HChange::cast(other);
|
| - return to().Equals(change->to())
|
| - && deoptimize_on_undefined() == change->deoptimize_on_undefined();
|
| - }
|
| -
|
| - private:
|
| - Representation from_;
|
| - bool deoptimize_on_undefined_;
|
| + virtual bool DataEquals(HValue* other) { return true; }
|
| };
|
|
|
|
|
| @@ -1145,7 +1136,7 @@
|
| SetFlag(kUseGVN);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -1164,7 +1155,7 @@
|
| SetFlag(kUseGVN);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -1223,7 +1214,7 @@
|
| virtual int OperandCount() { return values_.length(); }
|
| virtual HValue* OperandAt(int index) { return values_[index]; }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -1268,7 +1259,7 @@
|
|
|
| HValue* context() { return OperandAt(0); }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -1306,7 +1297,7 @@
|
| FunctionLiteral* function() const { return function_; }
|
| CallKind call_kind() const { return call_kind_; }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -1323,7 +1314,7 @@
|
| public:
|
| HLeaveInlined() {}
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -1337,7 +1328,7 @@
|
| set_representation(Representation::Tagged());
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -1354,7 +1345,7 @@
|
| SetFlag(kUseGVN);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -1372,7 +1363,7 @@
|
| SetFlag(kUseGVN);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -1392,7 +1383,7 @@
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(OuterContext);
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -1410,7 +1401,7 @@
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(GlobalObject)
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -1429,7 +1420,7 @@
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver)
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -1465,7 +1456,7 @@
|
| SetOperandAt(0, value);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -1485,7 +1476,7 @@
|
|
|
| virtual void PrintDataTo(StringStream* stream);
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -1500,7 +1491,7 @@
|
| : HBinaryCall(context, function, argument_count) {
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -1525,7 +1516,7 @@
|
|
|
| virtual void PrintDataTo(StringStream* stream);
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -1542,7 +1533,7 @@
|
| : HBinaryCall(context, key, argument_count) {
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -1566,7 +1557,7 @@
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(CallNamed)
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -1583,7 +1574,7 @@
|
|
|
| HValue* context() { return value(); }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -1602,7 +1593,7 @@
|
| HValue* context() { return value(); }
|
| Handle<String> name() const { return name_; }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -1622,7 +1613,7 @@
|
|
|
| Handle<JSFunction> target() const { return target_; }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -1639,7 +1630,7 @@
|
| : HBinaryCall(context, constructor, argument_count) {
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -1666,7 +1657,7 @@
|
| const Runtime::Function* function() const { return c_function_; }
|
| Handle<String> name() const { return name_; }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -1692,7 +1683,7 @@
|
| SetFlag(kDependsOnMaps);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -1716,7 +1707,7 @@
|
| SetFlag(kDependsOnArrayLengths);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -1735,7 +1726,7 @@
|
| SetFlag(kDependsOnMaps);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -1754,7 +1745,7 @@
|
| SetFlag(kTruncatingToInt32);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Integer32();
|
| }
|
| virtual HType CalculateInferredType();
|
| @@ -1804,7 +1795,7 @@
|
|
|
| virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| if (index == 0) {
|
| return Representation::Tagged();
|
| } else {
|
| @@ -1861,7 +1852,7 @@
|
| SetFlag(kDependsOnMaps);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -1884,7 +1875,7 @@
|
| SetFlag(kUseGVN);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -1908,7 +1899,7 @@
|
| SetFlag(kDependsOnMaps);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
| virtual void PrintDataTo(StringStream* stream);
|
| @@ -1938,7 +1929,7 @@
|
| SetFlag(kUseGVN);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
| virtual void PrintDataTo(StringStream* stream);
|
| @@ -1978,7 +1969,9 @@
|
| return new HCheckInstanceType(value, IS_SYMBOL);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual void PrintDataTo(StringStream* stream);
|
| +
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -2008,6 +2001,8 @@
|
| LAST_INTERVAL_CHECK = IS_JS_ARRAY
|
| };
|
|
|
| + const char* GetCheckName();
|
| +
|
| HCheckInstanceType(HValue* value, Check check)
|
| : HUnaryOperation(value), check_(check) {
|
| set_representation(Representation::Tagged());
|
| @@ -2025,7 +2020,7 @@
|
| SetFlag(kUseGVN);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -2071,7 +2066,7 @@
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps)
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -2102,7 +2097,7 @@
|
| SetFlag(kUseGVN);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
| virtual HType CalculateInferredType();
|
| @@ -2151,7 +2146,7 @@
|
| }
|
|
|
| virtual Range* InferRange();
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return representation();
|
| }
|
| virtual HType CalculateInferredType();
|
| @@ -2243,7 +2238,7 @@
|
| SetFlag(kIsArguments);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -2259,7 +2254,20 @@
|
|
|
| bool InOldSpace() const { return !HEAP->InNewSpace(*handle_); }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + bool ImmortalImmovable() const {
|
| + Heap* heap = HEAP;
|
| + if (*handle_ == heap->undefined_value()) return true;
|
| + if (*handle_ == heap->null_value()) return true;
|
| + if (*handle_ == heap->true_value()) return true;
|
| + if (*handle_ == heap->false_value()) return true;
|
| + if (*handle_ == heap->the_hole_value()) return true;
|
| + if (*handle_ == heap->minus_zero_value()) return true;
|
| + if (*handle_ == heap->nan_value()) return true;
|
| + if (*handle_ == heap->empty_string()) return true;
|
| + return false;
|
| + }
|
| +
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -2367,7 +2375,7 @@
|
| SetAllSideEffects();
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| // The length is untagged, all other inputs are tagged.
|
| return (index == 2)
|
| ? Representation::Integer32()
|
| @@ -2394,7 +2402,7 @@
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements)
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -2410,7 +2418,7 @@
|
| SetFlag(kUseGVN);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -2433,7 +2441,7 @@
|
|
|
| virtual void PrintDataTo(StringStream* stream);
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| // The arguments elements is considered tagged.
|
| return index == 0
|
| ? Representation::Tagged()
|
| @@ -2459,7 +2467,7 @@
|
| SetFlag(kUseGVN);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Integer32();
|
| }
|
|
|
| @@ -2484,7 +2492,7 @@
|
| SetAllSideEffects();
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return index == 0
|
| ? Representation::Tagged()
|
| : representation();
|
| @@ -2522,7 +2530,7 @@
|
| }
|
|
|
| virtual HType CalculateInferredType();
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return index == 0
|
| ? Representation::Tagged()
|
| : representation();
|
| @@ -2549,7 +2557,7 @@
|
| SetAllSideEffects();
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -2587,7 +2595,7 @@
|
| return input_representation_;
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return input_representation_;
|
| }
|
| virtual void PrintDataTo(StringStream* stream);
|
| @@ -2610,7 +2618,9 @@
|
| HValue* left() { return OperandAt(0); }
|
| HValue* right() { return OperandAt(1); }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual void PrintDataTo(StringStream* stream);
|
| +
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -2629,7 +2639,7 @@
|
| HValue* left() { return value(); }
|
| int right() const { return right_; }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Integer32();
|
| }
|
|
|
| @@ -2641,21 +2651,25 @@
|
| };
|
|
|
|
|
| -class HIsNullAndBranch: public HUnaryControlInstruction {
|
| +class HIsNilAndBranch: public HUnaryControlInstruction {
|
| public:
|
| - HIsNullAndBranch(HValue* value, bool is_strict)
|
| - : HUnaryControlInstruction(value, NULL, NULL), is_strict_(is_strict) { }
|
| + HIsNilAndBranch(HValue* value, EqualityKind kind, NilValue nil)
|
| + : HUnaryControlInstruction(value, NULL, NULL), kind_(kind), nil_(nil) { }
|
|
|
| - bool is_strict() const { return is_strict_; }
|
| + EqualityKind kind() const { return kind_; }
|
| + NilValue nil() const { return nil_; }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual void PrintDataTo(StringStream* stream);
|
| +
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| - DECLARE_CONCRETE_INSTRUCTION(IsNullAndBranch)
|
| + DECLARE_CONCRETE_INSTRUCTION(IsNilAndBranch)
|
|
|
| private:
|
| - bool is_strict_;
|
| + EqualityKind kind_;
|
| + NilValue nil_;
|
| };
|
|
|
|
|
| @@ -2664,7 +2678,7 @@
|
| explicit HIsObjectAndBranch(HValue* value)
|
| : HUnaryControlInstruction(value, NULL, NULL) { }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -2679,7 +2693,7 @@
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch)
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -2693,7 +2707,7 @@
|
| explicit HIsUndetectableAndBranch(HValue* value)
|
| : HUnaryControlInstruction(value, NULL, NULL) { }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -2703,7 +2717,7 @@
|
|
|
| class HIsConstructCallAndBranch: public HTemplateControlInstruction<2, 0> {
|
| public:
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -2725,7 +2739,7 @@
|
|
|
| virtual void PrintDataTo(StringStream* stream);
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -2742,7 +2756,7 @@
|
| explicit HHasCachedArrayIndexAndBranch(HValue* value)
|
| : HUnaryControlInstruction(value, NULL, NULL) { }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -2757,7 +2771,7 @@
|
| SetFlag(kUseGVN);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -2776,7 +2790,7 @@
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch)
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -2800,7 +2814,7 @@
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch)
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -2817,7 +2831,7 @@
|
| SetAllSideEffects();
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -2845,7 +2859,7 @@
|
| HValue* left() { return OperandAt(1); }
|
| Handle<JSFunction> function() { return function_; }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -2870,7 +2884,7 @@
|
| HValue* left() { return OperandAt(0); }
|
| HValue* right() { return OperandAt(1); }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return index == 0
|
| ? Representation::Double()
|
| : Representation::None();
|
| @@ -3099,7 +3113,7 @@
|
|
|
| int ast_id() const { return ast_id_; }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -3120,7 +3134,7 @@
|
|
|
| virtual void PrintDataTo(StringStream* stream);
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -3152,7 +3166,7 @@
|
|
|
| virtual void PrintDataTo(StringStream* stream);
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -3168,7 +3182,7 @@
|
| public:
|
| HUnknownOSRValue() { set_representation(Representation::Tagged()); }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -3178,15 +3192,15 @@
|
|
|
| class HLoadGlobalCell: public HTemplateInstruction<0> {
|
| public:
|
| - HLoadGlobalCell(Handle<JSGlobalPropertyCell> cell, bool check_hole_value)
|
| - : cell_(cell), check_hole_value_(check_hole_value) {
|
| + HLoadGlobalCell(Handle<JSGlobalPropertyCell> cell, PropertyDetails details)
|
| + : cell_(cell), details_(details) {
|
| set_representation(Representation::Tagged());
|
| SetFlag(kUseGVN);
|
| SetFlag(kDependsOnGlobalVars);
|
| }
|
|
|
| Handle<JSGlobalPropertyCell> cell() const { return cell_; }
|
| - bool check_hole_value() const { return check_hole_value_; }
|
| + bool RequiresHoleCheck();
|
|
|
| virtual void PrintDataTo(StringStream* stream);
|
|
|
| @@ -3195,7 +3209,7 @@
|
| return reinterpret_cast<intptr_t>(*cell_);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::None();
|
| }
|
|
|
| @@ -3209,7 +3223,7 @@
|
|
|
| private:
|
| Handle<JSGlobalPropertyCell> cell_;
|
| - bool check_hole_value_;
|
| + PropertyDetails details_;
|
| };
|
|
|
|
|
| @@ -3234,7 +3248,7 @@
|
|
|
| virtual void PrintDataTo(StringStream* stream);
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -3250,17 +3264,19 @@
|
| public:
|
| HStoreGlobalCell(HValue* value,
|
| Handle<JSGlobalPropertyCell> cell,
|
| - bool check_hole_value)
|
| + PropertyDetails details)
|
| : HUnaryOperation(value),
|
| cell_(cell),
|
| - check_hole_value_(check_hole_value) {
|
| + details_(details) {
|
| SetFlag(kChangesGlobalVars);
|
| }
|
|
|
| Handle<JSGlobalPropertyCell> cell() const { return cell_; }
|
| - bool check_hole_value() const { return check_hole_value_; }
|
| + bool RequiresHoleCheck() {
|
| + return !details_.IsDontDelete() || details_.IsReadOnly();
|
| + }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
| virtual void PrintDataTo(StringStream* stream);
|
| @@ -3269,7 +3285,7 @@
|
|
|
| private:
|
| Handle<JSGlobalPropertyCell> cell_;
|
| - bool check_hole_value_;
|
| + PropertyDetails details_;
|
| };
|
|
|
|
|
| @@ -3297,7 +3313,7 @@
|
|
|
| virtual void PrintDataTo(StringStream* stream);
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -3320,7 +3336,7 @@
|
|
|
| int slot_index() const { return slot_index_; }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -3342,7 +3358,7 @@
|
| static inline bool StoringValueNeedsWriteBarrier(HValue* value) {
|
| return !value->type().IsBoolean()
|
| && !value->type().IsSmi()
|
| - && !(value->IsConstant() && HConstant::cast(value)->InOldSpace());
|
| + && !(value->IsConstant() && HConstant::cast(value)->ImmortalImmovable());
|
| }
|
|
|
|
|
| @@ -3363,7 +3379,7 @@
|
| return StoringValueNeedsWriteBarrier(value());
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -3396,7 +3412,7 @@
|
| bool is_in_object() const { return is_in_object_; }
|
| int offset() const { return offset_; }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
| virtual void PrintDataTo(StringStream* stream);
|
| @@ -3428,7 +3444,7 @@
|
| Handle<String> name() { return name_; }
|
| bool need_generic() { return need_generic_; }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -3463,7 +3479,7 @@
|
| HValue* object() { return OperandAt(1); }
|
| Handle<Object> name() const { return name_; }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -3487,7 +3503,7 @@
|
|
|
| HValue* function() { return OperandAt(0); }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -3511,7 +3527,7 @@
|
| HValue* object() { return OperandAt(0); }
|
| HValue* key() { return OperandAt(1); }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| // The key is supposed to be Integer32.
|
| return index == 0
|
| ? Representation::Tagged()
|
| @@ -3520,7 +3536,7 @@
|
|
|
| virtual void PrintDataTo(StringStream* stream);
|
|
|
| - bool RequiresHoleCheck() const;
|
| + bool RequiresHoleCheck();
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement)
|
|
|
| @@ -3542,7 +3558,7 @@
|
| HValue* elements() { return OperandAt(0); }
|
| HValue* key() { return OperandAt(1); }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| // The key is supposed to be Integer32.
|
| return index == 0
|
| ? Representation::Tagged()
|
| @@ -3551,8 +3567,6 @@
|
|
|
| virtual void PrintDataTo(StringStream* stream);
|
|
|
| - bool RequiresHoleCheck() const;
|
| -
|
| DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastDoubleElement)
|
|
|
| protected:
|
| @@ -3582,7 +3596,7 @@
|
|
|
| virtual void PrintDataTo(StringStream* stream);
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| // The key is supposed to be Integer32, but the base pointer
|
| // for the element load is a naked pointer.
|
| return index == 0
|
| @@ -3625,7 +3639,7 @@
|
|
|
| virtual void PrintDataTo(StringStream* stream);
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -3654,7 +3668,7 @@
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(StoreNamedField)
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
| virtual void PrintDataTo(StringStream* stream);
|
| @@ -3703,7 +3717,7 @@
|
|
|
| virtual void PrintDataTo(StringStream* stream);
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -3717,14 +3731,16 @@
|
|
|
| class HStoreKeyedFastElement: public HTemplateInstruction<3> {
|
| public:
|
| - HStoreKeyedFastElement(HValue* obj, HValue* key, HValue* val) {
|
| + HStoreKeyedFastElement(HValue* obj, HValue* key, HValue* val,
|
| + ElementsKind elements_kind = FAST_ELEMENTS)
|
| + : elements_kind_(elements_kind) {
|
| SetOperandAt(0, obj);
|
| SetOperandAt(1, key);
|
| SetOperandAt(2, val);
|
| SetFlag(kChangesArrayElements);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| // The key is supposed to be Integer32.
|
| return index == 1
|
| ? Representation::Integer32()
|
| @@ -3734,14 +3750,28 @@
|
| HValue* object() { return OperandAt(0); }
|
| HValue* key() { return OperandAt(1); }
|
| HValue* value() { return OperandAt(2); }
|
| + bool value_is_smi() {
|
| + return elements_kind_ == FAST_SMI_ONLY_ELEMENTS;
|
| + }
|
|
|
| bool NeedsWriteBarrier() {
|
| - return StoringValueNeedsWriteBarrier(value());
|
| + if (value_is_smi()) {
|
| + return false;
|
| + } else {
|
| + return StoringValueNeedsWriteBarrier(value());
|
| + }
|
| }
|
|
|
| + bool ValueNeedsSmiCheck() {
|
| + return value_is_smi();
|
| + }
|
| +
|
| virtual void PrintDataTo(StringStream* stream);
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement)
|
| +
|
| + private:
|
| + ElementsKind elements_kind_;
|
| };
|
|
|
|
|
| @@ -3756,7 +3786,7 @@
|
| SetFlag(kChangesDoubleArrayElements);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| if (index == 1) {
|
| return Representation::Integer32();
|
| } else if (index == 2) {
|
| @@ -3795,7 +3825,7 @@
|
|
|
| virtual void PrintDataTo(StringStream* stream);
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| if (index == 0) {
|
| return Representation::External();
|
| } else {
|
| @@ -3843,7 +3873,7 @@
|
| HValue* context() { return OperandAt(3); }
|
| bool strict_mode() { return strict_mode_; }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -3865,7 +3895,7 @@
|
| SetFlag(kDependsOnMaps);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -3891,7 +3921,7 @@
|
| SetFlag(kDependsOnMaps);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| // The index is supposed to be Integer32.
|
| return index == 2
|
| ? Representation::Integer32()
|
| @@ -3922,7 +3952,7 @@
|
| SetFlag(kUseGVN);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return index == 0
|
| ? Representation::Tagged()
|
| : Representation::Integer32();
|
| @@ -3945,7 +3975,7 @@
|
| SetFlag(kDependsOnMaps);
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -4001,7 +4031,7 @@
|
|
|
| bool IsCopyOnWrite() const;
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -4035,7 +4065,7 @@
|
| bool fast_elements() const { return fast_elements_; }
|
| bool has_function() const { return has_function_; }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -4064,7 +4094,7 @@
|
| Handle<String> pattern() { return pattern_; }
|
| Handle<String> flags() { return flags_; }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -4088,7 +4118,7 @@
|
|
|
| HValue* context() { return OperandAt(0); }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -4114,7 +4144,9 @@
|
| HValue* context() { return OperandAt(0); }
|
| HValue* value() { return OperandAt(1); }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual void PrintDataTo(StringStream* stream);
|
| +
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -4132,7 +4164,7 @@
|
| set_representation(Representation::Tagged());
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -4146,7 +4178,7 @@
|
| set_representation(Representation::Tagged());
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -4162,7 +4194,7 @@
|
| SetAllSideEffects();
|
| }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
| @@ -4189,7 +4221,7 @@
|
| HValue* key() { return OperandAt(1); }
|
| HValue* object() { return OperandAt(2); }
|
|
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| + virtual Representation RequiredInputRepresentation(int index) {
|
| return Representation::Tagged();
|
| }
|
|
|
|
|