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_H_ | 5 #ifndef V8_AST_H_ |
6 #define V8_AST_H_ | 6 #define V8_AST_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/assembler.h" | 10 #include "src/assembler.h" |
(...skipping 2642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2653 Handle<String> name() const { return raw_name_->string(); } | 2653 Handle<String> name() const { return raw_name_->string(); } |
2654 const AstRawString* raw_name() const { return raw_name_; } | 2654 const AstRawString* raw_name() const { return raw_name_; } |
2655 Scope* scope() const { return scope_; } | 2655 Scope* scope() const { return scope_; } |
2656 VariableProxy* class_variable_proxy() const { return class_variable_proxy_; } | 2656 VariableProxy* class_variable_proxy() const { return class_variable_proxy_; } |
2657 Expression* extends() const { return extends_; } | 2657 Expression* extends() const { return extends_; } |
2658 Expression* constructor() const { return constructor_; } | 2658 Expression* constructor() const { return constructor_; } |
2659 ZoneList<Property*>* properties() const { return properties_; } | 2659 ZoneList<Property*>* properties() const { return properties_; } |
2660 int start_position() const { return position(); } | 2660 int start_position() const { return position(); } |
2661 int end_position() const { return end_position_; } | 2661 int end_position() const { return end_position_; } |
2662 | 2662 |
| 2663 static int num_ids() { return parent_num_ids() + 3; } |
| 2664 BailoutId EntryId() const { return BailoutId(local_id(0)); } |
| 2665 BailoutId DeclsId() const { return BailoutId(local_id(1)); } |
| 2666 BailoutId ExitId() { return BailoutId(local_id(2)); } |
| 2667 |
2663 protected: | 2668 protected: |
2664 ClassLiteral(Zone* zone, const AstRawString* name, Scope* scope, | 2669 ClassLiteral(Zone* zone, const AstRawString* name, Scope* scope, |
2665 VariableProxy* class_variable_proxy, Expression* extends, | 2670 VariableProxy* class_variable_proxy, Expression* extends, |
2666 Expression* constructor, ZoneList<Property*>* properties, | 2671 Expression* constructor, ZoneList<Property*>* properties, |
2667 int start_position, int end_position) | 2672 int start_position, int end_position) |
2668 : Expression(zone, start_position), | 2673 : Expression(zone, start_position), |
2669 raw_name_(name), | 2674 raw_name_(name), |
2670 scope_(scope), | 2675 scope_(scope), |
2671 class_variable_proxy_(class_variable_proxy), | 2676 class_variable_proxy_(class_variable_proxy), |
2672 extends_(extends), | 2677 extends_(extends), |
2673 constructor_(constructor), | 2678 constructor_(constructor), |
2674 properties_(properties), | 2679 properties_(properties), |
2675 end_position_(end_position) {} | 2680 end_position_(end_position) {} |
| 2681 static int parent_num_ids() { return Expression::num_ids(); } |
2676 | 2682 |
2677 private: | 2683 private: |
| 2684 int local_id(int n) const { return base_id() + parent_num_ids() + n; } |
| 2685 |
2678 const AstRawString* raw_name_; | 2686 const AstRawString* raw_name_; |
2679 Scope* scope_; | 2687 Scope* scope_; |
2680 VariableProxy* class_variable_proxy_; | 2688 VariableProxy* class_variable_proxy_; |
2681 Expression* extends_; | 2689 Expression* extends_; |
2682 Expression* constructor_; | 2690 Expression* constructor_; |
2683 ZoneList<Property*>* properties_; | 2691 ZoneList<Property*>* properties_; |
2684 int end_position_; | 2692 int end_position_; |
2685 }; | 2693 }; |
2686 | 2694 |
2687 | 2695 |
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3547 | 3555 |
3548 private: | 3556 private: |
3549 Zone* zone_; | 3557 Zone* zone_; |
3550 AstValueFactory* ast_value_factory_; | 3558 AstValueFactory* ast_value_factory_; |
3551 }; | 3559 }; |
3552 | 3560 |
3553 | 3561 |
3554 } } // namespace v8::internal | 3562 } } // namespace v8::internal |
3555 | 3563 |
3556 #endif // V8_AST_H_ | 3564 #endif // V8_AST_H_ |
OLD | NEW |