| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_AST_AST_H_ | 5 #ifndef V8_AST_AST_H_ |
| 6 #define V8_AST_AST_H_ | 6 #define V8_AST_AST_H_ |
| 7 | 7 |
| 8 #include "src/ast/ast-value-factory.h" | 8 #include "src/ast/ast-value-factory.h" |
| 9 #include "src/ast/modules.h" | 9 #include "src/ast/modules.h" |
| 10 #include "src/ast/variables.h" | 10 #include "src/ast/variables.h" |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 VariableProxy* result_; | 505 VariableProxy* result_; |
| 506 }; | 506 }; |
| 507 | 507 |
| 508 | 508 |
| 509 class Declaration : public AstNode { | 509 class Declaration : public AstNode { |
| 510 public: | 510 public: |
| 511 VariableProxy* proxy() const { return proxy_; } | 511 VariableProxy* proxy() const { return proxy_; } |
| 512 VariableMode mode() const { return mode_; } | 512 VariableMode mode() const { return mode_; } |
| 513 Scope* scope() const { return scope_; } | 513 Scope* scope() const { return scope_; } |
| 514 virtual InitializationFlag initialization() const = 0; | 514 virtual InitializationFlag initialization() const = 0; |
| 515 virtual bool IsInlineable() const; | |
| 516 | 515 |
| 517 protected: | 516 protected: |
| 518 Declaration(Zone* zone, VariableProxy* proxy, VariableMode mode, Scope* scope, | 517 Declaration(Zone* zone, VariableProxy* proxy, VariableMode mode, Scope* scope, |
| 519 int pos) | 518 int pos) |
| 520 : AstNode(pos), mode_(mode), proxy_(proxy), scope_(scope) { | 519 : AstNode(pos), mode_(mode), proxy_(proxy), scope_(scope) { |
| 521 DCHECK(IsDeclaredVariableMode(mode)); | 520 DCHECK(IsDeclaredVariableMode(mode)); |
| 522 } | 521 } |
| 523 | 522 |
| 524 private: | 523 private: |
| 525 VariableMode mode_; | 524 VariableMode mode_; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 547 | 546 |
| 548 class FunctionDeclaration final : public Declaration { | 547 class FunctionDeclaration final : public Declaration { |
| 549 public: | 548 public: |
| 550 DECLARE_NODE_TYPE(FunctionDeclaration) | 549 DECLARE_NODE_TYPE(FunctionDeclaration) |
| 551 | 550 |
| 552 FunctionLiteral* fun() const { return fun_; } | 551 FunctionLiteral* fun() const { return fun_; } |
| 553 void set_fun(FunctionLiteral* f) { fun_ = f; } | 552 void set_fun(FunctionLiteral* f) { fun_ = f; } |
| 554 InitializationFlag initialization() const override { | 553 InitializationFlag initialization() const override { |
| 555 return kCreatedInitialized; | 554 return kCreatedInitialized; |
| 556 } | 555 } |
| 557 bool IsInlineable() const override; | |
| 558 | 556 |
| 559 protected: | 557 protected: |
| 560 FunctionDeclaration(Zone* zone, | 558 FunctionDeclaration(Zone* zone, |
| 561 VariableProxy* proxy, | 559 VariableProxy* proxy, |
| 562 VariableMode mode, | 560 VariableMode mode, |
| 563 FunctionLiteral* fun, | 561 FunctionLiteral* fun, |
| 564 Scope* scope, | 562 Scope* scope, |
| 565 int pos) | 563 int pos) |
| 566 : Declaration(zone, proxy, mode, scope, pos), | 564 : Declaration(zone, proxy, mode, scope, pos), |
| 567 fun_(fun) { | 565 fun_(fun) { |
| (...skipping 2989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3557 : NULL; \ | 3555 : NULL; \ |
| 3558 } | 3556 } |
| 3559 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3557 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
| 3560 #undef DECLARE_NODE_FUNCTIONS | 3558 #undef DECLARE_NODE_FUNCTIONS |
| 3561 | 3559 |
| 3562 | 3560 |
| 3563 } // namespace internal | 3561 } // namespace internal |
| 3564 } // namespace v8 | 3562 } // namespace v8 |
| 3565 | 3563 |
| 3566 #endif // V8_AST_AST_H_ | 3564 #endif // V8_AST_AST_H_ |
| OLD | NEW |