Chromium Code Reviews| Index: src/hydrogen-instructions.h |
| diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
| index fc396a718fb2c47324ecf6a2630fd7d572900486..5e8e17ebc2fc564f24e09c39d0095e8e3aa47dab 100644 |
| --- a/src/hydrogen-instructions.h |
| +++ b/src/hydrogen-instructions.h |
| @@ -1478,11 +1478,21 @@ class HCompareMap: public HUnaryControlInstruction { |
| }; |
| -class HReturn: public HTemplateControlInstruction<0, 2> { |
| +class HReturn: public HTemplateControlInstruction<0, 3> { |
| public: |
| - HReturn(HValue* value, HValue* context) { |
| + HReturn(HValue* value, HValue* context, int parameter_count) { |
|
danno
2013/03/07 15:11:14
Do you really need this version? You can check in
mvstanton
2013/03/07 16:48:49
Done.
|
| SetOperandAt(0, value); |
| SetOperandAt(1, context); |
| + SetOperandAt(2, context); // (unused) |
| + ASSERT(parameter_count >= 0); |
| + constant_parameter_count_ = parameter_count; |
| + } |
| + |
| + HReturn(HValue* value, HValue* context, HValue* parameter_count) { |
| + SetOperandAt(0, value); |
| + SetOperandAt(1, context); |
| + SetOperandAt(2, parameter_count); |
| + constant_parameter_count_ = -1; |
| } |
| virtual Representation RequiredInputRepresentation(int index) { |
| @@ -1494,7 +1504,22 @@ class HReturn: public HTemplateControlInstruction<0, 2> { |
| HValue* value() { return OperandAt(0); } |
| HValue* context() { return OperandAt(1); } |
| + bool has_constant_parameter_count() const { |
|
danno
2013/03/07 15:11:14
As noted above, you can determine this all in lith
mvstanton
2013/03/07 16:48:49
Done.
|
| + return constant_parameter_count_ >= 0; |
| + } |
| + int constant_parameter_count() const { |
| + ASSERT(has_constant_parameter_count()); |
| + return constant_parameter_count_; |
| + } |
| + HValue* parameter_count() { |
| + ASSERT(!has_constant_parameter_count()); |
| + return OperandAt(2); |
| + } |
| + |
| DECLARE_CONCRETE_INSTRUCTION(Return) |
| + |
| + private: |
| + int constant_parameter_count_; |
| }; |