Chromium Code Reviews| Index: src/hydrogen-instructions.h |
| diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
| index 08667c994197356d3080e5c99fd9ec7b83853be8..0bec1534e3d32bd0bb3e2081d57696682fcba974 100644 |
| --- a/src/hydrogen-instructions.h |
| +++ b/src/hydrogen-instructions.h |
| @@ -87,6 +87,7 @@ class LChunkBuilder; |
| V(CallNewArray) \ |
| V(CallRuntime) \ |
| V(CallStub) \ |
| + V(CapturedObject) \ |
| V(Change) \ |
| V(CheckFunction) \ |
| V(CheckHeapObject) \ |
| @@ -3429,20 +3430,10 @@ class HInductionVariableAnnotation : public HUnaryOperation { |
| }; |
| -class HArgumentsObject: public HTemplateInstruction<0> { |
| +// Common base class for HArgumentsObject and HCapturedObject. |
| +class HDematerializedObject: public HTemplateInstruction<0> { |
| public: |
| - HArgumentsObject(int count, Zone* zone) : values_(count, zone) { |
| - set_representation(Representation::Tagged()); |
| - SetFlag(kIsArguments); |
| - } |
| - |
| - const ZoneList<HValue*>* arguments_values() const { return &values_; } |
| - int arguments_count() const { return values_.length(); } |
| - |
| - void AddArgument(HValue* argument, Zone* zone) { |
| - values_.Add(NULL, zone); // Resize list. |
| - SetOperandAt(values_.length() - 1, argument); |
| - } |
| + HDematerializedObject(int count, Zone* zone) : values_(count, zone) {} |
| virtual int OperandCount() { return values_.length(); } |
| virtual HValue* OperandAt(int index) const { return values_[index]; } |
| @@ -3452,17 +3443,50 @@ class HArgumentsObject: public HTemplateInstruction<0> { |
| return Representation::None(); |
| } |
| - DECLARE_CONCRETE_INSTRUCTION(ArgumentsObject) |
| - |
| protected: |
| virtual void InternalSetOperandAt(int index, HValue* value) { |
| values_[index] = value; |
| } |
| + ZoneList<HValue*> values_; |
|
titzer
2013/08/01 17:11:50
How is this values_ array indexed? Does it store o
Michael Starzinger
2013/08/05 15:13:00
Correct. I added a comment to both HArgumentsObjec
|
| + |
| private: |
| virtual bool IsDeletable() const { return true; } |
| +}; |
| - ZoneList<HValue*> values_; |
| + |
| +class HArgumentsObject: public HDematerializedObject { |
| + public: |
| + HArgumentsObject(int count, Zone* zone) |
| + : HDematerializedObject(count, zone) { |
| + set_representation(Representation::Tagged()); |
| + SetFlag(kIsArguments); |
| + } |
| + |
| + const ZoneList<HValue*>* arguments_values() const { return &values_; } |
| + int arguments_count() const { return values_.length(); } |
| + |
| + void AddArgument(HValue* argument, Zone* zone) { |
| + values_.Add(NULL, zone); // Resize list. |
| + SetOperandAt(values_.length() - 1, argument); |
| + } |
| + |
| + DECLARE_CONCRETE_INSTRUCTION(ArgumentsObject) |
| +}; |
| + |
| + |
| +class HCapturedObject: public HDematerializedObject { |
| + public: |
| + HCapturedObject(int length, Zone* zone) |
| + : HDematerializedObject(length, zone) { |
| + set_representation(Representation::Tagged()); |
| + values_.AddBlock(NULL, length, zone); // Resize list. |
| + } |
| + |
| + const ZoneList<HValue*>* values() const { return &values_; } |
| + int length() const { return values_.length(); } |
| + |
| + DECLARE_CONCRETE_INSTRUCTION(CapturedObject) |
| }; |
| @@ -6286,7 +6310,6 @@ class HStoreKeyed |
| } |
| } |
| - virtual bool HasEscapingOperandAt(int index) { return index != 0; } |
| virtual Representation RequiredInputRepresentation(int index) { |
| // kind_fast: tagged[int32] = tagged |
| // kind_double: tagged[int32] = double |