| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 #define STATEMENT_NODE_LIST(V) \ | 55 #define STATEMENT_NODE_LIST(V) \ |
| 56 V(Block) \ | 56 V(Block) \ |
| 57 V(ExpressionStatement) \ | 57 V(ExpressionStatement) \ |
| 58 V(EmptyStatement) \ | 58 V(EmptyStatement) \ |
| 59 V(IfStatement) \ | 59 V(IfStatement) \ |
| 60 V(ContinueStatement) \ | 60 V(ContinueStatement) \ |
| 61 V(BreakStatement) \ | 61 V(BreakStatement) \ |
| 62 V(ReturnStatement) \ | 62 V(ReturnStatement) \ |
| 63 V(EnterWithContextStatement) \ | 63 V(EnterWithContextStatement) \ |
| 64 V(ExitContextStatement) \ | 64 V(ExitContextStatement) \ |
| 65 V(ExitScopedBlockStatement) \ |
| 65 V(SwitchStatement) \ | 66 V(SwitchStatement) \ |
| 66 V(DoWhileStatement) \ | 67 V(DoWhileStatement) \ |
| 67 V(WhileStatement) \ | 68 V(WhileStatement) \ |
| 68 V(ForStatement) \ | 69 V(ForStatement) \ |
| 69 V(ForInStatement) \ | 70 V(ForInStatement) \ |
| 70 V(TryCatchStatement) \ | 71 V(TryCatchStatement) \ |
| 71 V(TryFinallyStatement) \ | 72 V(TryFinallyStatement) \ |
| 72 V(DebuggerStatement) | 73 V(DebuggerStatement) |
| 73 | 74 |
| 74 #define EXPRESSION_NODE_LIST(V) \ | 75 #define EXPRESSION_NODE_LIST(V) \ |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 return statements_[0]->StatementAsCountOperation(); | 353 return statements_[0]->StatementAsCountOperation(); |
| 353 } | 354 } |
| 354 | 355 |
| 355 virtual bool IsInlineable() const; | 356 virtual bool IsInlineable() const; |
| 356 | 357 |
| 357 void AddStatement(Statement* statement) { statements_.Add(statement); } | 358 void AddStatement(Statement* statement) { statements_.Add(statement); } |
| 358 | 359 |
| 359 ZoneList<Statement*>* statements() { return &statements_; } | 360 ZoneList<Statement*>* statements() { return &statements_; } |
| 360 bool is_initializer_block() const { return is_initializer_block_; } | 361 bool is_initializer_block() const { return is_initializer_block_; } |
| 361 | 362 |
| 363 int SourceBegStatementPos() const { return source_beg_statement_pos_; } |
| 364 void SetSourceBegStatementPos(int statement_pos) { |
| 365 source_beg_statement_pos_ = statement_pos; |
| 366 } |
| 367 int SourceEndStatementPos() const { return source_end_statement_pos_; } |
| 368 void SetSourceEndStatementPos(int statement_pos) { |
| 369 source_end_statement_pos_ = statement_pos; |
| 370 } |
| 371 |
| 362 private: | 372 private: |
| 363 ZoneList<Statement*> statements_; | 373 ZoneList<Statement*> statements_; |
| 364 bool is_initializer_block_; | 374 bool is_initializer_block_; |
| 375 |
| 376 int source_beg_statement_pos_; |
| 377 int source_end_statement_pos_; |
| 365 }; | 378 }; |
| 366 | 379 |
| 367 | 380 |
| 368 class Declaration: public AstNode { | 381 class Declaration: public AstNode { |
| 369 public: | 382 public: |
| 370 Declaration(VariableProxy* proxy, Variable::Mode mode, FunctionLiteral* fun) | 383 Declaration(VariableProxy* proxy, Variable::Mode mode, FunctionLiteral* fun) |
| 371 : proxy_(proxy), | 384 : proxy_(proxy), |
| 372 mode_(mode), | 385 mode_(mode), |
| 373 fun_(fun) { | 386 fun_(fun) { |
| 374 ASSERT(mode == Variable::VAR || mode == Variable::CONST); | 387 ASSERT(mode == Variable::VAR || mode == Variable::CONST); |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 | 657 |
| 645 | 658 |
| 646 class ExitContextStatement: public Statement { | 659 class ExitContextStatement: public Statement { |
| 647 public: | 660 public: |
| 648 virtual bool IsInlineable() const; | 661 virtual bool IsInlineable() const; |
| 649 | 662 |
| 650 DECLARE_NODE_TYPE(ExitContextStatement) | 663 DECLARE_NODE_TYPE(ExitContextStatement) |
| 651 }; | 664 }; |
| 652 | 665 |
| 653 | 666 |
| 667 class ExitScopedBlockStatement: public Statement { |
| 668 public: |
| 669 explicit ExitScopedBlockStatement(Scope* scope) |
| 670 : scope_(scope) { } |
| 671 |
| 672 virtual bool IsInlineable() const; |
| 673 |
| 674 DECLARE_NODE_TYPE(ExitScopedBlockStatement) |
| 675 |
| 676 Scope* scope() { return scope_; } |
| 677 |
| 678 private: |
| 679 Scope* scope_; |
| 680 }; |
| 681 |
| 682 |
| 654 class CaseClause: public ZoneObject { | 683 class CaseClause: public ZoneObject { |
| 655 public: | 684 public: |
| 656 CaseClause(Isolate* isolate, | 685 CaseClause(Isolate* isolate, |
| 657 Expression* label, | 686 Expression* label, |
| 658 ZoneList<Statement*>* statements, | 687 ZoneList<Statement*>* statements, |
| 659 int pos); | 688 int pos); |
| 660 | 689 |
| 661 bool is_default() const { return label_ == NULL; } | 690 bool is_default() const { return label_ == NULL; } |
| 662 Expression* label() const { | 691 Expression* label() const { |
| 663 CHECK(!is_default()); | 692 CHECK(!is_default()); |
| (...skipping 1563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2227 | 2256 |
| 2228 private: | 2257 private: |
| 2229 Isolate* isolate_; | 2258 Isolate* isolate_; |
| 2230 bool stack_overflow_; | 2259 bool stack_overflow_; |
| 2231 }; | 2260 }; |
| 2232 | 2261 |
| 2233 | 2262 |
| 2234 } } // namespace v8::internal | 2263 } } // namespace v8::internal |
| 2235 | 2264 |
| 2236 #endif // V8_AST_H_ | 2265 #endif // V8_AST_H_ |
| OLD | NEW |