OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 void Initialize(Expression* each, Expression* enumerable, Statement* body) { | 568 void Initialize(Expression* each, Expression* enumerable, Statement* body) { |
569 IterationStatement::Initialize(body); | 569 IterationStatement::Initialize(body); |
570 each_ = each; | 570 each_ = each; |
571 enumerable_ = enumerable; | 571 enumerable_ = enumerable; |
572 } | 572 } |
573 | 573 |
574 Expression* each() const { return each_; } | 574 Expression* each() const { return each_; } |
575 Expression* enumerable() const { return enumerable_; } | 575 Expression* enumerable() const { return enumerable_; } |
576 | 576 |
577 // Bailout support. | 577 // Bailout support. |
| 578 int AssignmentId() const { return assignment_id_; } |
578 virtual int ContinueId() const { return EntryId(); } | 579 virtual int ContinueId() const { return EntryId(); } |
579 | 580 |
580 private: | 581 private: |
581 Expression* each_; | 582 Expression* each_; |
582 Expression* enumerable_; | 583 Expression* enumerable_; |
| 584 int assignment_id_; |
583 }; | 585 }; |
584 | 586 |
585 | 587 |
586 class ExpressionStatement: public Statement { | 588 class ExpressionStatement: public Statement { |
587 public: | 589 public: |
588 explicit ExpressionStatement(Expression* expression) | 590 explicit ExpressionStatement(Expression* expression) |
589 : expression_(expression) { } | 591 : expression_(expression) { } |
590 | 592 |
591 DECLARE_NODE_TYPE(ExpressionStatement) | 593 DECLARE_NODE_TYPE(ExpressionStatement) |
592 | 594 |
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1419 private: | 1421 private: |
1420 Token::Value op_; | 1422 Token::Value op_; |
1421 Expression* expression_; | 1423 Expression* expression_; |
1422 int pos_; | 1424 int pos_; |
1423 }; | 1425 }; |
1424 | 1426 |
1425 | 1427 |
1426 class CountOperation: public Expression { | 1428 class CountOperation: public Expression { |
1427 public: | 1429 public: |
1428 CountOperation(bool is_prefix, IncrementOperation* increment, int pos) | 1430 CountOperation(bool is_prefix, IncrementOperation* increment, int pos) |
1429 : is_prefix_(is_prefix), increment_(increment), pos_(pos) { } | 1431 : is_prefix_(is_prefix), increment_(increment), pos_(pos), |
| 1432 assignment_id_(GetNextId()) { |
| 1433 } |
1430 | 1434 |
1431 DECLARE_NODE_TYPE(CountOperation) | 1435 DECLARE_NODE_TYPE(CountOperation) |
1432 | 1436 |
1433 bool is_prefix() const { return is_prefix_; } | 1437 bool is_prefix() const { return is_prefix_; } |
1434 bool is_postfix() const { return !is_prefix_; } | 1438 bool is_postfix() const { return !is_prefix_; } |
1435 | 1439 |
1436 Token::Value op() const { return increment_->op(); } | 1440 Token::Value op() const { return increment_->op(); } |
1437 Token::Value binary_op() { | 1441 Token::Value binary_op() { |
1438 return (op() == Token::INC) ? Token::ADD : Token::SUB; | 1442 return (op() == Token::INC) ? Token::ADD : Token::SUB; |
1439 } | 1443 } |
1440 | 1444 |
1441 Expression* expression() const { return increment_->expression(); } | 1445 Expression* expression() const { return increment_->expression(); } |
1442 IncrementOperation* increment() const { return increment_; } | 1446 IncrementOperation* increment() const { return increment_; } |
1443 int position() const { return pos_; } | 1447 int position() const { return pos_; } |
1444 | 1448 |
1445 virtual void MarkAsStatement() { is_prefix_ = true; } | 1449 virtual void MarkAsStatement() { is_prefix_ = true; } |
1446 | 1450 |
1447 virtual bool IsInlineable() const; | 1451 virtual bool IsInlineable() const; |
1448 | 1452 |
| 1453 // Bailout support. |
| 1454 int AssignmentId() const { return assignment_id_; } |
| 1455 |
1449 private: | 1456 private: |
1450 bool is_prefix_; | 1457 bool is_prefix_; |
1451 IncrementOperation* increment_; | 1458 IncrementOperation* increment_; |
1452 int pos_; | 1459 int pos_; |
| 1460 int assignment_id_; |
1453 }; | 1461 }; |
1454 | 1462 |
1455 | 1463 |
1456 class CompareOperation: public Expression { | 1464 class CompareOperation: public Expression { |
1457 public: | 1465 public: |
1458 CompareOperation(Token::Value op, | 1466 CompareOperation(Token::Value op, |
1459 Expression* left, | 1467 Expression* left, |
1460 Expression* right, | 1468 Expression* right, |
1461 int pos) | 1469 int pos) |
1462 : op_(op), left_(left), right_(right), pos_(pos), compare_type_(NONE) { | 1470 : op_(op), left_(left), right_(right), pos_(pos), compare_type_(NONE) { |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1572 | 1580 |
1573 // Type feedback information. | 1581 // Type feedback information. |
1574 void RecordTypeFeedback(TypeFeedbackOracle* oracle); | 1582 void RecordTypeFeedback(TypeFeedbackOracle* oracle); |
1575 virtual bool IsMonomorphic() { return is_monomorphic_; } | 1583 virtual bool IsMonomorphic() { return is_monomorphic_; } |
1576 virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; } | 1584 virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; } |
1577 virtual Handle<Map> GetMonomorphicReceiverType() { | 1585 virtual Handle<Map> GetMonomorphicReceiverType() { |
1578 return monomorphic_receiver_type_; | 1586 return monomorphic_receiver_type_; |
1579 } | 1587 } |
1580 | 1588 |
1581 // Bailout support. | 1589 // Bailout support. |
1582 int compound_bailout_id() const { return compound_bailout_id_; } | 1590 int CompoundLoadId() const { return compound_load_id_; } |
| 1591 int AssignmentId() const { return assignment_id_; } |
1583 | 1592 |
1584 private: | 1593 private: |
1585 Token::Value op_; | 1594 Token::Value op_; |
1586 Expression* target_; | 1595 Expression* target_; |
1587 Expression* value_; | 1596 Expression* value_; |
1588 int pos_; | 1597 int pos_; |
1589 BinaryOperation* binary_operation_; | 1598 BinaryOperation* binary_operation_; |
1590 int compound_bailout_id_; | 1599 int compound_load_id_; |
| 1600 int assignment_id_; |
1591 | 1601 |
1592 bool block_start_; | 1602 bool block_start_; |
1593 bool block_end_; | 1603 bool block_end_; |
1594 | 1604 |
1595 bool is_monomorphic_; | 1605 bool is_monomorphic_; |
1596 ZoneMapList* receiver_types_; | 1606 ZoneMapList* receiver_types_; |
1597 Handle<Map> monomorphic_receiver_type_; | 1607 Handle<Map> monomorphic_receiver_type_; |
1598 }; | 1608 }; |
1599 | 1609 |
1600 | 1610 |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2119 AST_NODE_LIST(DEF_VISIT) | 2129 AST_NODE_LIST(DEF_VISIT) |
2120 #undef DEF_VISIT | 2130 #undef DEF_VISIT |
2121 | 2131 |
2122 private: | 2132 private: |
2123 bool stack_overflow_; | 2133 bool stack_overflow_; |
2124 }; | 2134 }; |
2125 | 2135 |
2126 } } // namespace v8::internal | 2136 } } // namespace v8::internal |
2127 | 2137 |
2128 #endif // V8_AST_H_ | 2138 #endif // V8_AST_H_ |
OLD | NEW |