OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1471 return Representation::Tagged(); | 1471 return Representation::Tagged(); |
1472 } | 1472 } |
1473 | 1473 |
1474 DECLARE_CONCRETE_INSTRUCTION(CompareMap) | 1474 DECLARE_CONCRETE_INSTRUCTION(CompareMap) |
1475 | 1475 |
1476 private: | 1476 private: |
1477 Handle<Map> map_; | 1477 Handle<Map> map_; |
1478 }; | 1478 }; |
1479 | 1479 |
1480 | 1480 |
1481 class HReturn: public HTemplateControlInstruction<0, 2> { | 1481 class HReturn: public HTemplateControlInstruction<0, 3> { |
1482 public: | 1482 public: |
1483 HReturn(HValue* value, HValue* context) { | 1483 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.
| |
1484 SetOperandAt(0, value); | 1484 SetOperandAt(0, value); |
1485 SetOperandAt(1, context); | 1485 SetOperandAt(1, context); |
1486 SetOperandAt(2, context); // (unused) | |
1487 ASSERT(parameter_count >= 0); | |
1488 constant_parameter_count_ = parameter_count; | |
1489 } | |
1490 | |
1491 HReturn(HValue* value, HValue* context, HValue* parameter_count) { | |
1492 SetOperandAt(0, value); | |
1493 SetOperandAt(1, context); | |
1494 SetOperandAt(2, parameter_count); | |
1495 constant_parameter_count_ = -1; | |
1486 } | 1496 } |
1487 | 1497 |
1488 virtual Representation RequiredInputRepresentation(int index) { | 1498 virtual Representation RequiredInputRepresentation(int index) { |
1489 return Representation::Tagged(); | 1499 return Representation::Tagged(); |
1490 } | 1500 } |
1491 | 1501 |
1492 virtual void PrintDataTo(StringStream* stream); | 1502 virtual void PrintDataTo(StringStream* stream); |
1493 | 1503 |
1494 HValue* value() { return OperandAt(0); } | 1504 HValue* value() { return OperandAt(0); } |
1495 HValue* context() { return OperandAt(1); } | 1505 HValue* context() { return OperandAt(1); } |
1496 | 1506 |
1507 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.
| |
1508 return constant_parameter_count_ >= 0; | |
1509 } | |
1510 int constant_parameter_count() const { | |
1511 ASSERT(has_constant_parameter_count()); | |
1512 return constant_parameter_count_; | |
1513 } | |
1514 HValue* parameter_count() { | |
1515 ASSERT(!has_constant_parameter_count()); | |
1516 return OperandAt(2); | |
1517 } | |
1518 | |
1497 DECLARE_CONCRETE_INSTRUCTION(Return) | 1519 DECLARE_CONCRETE_INSTRUCTION(Return) |
1520 | |
1521 private: | |
1522 int constant_parameter_count_; | |
1498 }; | 1523 }; |
1499 | 1524 |
1500 | 1525 |
1501 class HAbnormalExit: public HTemplateControlInstruction<0, 0> { | 1526 class HAbnormalExit: public HTemplateControlInstruction<0, 0> { |
1502 public: | 1527 public: |
1503 virtual Representation RequiredInputRepresentation(int index) { | 1528 virtual Representation RequiredInputRepresentation(int index) { |
1504 return Representation::None(); | 1529 return Representation::None(); |
1505 } | 1530 } |
1506 | 1531 |
1507 DECLARE_CONCRETE_INSTRUCTION(AbnormalExit) | 1532 DECLARE_CONCRETE_INSTRUCTION(AbnormalExit) |
(...skipping 4657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6165 virtual bool IsDeletable() const { return true; } | 6190 virtual bool IsDeletable() const { return true; } |
6166 }; | 6191 }; |
6167 | 6192 |
6168 | 6193 |
6169 #undef DECLARE_INSTRUCTION | 6194 #undef DECLARE_INSTRUCTION |
6170 #undef DECLARE_CONCRETE_INSTRUCTION | 6195 #undef DECLARE_CONCRETE_INSTRUCTION |
6171 | 6196 |
6172 } } // namespace v8::internal | 6197 } } // namespace v8::internal |
6173 | 6198 |
6174 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6199 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |