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/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/ast/ast-value-factory.h" | 9 #include "src/ast/ast-value-factory.h" |
10 #include "src/ast/modules.h" | 10 #include "src/ast/modules.h" |
(...skipping 2513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2524 enum ArityRestriction { | 2524 enum ArityRestriction { |
2525 NORMAL_ARITY, | 2525 NORMAL_ARITY, |
2526 GETTER_ARITY, | 2526 GETTER_ARITY, |
2527 SETTER_ARITY | 2527 SETTER_ARITY |
2528 }; | 2528 }; |
2529 | 2529 |
2530 DECLARE_NODE_TYPE(FunctionLiteral) | 2530 DECLARE_NODE_TYPE(FunctionLiteral) |
2531 | 2531 |
2532 Handle<String> name() const { return raw_name_->string(); } | 2532 Handle<String> name() const { return raw_name_->string(); } |
2533 const AstRawString* raw_name() const { return raw_name_; } | 2533 const AstRawString* raw_name() const { return raw_name_; } |
| 2534 void set_raw_name(const AstRawString* name) { raw_name_ = name; } |
2534 Scope* scope() const { return scope_; } | 2535 Scope* scope() const { return scope_; } |
2535 ZoneList<Statement*>* body() const { return body_; } | 2536 ZoneList<Statement*>* body() const { return body_; } |
2536 void set_function_token_position(int pos) { function_token_position_ = pos; } | 2537 void set_function_token_position(int pos) { function_token_position_ = pos; } |
2537 int function_token_position() const { return function_token_position_; } | 2538 int function_token_position() const { return function_token_position_; } |
2538 int start_position() const; | 2539 int start_position() const; |
2539 int end_position() const; | 2540 int end_position() const; |
2540 int SourceSize() const { return end_position() - start_position(); } | 2541 int SourceSize() const { return end_position() - start_position(); } |
2541 bool is_expression() const { return IsExpression::decode(bitfield_); } | 2542 bool is_expression() const { return IsExpression::decode(bitfield_); } |
2542 bool is_anonymous() const { return IsAnonymous::decode(bitfield_); } | 2543 bool is_anonymous() const { return IsAnonymous::decode(bitfield_); } |
2543 LanguageMode language_mode() const; | 2544 LanguageMode language_mode() const; |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2692 | 2693 |
2693 | 2694 |
2694 class ClassLiteral final : public Expression { | 2695 class ClassLiteral final : public Expression { |
2695 public: | 2696 public: |
2696 typedef ObjectLiteralProperty Property; | 2697 typedef ObjectLiteralProperty Property; |
2697 | 2698 |
2698 DECLARE_NODE_TYPE(ClassLiteral) | 2699 DECLARE_NODE_TYPE(ClassLiteral) |
2699 | 2700 |
2700 Handle<String> name() const { return raw_name_->string(); } | 2701 Handle<String> name() const { return raw_name_->string(); } |
2701 const AstRawString* raw_name() const { return raw_name_; } | 2702 const AstRawString* raw_name() const { return raw_name_; } |
| 2703 void set_raw_name(const AstRawString* name) { |
| 2704 DCHECK_NULL(raw_name_); |
| 2705 raw_name_ = name; |
| 2706 } |
| 2707 |
2702 Scope* scope() const { return scope_; } | 2708 Scope* scope() const { return scope_; } |
2703 VariableProxy* class_variable_proxy() const { return class_variable_proxy_; } | 2709 VariableProxy* class_variable_proxy() const { return class_variable_proxy_; } |
2704 Expression* extends() const { return extends_; } | 2710 Expression* extends() const { return extends_; } |
2705 FunctionLiteral* constructor() const { return constructor_; } | 2711 FunctionLiteral* constructor() const { return constructor_; } |
2706 ZoneList<Property*>* properties() const { return properties_; } | 2712 ZoneList<Property*>* properties() const { return properties_; } |
2707 int start_position() const { return position(); } | 2713 int start_position() const { return position(); } |
2708 int end_position() const { return end_position_; } | 2714 int end_position() const { return end_position_; } |
2709 | 2715 |
2710 BailoutId EntryId() const { return BailoutId(local_id(0)); } | 2716 BailoutId EntryId() const { return BailoutId(local_id(0)); } |
2711 BailoutId DeclsId() const { return BailoutId(local_id(1)); } | 2717 BailoutId DeclsId() const { return BailoutId(local_id(1)); } |
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3709 // the parser-level zone. | 3715 // the parser-level zone. |
3710 Zone* parser_zone_; | 3716 Zone* parser_zone_; |
3711 AstValueFactory* ast_value_factory_; | 3717 AstValueFactory* ast_value_factory_; |
3712 }; | 3718 }; |
3713 | 3719 |
3714 | 3720 |
3715 } // namespace internal | 3721 } // namespace internal |
3716 } // namespace v8 | 3722 } // namespace v8 |
3717 | 3723 |
3718 #endif // V8_AST_AST_H_ | 3724 #endif // V8_AST_AST_H_ |
OLD | NEW |