Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index 82ed261eb90dc728bde72fc04f2f3d8946309ba0..eff2ce40b6fd9c86d59020531d8362812bb1ff1a 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -2016,6 +2016,9 @@ enum InliningKind { |
}; |
+class HArgumentsObject; |
+ |
+ |
class HEnterInlined: public HTemplateInstruction<0> { |
public: |
HEnterInlined(Handle<JSFunction> closure, |
@@ -2023,7 +2026,7 @@ class HEnterInlined: public HTemplateInstruction<0> { |
FunctionLiteral* function, |
InliningKind inlining_kind, |
Variable* arguments_var, |
- ZoneList<HValue*>* arguments_values, |
+ HArgumentsObject* arguments_object, |
bool undefined_receiver, |
Zone* zone) |
: closure_(closure), |
@@ -2032,7 +2035,7 @@ class HEnterInlined: public HTemplateInstruction<0> { |
function_(function), |
inlining_kind_(inlining_kind), |
arguments_var_(arguments_var), |
- arguments_values_(arguments_values), |
+ arguments_object_(arguments_object), |
undefined_receiver_(undefined_receiver), |
return_targets_(2, zone) { |
} |
@@ -2055,7 +2058,7 @@ class HEnterInlined: public HTemplateInstruction<0> { |
} |
Variable* arguments_var() { return arguments_var_; } |
- ZoneList<HValue*>* arguments_values() { return arguments_values_; } |
+ HArgumentsObject* arguments_object() { return arguments_object_; } |
DECLARE_CONCRETE_INSTRUCTION(EnterInlined) |
@@ -2066,7 +2069,7 @@ class HEnterInlined: public HTemplateInstruction<0> { |
FunctionLiteral* function_; |
InliningKind inlining_kind_; |
Variable* arguments_var_; |
- ZoneList<HValue*>* arguments_values_; |
+ HArgumentsObject* arguments_object_; |
bool undefined_receiver_; |
ZoneList<HBasicBlock*> return_targets_; |
}; |
@@ -3194,19 +3197,37 @@ class HInductionVariableAnnotation : public HUnaryOperation { |
class HArgumentsObject: public HTemplateInstruction<0> { |
public: |
- HArgumentsObject() { |
+ 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); |
+ } |
+ |
+ virtual int OperandCount() { return values_.length(); } |
+ virtual HValue* OperandAt(int index) const { return values_[index]; } |
+ |
virtual Representation RequiredInputRepresentation(int index) { |
return Representation::None(); |
} |
DECLARE_CONCRETE_INSTRUCTION(ArgumentsObject) |
+ protected: |
+ virtual void InternalSetOperandAt(int index, HValue* value) { |
+ values_[index] = value; |
+ } |
+ |
private: |
virtual bool IsDeletable() const { return true; } |
+ |
+ ZoneList<HValue*> values_; |
}; |