| 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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 FunctionLiteral* fun_; | 431 FunctionLiteral* fun_; |
| 432 }; | 432 }; |
| 433 | 433 |
| 434 | 434 |
| 435 class IterationStatement: public BreakableStatement { | 435 class IterationStatement: public BreakableStatement { |
| 436 public: | 436 public: |
| 437 // Type testing & conversion. | 437 // Type testing & conversion. |
| 438 virtual IterationStatement* AsIterationStatement() { return this; } | 438 virtual IterationStatement* AsIterationStatement() { return this; } |
| 439 | 439 |
| 440 Statement* body() const { return body_; } | 440 Statement* body() const { return body_; } |
| 441 void set_body(Statement* stmt) { body_ = stmt; } | |
| 442 | 441 |
| 443 // Bailout support. | 442 // Bailout support. |
| 444 int OsrEntryId() const { return osr_entry_id_; } | 443 int OsrEntryId() const { return osr_entry_id_; } |
| 445 virtual int ContinueId() const = 0; | 444 virtual int ContinueId() const = 0; |
| 446 | 445 |
| 447 // Code generation | 446 // Code generation |
| 448 BreakTarget* continue_target() { return &continue_target_; } | 447 BreakTarget* continue_target() { return &continue_target_; } |
| 449 | 448 |
| 450 protected: | 449 protected: |
| 451 explicit inline IterationStatement(ZoneStringList* labels); | 450 explicit inline IterationStatement(ZoneStringList* labels); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 473 } | 472 } |
| 474 | 473 |
| 475 Expression* cond() const { return cond_; } | 474 Expression* cond() const { return cond_; } |
| 476 | 475 |
| 477 // Position where condition expression starts. We need it to make | 476 // Position where condition expression starts. We need it to make |
| 478 // the loop's condition a breakable location. | 477 // the loop's condition a breakable location. |
| 479 int condition_position() { return condition_position_; } | 478 int condition_position() { return condition_position_; } |
| 480 void set_condition_position(int pos) { condition_position_ = pos; } | 479 void set_condition_position(int pos) { condition_position_ = pos; } |
| 481 | 480 |
| 482 // Bailout support. | 481 // Bailout support. |
| 483 virtual int ContinueId() const { return next_id_; } | 482 virtual int ContinueId() const { return continue_id_; } |
| 483 int BackEdgeId() const { return back_edge_id_; } |
| 484 | 484 |
| 485 private: | 485 private: |
| 486 Expression* cond_; | 486 Expression* cond_; |
| 487 int condition_position_; | 487 int condition_position_; |
| 488 int next_id_; | 488 int continue_id_; |
| 489 int back_edge_id_; |
| 489 }; | 490 }; |
| 490 | 491 |
| 491 | 492 |
| 492 class WhileStatement: public IterationStatement { | 493 class WhileStatement: public IterationStatement { |
| 493 public: | 494 public: |
| 494 explicit inline WhileStatement(ZoneStringList* labels); | 495 explicit inline WhileStatement(ZoneStringList* labels); |
| 495 | 496 |
| 496 DECLARE_NODE_TYPE(WhileStatement) | 497 DECLARE_NODE_TYPE(WhileStatement) |
| 497 | 498 |
| 498 void Initialize(Expression* cond, Statement* body) { | 499 void Initialize(Expression* cond, Statement* body) { |
| 499 IterationStatement::Initialize(body); | 500 IterationStatement::Initialize(body); |
| 500 cond_ = cond; | 501 cond_ = cond; |
| 501 } | 502 } |
| 502 | 503 |
| 503 Expression* cond() const { return cond_; } | 504 Expression* cond() const { return cond_; } |
| 504 bool may_have_function_literal() const { | 505 bool may_have_function_literal() const { |
| 505 return may_have_function_literal_; | 506 return may_have_function_literal_; |
| 506 } | 507 } |
| 507 void set_may_have_function_literal(bool value) { | 508 void set_may_have_function_literal(bool value) { |
| 508 may_have_function_literal_ = value; | 509 may_have_function_literal_ = value; |
| 509 } | 510 } |
| 510 | 511 |
| 511 // Bailout support. | 512 // Bailout support. |
| 512 virtual int ContinueId() const { return EntryId(); } | 513 virtual int ContinueId() const { return EntryId(); } |
| 514 int BodyId() const { return body_id_; } |
| 513 | 515 |
| 514 private: | 516 private: |
| 515 Expression* cond_; | 517 Expression* cond_; |
| 516 // True if there is a function literal subexpression in the condition. | 518 // True if there is a function literal subexpression in the condition. |
| 517 bool may_have_function_literal_; | 519 bool may_have_function_literal_; |
| 520 int body_id_; |
| 518 }; | 521 }; |
| 519 | 522 |
| 520 | 523 |
| 521 class ForStatement: public IterationStatement { | 524 class ForStatement: public IterationStatement { |
| 522 public: | 525 public: |
| 523 explicit inline ForStatement(ZoneStringList* labels); | 526 explicit inline ForStatement(ZoneStringList* labels); |
| 524 | 527 |
| 525 DECLARE_NODE_TYPE(ForStatement) | 528 DECLARE_NODE_TYPE(ForStatement) |
| 526 | 529 |
| 527 void Initialize(Statement* init, | 530 void Initialize(Statement* init, |
| 528 Expression* cond, | 531 Expression* cond, |
| 529 Statement* next, | 532 Statement* next, |
| 530 Statement* body) { | 533 Statement* body) { |
| 531 IterationStatement::Initialize(body); | 534 IterationStatement::Initialize(body); |
| 532 init_ = init; | 535 init_ = init; |
| 533 cond_ = cond; | 536 cond_ = cond; |
| 534 next_ = next; | 537 next_ = next; |
| 535 } | 538 } |
| 536 | 539 |
| 537 Statement* init() const { return init_; } | 540 Statement* init() const { return init_; } |
| 538 void set_init(Statement* stmt) { init_ = stmt; } | |
| 539 Expression* cond() const { return cond_; } | 541 Expression* cond() const { return cond_; } |
| 540 void set_cond(Expression* expr) { cond_ = expr; } | |
| 541 Statement* next() const { return next_; } | 542 Statement* next() const { return next_; } |
| 542 void set_next(Statement* stmt) { next_ = stmt; } | |
| 543 | 543 |
| 544 bool may_have_function_literal() const { | 544 bool may_have_function_literal() const { |
| 545 return may_have_function_literal_; | 545 return may_have_function_literal_; |
| 546 } | 546 } |
| 547 void set_may_have_function_literal(bool value) { | 547 void set_may_have_function_literal(bool value) { |
| 548 may_have_function_literal_ = value; | 548 may_have_function_literal_ = value; |
| 549 } | 549 } |
| 550 | 550 |
| 551 // Bailout support. | 551 // Bailout support. |
| 552 virtual int ContinueId() const { return next_id_; } | 552 virtual int ContinueId() const { return continue_id_; } |
| 553 int BodyId() const { return body_id_; } |
| 553 | 554 |
| 554 bool is_fast_smi_loop() { return loop_variable_ != NULL; } | 555 bool is_fast_smi_loop() { return loop_variable_ != NULL; } |
| 555 Variable* loop_variable() { return loop_variable_; } | 556 Variable* loop_variable() { return loop_variable_; } |
| 556 void set_loop_variable(Variable* var) { loop_variable_ = var; } | 557 void set_loop_variable(Variable* var) { loop_variable_ = var; } |
| 557 | 558 |
| 558 private: | 559 private: |
| 559 Statement* init_; | 560 Statement* init_; |
| 560 Expression* cond_; | 561 Expression* cond_; |
| 561 Statement* next_; | 562 Statement* next_; |
| 562 // True if there is a function literal subexpression in the condition. | 563 // True if there is a function literal subexpression in the condition. |
| 563 bool may_have_function_literal_; | 564 bool may_have_function_literal_; |
| 564 Variable* loop_variable_; | 565 Variable* loop_variable_; |
| 565 int next_id_; | 566 int continue_id_; |
| 567 int body_id_; |
| 566 }; | 568 }; |
| 567 | 569 |
| 568 | 570 |
| 569 class ForInStatement: public IterationStatement { | 571 class ForInStatement: public IterationStatement { |
| 570 public: | 572 public: |
| 571 explicit inline ForInStatement(ZoneStringList* labels); | 573 explicit inline ForInStatement(ZoneStringList* labels); |
| 572 | 574 |
| 573 DECLARE_NODE_TYPE(ForInStatement) | 575 DECLARE_NODE_TYPE(ForInStatement) |
| 574 | 576 |
| 575 void Initialize(Expression* each, Expression* enumerable, Statement* body) { | 577 void Initialize(Expression* each, Expression* enumerable, Statement* body) { |
| 576 IterationStatement::Initialize(body); | 578 IterationStatement::Initialize(body); |
| 577 each_ = each; | 579 each_ = each; |
| 578 enumerable_ = enumerable; | 580 enumerable_ = enumerable; |
| 579 } | 581 } |
| 580 | 582 |
| 581 Expression* each() const { return each_; } | 583 Expression* each() const { return each_; } |
| 582 Expression* enumerable() const { return enumerable_; } | 584 Expression* enumerable() const { return enumerable_; } |
| 583 | 585 |
| 584 // Bailout support. | 586 // Bailout support. |
| 587 int AssignmentId() const { return assignment_id_; } |
| 585 virtual int ContinueId() const { return EntryId(); } | 588 virtual int ContinueId() const { return EntryId(); } |
| 586 | 589 |
| 587 private: | 590 private: |
| 588 Expression* each_; | 591 Expression* each_; |
| 589 Expression* enumerable_; | 592 Expression* enumerable_; |
| 593 int assignment_id_; |
| 590 }; | 594 }; |
| 591 | 595 |
| 592 | 596 |
| 593 class ExpressionStatement: public Statement { | 597 class ExpressionStatement: public Statement { |
| 594 public: | 598 public: |
| 595 explicit ExpressionStatement(Expression* expression) | 599 explicit ExpressionStatement(Expression* expression) |
| 596 : expression_(expression) { } | 600 : expression_(expression) { } |
| 597 | 601 |
| 598 DECLARE_NODE_TYPE(ExpressionStatement) | 602 DECLARE_NODE_TYPE(ExpressionStatement) |
| 599 | 603 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 // the parser implicitly creates an empty statement. Use the | 737 // the parser implicitly creates an empty statement. Use the |
| 734 // HasThenStatement() and HasElseStatement() functions to check if a | 738 // HasThenStatement() and HasElseStatement() functions to check if a |
| 735 // given if-statement has a then- or an else-part containing code. | 739 // given if-statement has a then- or an else-part containing code. |
| 736 class IfStatement: public Statement { | 740 class IfStatement: public Statement { |
| 737 public: | 741 public: |
| 738 IfStatement(Expression* condition, | 742 IfStatement(Expression* condition, |
| 739 Statement* then_statement, | 743 Statement* then_statement, |
| 740 Statement* else_statement) | 744 Statement* else_statement) |
| 741 : condition_(condition), | 745 : condition_(condition), |
| 742 then_statement_(then_statement), | 746 then_statement_(then_statement), |
| 743 else_statement_(else_statement) { } | 747 else_statement_(else_statement), |
| 748 then_id_(GetNextId()), |
| 749 else_id_(GetNextId()) { |
| 750 } |
| 744 | 751 |
| 745 DECLARE_NODE_TYPE(IfStatement) | 752 DECLARE_NODE_TYPE(IfStatement) |
| 746 | 753 |
| 747 virtual bool IsInlineable() const; | 754 virtual bool IsInlineable() const; |
| 748 | 755 |
| 749 bool HasThenStatement() const { return !then_statement()->IsEmpty(); } | 756 bool HasThenStatement() const { return !then_statement()->IsEmpty(); } |
| 750 bool HasElseStatement() const { return !else_statement()->IsEmpty(); } | 757 bool HasElseStatement() const { return !else_statement()->IsEmpty(); } |
| 751 | 758 |
| 752 Expression* condition() const { return condition_; } | 759 Expression* condition() const { return condition_; } |
| 753 Statement* then_statement() const { return then_statement_; } | 760 Statement* then_statement() const { return then_statement_; } |
| 754 void set_then_statement(Statement* stmt) { then_statement_ = stmt; } | |
| 755 Statement* else_statement() const { return else_statement_; } | 761 Statement* else_statement() const { return else_statement_; } |
| 756 void set_else_statement(Statement* stmt) { else_statement_ = stmt; } | 762 |
| 763 int ThenId() const { return then_id_; } |
| 764 int ElseId() const { return else_id_; } |
| 757 | 765 |
| 758 private: | 766 private: |
| 759 Expression* condition_; | 767 Expression* condition_; |
| 760 Statement* then_statement_; | 768 Statement* then_statement_; |
| 761 Statement* else_statement_; | 769 Statement* else_statement_; |
| 770 int then_id_; |
| 771 int else_id_; |
| 762 }; | 772 }; |
| 763 | 773 |
| 764 | 774 |
| 765 // NOTE: TargetCollectors are represented as nodes to fit in the target | 775 // NOTE: TargetCollectors are represented as nodes to fit in the target |
| 766 // stack in the compiler; this should probably be reworked. | 776 // stack in the compiler; this should probably be reworked. |
| 767 class TargetCollector: public AstNode { | 777 class TargetCollector: public AstNode { |
| 768 public: | 778 public: |
| 769 explicit TargetCollector(ZoneList<BreakTarget*>* targets) | 779 explicit TargetCollector(ZoneList<BreakTarget*>* targets) |
| 770 : targets_(targets) { | 780 : targets_(targets) { |
| 771 } | 781 } |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1398 | 1408 |
| 1399 | 1409 |
| 1400 class BinaryOperation: public Expression { | 1410 class BinaryOperation: public Expression { |
| 1401 public: | 1411 public: |
| 1402 BinaryOperation(Token::Value op, | 1412 BinaryOperation(Token::Value op, |
| 1403 Expression* left, | 1413 Expression* left, |
| 1404 Expression* right, | 1414 Expression* right, |
| 1405 int pos) | 1415 int pos) |
| 1406 : op_(op), left_(left), right_(right), pos_(pos), is_smi_only_(false) { | 1416 : op_(op), left_(left), right_(right), pos_(pos), is_smi_only_(false) { |
| 1407 ASSERT(Token::IsBinaryOp(op)); | 1417 ASSERT(Token::IsBinaryOp(op)); |
| 1418 right_id_ = (op == Token::AND || op == Token::OR) |
| 1419 ? GetNextId() |
| 1420 : AstNode::kNoNumber; |
| 1408 } | 1421 } |
| 1409 | 1422 |
| 1410 // Create the binary operation corresponding to a compound assignment. | 1423 // Create the binary operation corresponding to a compound assignment. |
| 1411 explicit BinaryOperation(Assignment* assignment); | 1424 explicit BinaryOperation(Assignment* assignment); |
| 1412 | 1425 |
| 1413 DECLARE_NODE_TYPE(BinaryOperation) | 1426 DECLARE_NODE_TYPE(BinaryOperation) |
| 1414 | 1427 |
| 1415 virtual bool IsInlineable() const; | 1428 virtual bool IsInlineable() const; |
| 1416 | 1429 |
| 1417 virtual bool ResultOverwriteAllowed(); | 1430 virtual bool ResultOverwriteAllowed(); |
| 1418 | 1431 |
| 1419 Token::Value op() const { return op_; } | 1432 Token::Value op() const { return op_; } |
| 1420 Expression* left() const { return left_; } | 1433 Expression* left() const { return left_; } |
| 1421 Expression* right() const { return right_; } | 1434 Expression* right() const { return right_; } |
| 1422 int position() const { return pos_; } | 1435 int position() const { return pos_; } |
| 1423 | 1436 |
| 1424 // Type feedback information. | 1437 // Type feedback information. |
| 1425 void RecordTypeFeedback(TypeFeedbackOracle* oracle); | 1438 void RecordTypeFeedback(TypeFeedbackOracle* oracle); |
| 1426 bool IsSmiOnly() const { return is_smi_only_; } | 1439 bool IsSmiOnly() const { return is_smi_only_; } |
| 1427 | 1440 |
| 1441 // Bailout support. |
| 1442 int RightId() const { return right_id_; } |
| 1443 |
| 1428 private: | 1444 private: |
| 1429 Token::Value op_; | 1445 Token::Value op_; |
| 1430 Expression* left_; | 1446 Expression* left_; |
| 1431 Expression* right_; | 1447 Expression* right_; |
| 1432 int pos_; | 1448 int pos_; |
| 1433 bool is_smi_only_; | 1449 bool is_smi_only_; |
| 1450 // The short-circuit logical operations have an AST ID for their |
| 1451 // right-hand subexpression. |
| 1452 int right_id_; |
| 1434 }; | 1453 }; |
| 1435 | 1454 |
| 1436 | 1455 |
| 1437 class IncrementOperation: public Expression { | 1456 class IncrementOperation: public Expression { |
| 1438 public: | 1457 public: |
| 1439 IncrementOperation(Token::Value op, Expression* expr) | 1458 IncrementOperation(Token::Value op, Expression* expr) |
| 1440 : op_(op), expression_(expr) { | 1459 : op_(op), expression_(expr) { |
| 1441 ASSERT(Token::IsCountOp(op)); | 1460 ASSERT(Token::IsCountOp(op)); |
| 1442 } | 1461 } |
| 1443 | 1462 |
| 1444 DECLARE_NODE_TYPE(IncrementOperation) | 1463 DECLARE_NODE_TYPE(IncrementOperation) |
| 1445 | 1464 |
| 1446 Token::Value op() const { return op_; } | 1465 Token::Value op() const { return op_; } |
| 1447 bool is_increment() { return op_ == Token::INC; } | 1466 bool is_increment() { return op_ == Token::INC; } |
| 1448 Expression* expression() const { return expression_; } | 1467 Expression* expression() const { return expression_; } |
| 1449 | 1468 |
| 1450 private: | 1469 private: |
| 1451 Token::Value op_; | 1470 Token::Value op_; |
| 1452 Expression* expression_; | 1471 Expression* expression_; |
| 1453 int pos_; | 1472 int pos_; |
| 1454 }; | 1473 }; |
| 1455 | 1474 |
| 1456 | 1475 |
| 1457 class CountOperation: public Expression { | 1476 class CountOperation: public Expression { |
| 1458 public: | 1477 public: |
| 1459 CountOperation(bool is_prefix, IncrementOperation* increment, int pos) | 1478 CountOperation(bool is_prefix, IncrementOperation* increment, int pos) |
| 1460 : is_prefix_(is_prefix), increment_(increment), pos_(pos) { } | 1479 : is_prefix_(is_prefix), increment_(increment), pos_(pos), |
| 1480 assignment_id_(GetNextId()) { |
| 1481 } |
| 1461 | 1482 |
| 1462 DECLARE_NODE_TYPE(CountOperation) | 1483 DECLARE_NODE_TYPE(CountOperation) |
| 1463 | 1484 |
| 1464 bool is_prefix() const { return is_prefix_; } | 1485 bool is_prefix() const { return is_prefix_; } |
| 1465 bool is_postfix() const { return !is_prefix_; } | 1486 bool is_postfix() const { return !is_prefix_; } |
| 1466 | 1487 |
| 1467 Token::Value op() const { return increment_->op(); } | 1488 Token::Value op() const { return increment_->op(); } |
| 1468 Token::Value binary_op() { | 1489 Token::Value binary_op() { |
| 1469 return (op() == Token::INC) ? Token::ADD : Token::SUB; | 1490 return (op() == Token::INC) ? Token::ADD : Token::SUB; |
| 1470 } | 1491 } |
| 1471 | 1492 |
| 1472 Expression* expression() const { return increment_->expression(); } | 1493 Expression* expression() const { return increment_->expression(); } |
| 1473 IncrementOperation* increment() const { return increment_; } | 1494 IncrementOperation* increment() const { return increment_; } |
| 1474 int position() const { return pos_; } | 1495 int position() const { return pos_; } |
| 1475 | 1496 |
| 1476 virtual void MarkAsStatement() { is_prefix_ = true; } | 1497 virtual void MarkAsStatement() { is_prefix_ = true; } |
| 1477 | 1498 |
| 1478 virtual bool IsInlineable() const; | 1499 virtual bool IsInlineable() const; |
| 1479 | 1500 |
| 1501 // Bailout support. |
| 1502 int AssignmentId() const { return assignment_id_; } |
| 1503 |
| 1480 private: | 1504 private: |
| 1481 bool is_prefix_; | 1505 bool is_prefix_; |
| 1482 IncrementOperation* increment_; | 1506 IncrementOperation* increment_; |
| 1483 int pos_; | 1507 int pos_; |
| 1508 int assignment_id_; |
| 1484 }; | 1509 }; |
| 1485 | 1510 |
| 1486 | 1511 |
| 1487 class CompareOperation: public Expression { | 1512 class CompareOperation: public Expression { |
| 1488 public: | 1513 public: |
| 1489 CompareOperation(Token::Value op, | 1514 CompareOperation(Token::Value op, |
| 1490 Expression* left, | 1515 Expression* left, |
| 1491 Expression* right, | 1516 Expression* right, |
| 1492 int pos) | 1517 int pos) |
| 1493 : op_(op), left_(left), right_(right), pos_(pos), compare_type_(NONE) { | 1518 : op_(op), left_(left), right_(right), pos_(pos), compare_type_(NONE) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1542 public: | 1567 public: |
| 1543 Conditional(Expression* condition, | 1568 Conditional(Expression* condition, |
| 1544 Expression* then_expression, | 1569 Expression* then_expression, |
| 1545 Expression* else_expression, | 1570 Expression* else_expression, |
| 1546 int then_expression_position, | 1571 int then_expression_position, |
| 1547 int else_expression_position) | 1572 int else_expression_position) |
| 1548 : condition_(condition), | 1573 : condition_(condition), |
| 1549 then_expression_(then_expression), | 1574 then_expression_(then_expression), |
| 1550 else_expression_(else_expression), | 1575 else_expression_(else_expression), |
| 1551 then_expression_position_(then_expression_position), | 1576 then_expression_position_(then_expression_position), |
| 1552 else_expression_position_(else_expression_position) { } | 1577 else_expression_position_(else_expression_position), |
| 1578 then_id_(GetNextId()), |
| 1579 else_id_(GetNextId()) { |
| 1580 } |
| 1553 | 1581 |
| 1554 DECLARE_NODE_TYPE(Conditional) | 1582 DECLARE_NODE_TYPE(Conditional) |
| 1555 | 1583 |
| 1556 virtual bool IsInlineable() const; | 1584 virtual bool IsInlineable() const; |
| 1557 | 1585 |
| 1558 Expression* condition() const { return condition_; } | 1586 Expression* condition() const { return condition_; } |
| 1559 Expression* then_expression() const { return then_expression_; } | 1587 Expression* then_expression() const { return then_expression_; } |
| 1560 Expression* else_expression() const { return else_expression_; } | 1588 Expression* else_expression() const { return else_expression_; } |
| 1561 | 1589 |
| 1562 int then_expression_position() { return then_expression_position_; } | 1590 int then_expression_position() const { return then_expression_position_; } |
| 1563 int else_expression_position() { return else_expression_position_; } | 1591 int else_expression_position() const { return else_expression_position_; } |
| 1592 |
| 1593 int ThenId() const { return then_id_; } |
| 1594 int ElseId() const { return else_id_; } |
| 1564 | 1595 |
| 1565 private: | 1596 private: |
| 1566 Expression* condition_; | 1597 Expression* condition_; |
| 1567 Expression* then_expression_; | 1598 Expression* then_expression_; |
| 1568 Expression* else_expression_; | 1599 Expression* else_expression_; |
| 1569 int then_expression_position_; | 1600 int then_expression_position_; |
| 1570 int else_expression_position_; | 1601 int else_expression_position_; |
| 1602 int then_id_; |
| 1603 int else_id_; |
| 1571 }; | 1604 }; |
| 1572 | 1605 |
| 1573 | 1606 |
| 1574 class Assignment: public Expression { | 1607 class Assignment: public Expression { |
| 1575 public: | 1608 public: |
| 1576 Assignment(Token::Value op, Expression* target, Expression* value, int pos); | 1609 Assignment(Token::Value op, Expression* target, Expression* value, int pos); |
| 1577 | 1610 |
| 1578 DECLARE_NODE_TYPE(Assignment) | 1611 DECLARE_NODE_TYPE(Assignment) |
| 1579 | 1612 |
| 1580 virtual bool IsInlineable() const; | 1613 virtual bool IsInlineable() const; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1603 | 1636 |
| 1604 // Type feedback information. | 1637 // Type feedback information. |
| 1605 void RecordTypeFeedback(TypeFeedbackOracle* oracle); | 1638 void RecordTypeFeedback(TypeFeedbackOracle* oracle); |
| 1606 virtual bool IsMonomorphic() { return is_monomorphic_; } | 1639 virtual bool IsMonomorphic() { return is_monomorphic_; } |
| 1607 virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; } | 1640 virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; } |
| 1608 virtual Handle<Map> GetMonomorphicReceiverType() { | 1641 virtual Handle<Map> GetMonomorphicReceiverType() { |
| 1609 return monomorphic_receiver_type_; | 1642 return monomorphic_receiver_type_; |
| 1610 } | 1643 } |
| 1611 | 1644 |
| 1612 // Bailout support. | 1645 // Bailout support. |
| 1613 int compound_bailout_id() const { return compound_bailout_id_; } | 1646 int CompoundLoadId() const { return compound_load_id_; } |
| 1647 int AssignmentId() const { return assignment_id_; } |
| 1614 | 1648 |
| 1615 private: | 1649 private: |
| 1616 Token::Value op_; | 1650 Token::Value op_; |
| 1617 Expression* target_; | 1651 Expression* target_; |
| 1618 Expression* value_; | 1652 Expression* value_; |
| 1619 int pos_; | 1653 int pos_; |
| 1620 BinaryOperation* binary_operation_; | 1654 BinaryOperation* binary_operation_; |
| 1621 int compound_bailout_id_; | 1655 int compound_load_id_; |
| 1656 int assignment_id_; |
| 1622 | 1657 |
| 1623 bool block_start_; | 1658 bool block_start_; |
| 1624 bool block_end_; | 1659 bool block_end_; |
| 1625 | 1660 |
| 1626 bool is_monomorphic_; | 1661 bool is_monomorphic_; |
| 1627 ZoneMapList* receiver_types_; | 1662 ZoneMapList* receiver_types_; |
| 1628 Handle<Map> monomorphic_receiver_type_; | 1663 Handle<Map> monomorphic_receiver_type_; |
| 1629 }; | 1664 }; |
| 1630 | 1665 |
| 1631 | 1666 |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2151 #undef DEF_VISIT | 2186 #undef DEF_VISIT |
| 2152 | 2187 |
| 2153 private: | 2188 private: |
| 2154 bool stack_overflow_; | 2189 bool stack_overflow_; |
| 2155 }; | 2190 }; |
| 2156 | 2191 |
| 2157 | 2192 |
| 2158 } } // namespace v8::internal | 2193 } } // namespace v8::internal |
| 2159 | 2194 |
| 2160 #endif // V8_AST_H_ | 2195 #endif // V8_AST_H_ |
| OLD | NEW |