| Index: src/hydrogen-instructions.h
|
| ===================================================================
|
| --- src/hydrogen-instructions.h (revision 6170)
|
| +++ src/hydrogen-instructions.h (working copy)
|
| @@ -76,7 +76,6 @@
|
| // HLoadKeyed
|
| // HLoadKeyedFastElement
|
| // HLoadKeyedGeneric
|
| -// HLoadNamedGeneric
|
| // HPower
|
| // HStoreNamed
|
| // HStoreNamedField
|
| @@ -119,7 +118,6 @@
|
| // HStoreKeyedFastElement
|
| // HStoreKeyedGeneric
|
| // HUnaryOperation
|
| -// HArrayLength
|
| // HBitNot
|
| // HChange
|
| // HCheckFunction
|
| @@ -129,9 +127,13 @@
|
| // HCheckPrototypeMaps
|
| // HCheckSmi
|
| // HDeleteProperty
|
| +// HFixedArrayLength
|
| +// HJSArrayLength
|
| // HLoadElements
|
| // HTypeofIs
|
| // HLoadNamedField
|
| +// HLoadNamedGeneric
|
| +// HLoadFunctionPrototype
|
| // HPushArgument
|
| // HTypeof
|
| // HUnaryMathOperation
|
| @@ -170,7 +172,6 @@
|
| V(ArgumentsElements) \
|
| V(ArgumentsLength) \
|
| V(ArgumentsObject) \
|
| - V(ArrayLength) \
|
| V(ArrayLiteral) \
|
| V(BitAnd) \
|
| V(BitNot) \
|
| @@ -203,6 +204,7 @@
|
| V(Deoptimize) \
|
| V(Div) \
|
| V(EnterInlined) \
|
| + V(FixedArrayLength) \
|
| V(FunctionLiteral) \
|
| V(GlobalObject) \
|
| V(GlobalReceiver) \
|
| @@ -213,6 +215,7 @@
|
| V(IsSmi) \
|
| V(HasInstanceType) \
|
| V(HasCachedArrayIndex) \
|
| + V(JSArrayLength) \
|
| V(ClassOfTest) \
|
| V(LeaveInlined) \
|
| V(LoadElements) \
|
| @@ -221,6 +224,7 @@
|
| V(LoadKeyedGeneric) \
|
| V(LoadNamedField) \
|
| V(LoadNamedGeneric) \
|
| + V(LoadFunctionPrototype) \
|
| V(Mod) \
|
| V(Mul) \
|
| V(ObjectLiteral) \
|
| @@ -256,6 +260,7 @@
|
| V(GlobalVars) \
|
| V(Maps) \
|
| V(ArrayLengths) \
|
| + V(FunctionPrototypes) \
|
| V(OsrEntries)
|
|
|
| #define DECLARE_INSTRUCTION(type) \
|
| @@ -905,6 +910,9 @@
|
| virtual HBasicBlock* FirstSuccessor() const { return true_destination_; }
|
| virtual HBasicBlock* SecondSuccessor() const { return false_destination_; }
|
|
|
| + HBasicBlock* true_destination() const { return true_destination_; }
|
| + HBasicBlock* false_destination() const { return false_destination_; }
|
| +
|
| virtual void PrintDataTo(StringStream* stream) const;
|
|
|
| Handle<Map> map() const { return map_; }
|
| @@ -1015,10 +1023,10 @@
|
|
|
| class HSimulate: public HInstruction {
|
| public:
|
| - HSimulate(int ast_id, int pop_count, int environment_height)
|
| + HSimulate(int ast_id, int pop_count, int environment_length)
|
| : ast_id_(ast_id),
|
| pop_count_(pop_count),
|
| - environment_height_(environment_height),
|
| + environment_length_(environment_length),
|
| values_(2),
|
| assigned_indexes_(2) {}
|
| virtual ~HSimulate() {}
|
| @@ -1032,7 +1040,7 @@
|
| ast_id_ = id;
|
| }
|
|
|
| - int environment_height() const { return environment_height_; }
|
| + int environment_length() const { return environment_length_; }
|
| int pop_count() const { return pop_count_; }
|
| const ZoneList<HValue*>* values() const { return &values_; }
|
| int GetAssignedIndexAt(int index) const {
|
| @@ -1074,7 +1082,7 @@
|
| }
|
| int ast_id_;
|
| int pop_count_;
|
| - int environment_height_;
|
| + int environment_length_;
|
| ZoneList<HValue*> values_;
|
| ZoneList<int> assigned_indexes_;
|
| };
|
| @@ -1336,9 +1344,9 @@
|
| };
|
|
|
|
|
| -class HArrayLength: public HUnaryOperation {
|
| +class HJSArrayLength: public HUnaryOperation {
|
| public:
|
| - explicit HArrayLength(HValue* value) : HUnaryOperation(value) {
|
| + explicit HJSArrayLength(HValue* value) : HUnaryOperation(value) {
|
| // The length of an array is stored as a tagged value in the array
|
| // object. It is guaranteed to be 32 bit integer, but it can be
|
| // represented as either a smi or heap number.
|
| @@ -1351,10 +1359,26 @@
|
| return Representation::Tagged();
|
| }
|
|
|
| - DECLARE_CONCRETE_INSTRUCTION(ArrayLength, "array_length")
|
| + DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js_array_length")
|
| };
|
|
|
|
|
| +class HFixedArrayLength: public HUnaryOperation {
|
| + public:
|
| + explicit HFixedArrayLength(HValue* value) : HUnaryOperation(value) {
|
| + set_representation(Representation::Tagged());
|
| + SetFlag(kDependsOnArrayLengths);
|
| + SetFlag(kUseGVN);
|
| + }
|
| +
|
| + virtual Representation RequiredInputRepresentation(int index) const {
|
| + return Representation::Tagged();
|
| + }
|
| +
|
| + DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed_array_length")
|
| +};
|
| +
|
| +
|
| class HBitNot: public HUnaryOperation {
|
| public:
|
| explicit HBitNot(HValue* value) : HUnaryOperation(value) {
|
| @@ -1766,6 +1790,8 @@
|
|
|
| Handle<Object> handle() const { return handle_; }
|
|
|
| + bool InOldSpace() const { return !Heap::InNewSpace(*handle_); }
|
| +
|
| virtual bool EmitAtUses() const { return !representation().IsDouble(); }
|
| virtual void PrintDataTo(StringStream* stream) const;
|
| virtual HType CalculateInferredType() const;
|
| @@ -2617,6 +2643,27 @@
|
| };
|
|
|
|
|
| +class HLoadFunctionPrototype: public HUnaryOperation {
|
| + public:
|
| + explicit HLoadFunctionPrototype(HValue* function)
|
| + : HUnaryOperation(function) {
|
| + set_representation(Representation::Tagged());
|
| + SetFlagMask(kDependsOnFunctionPrototypes);
|
| + }
|
| +
|
| + HValue* function() const { return OperandAt(0); }
|
| +
|
| + virtual Representation RequiredInputRepresentation(int index) const {
|
| + return Representation::Tagged();
|
| + }
|
| +
|
| + DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load_function_prototype")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| +};
|
| +
|
| +
|
| class HLoadKeyed: public HBinaryOperation {
|
| public:
|
| HLoadKeyed(HValue* obj, HValue* key) : HBinaryOperation(obj, key) {
|
| @@ -2663,6 +2710,12 @@
|
| };
|
|
|
|
|
| +static inline bool StoringValueNeedsWriteBarrier(HValue* value) {
|
| + return !value->type().IsSmi() &&
|
| + !(value->IsConstant() && HConstant::cast(value)->InOldSpace());
|
| +}
|
| +
|
| +
|
| class HStoreNamed: public HBinaryOperation {
|
| public:
|
| HStoreNamed(HValue* obj, Handle<Object> name, HValue* val)
|
| @@ -2680,6 +2733,10 @@
|
| HValue* value() const { return OperandAt(1); }
|
| void set_value(HValue* value) { SetOperandAt(1, value); }
|
|
|
| + bool NeedsWriteBarrier() const {
|
| + return StoringValueNeedsWriteBarrier(value());
|
| + }
|
| +
|
| DECLARE_INSTRUCTION(StoreNamed)
|
|
|
| protected:
|
| @@ -2760,6 +2817,10 @@
|
| HValue* key() const { return OperandAt(1); }
|
| HValue* value() const { return OperandAt(2); }
|
|
|
| + bool NeedsWriteBarrier() const {
|
| + return StoringValueNeedsWriteBarrier(value());
|
| + }
|
| +
|
| DECLARE_INSTRUCTION(StoreKeyed)
|
|
|
| protected:
|
| @@ -2779,10 +2840,6 @@
|
| SetFlag(kChangesArrayElements);
|
| }
|
|
|
| - bool NeedsWriteBarrier() const {
|
| - return !value()->type().IsSmi();
|
| - }
|
| -
|
| virtual Representation RequiredInputRepresentation(int index) const {
|
| // The key is supposed to be Integer32.
|
| return (index == 1) ? Representation::Integer32()
|
|
|