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-types.h" | 8 #include "src/ast/ast-types.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 1636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1647 | 1647 |
1648 static int num_ids() { return parent_num_ids() + 1; } | 1648 static int num_ids() { return parent_num_ids() + 1; } |
1649 BailoutId BeforeId() const { return BailoutId(local_id(0)); } | 1649 BailoutId BeforeId() const { return BailoutId(local_id(0)); } |
1650 void set_next_unresolved(VariableProxy* next) { next_unresolved_ = next; } | 1650 void set_next_unresolved(VariableProxy* next) { next_unresolved_ = next; } |
1651 VariableProxy* next_unresolved() { return next_unresolved_; } | 1651 VariableProxy* next_unresolved() { return next_unresolved_; } |
1652 | 1652 |
1653 private: | 1653 private: |
1654 friend class AstNodeFactory; | 1654 friend class AstNodeFactory; |
1655 | 1655 |
1656 VariableProxy(Variable* var, int start_position, int end_position); | 1656 VariableProxy(Variable* var, int start_position, int end_position); |
1657 VariableProxy(const AstRawString* name, Variable::Kind variable_kind, | 1657 VariableProxy(const AstRawString* name, VariableKind variable_kind, |
1658 int start_position, int end_position); | 1658 int start_position, int end_position); |
1659 explicit VariableProxy(const VariableProxy* copy_from); | 1659 explicit VariableProxy(const VariableProxy* copy_from); |
1660 | 1660 |
1661 static int parent_num_ids() { return Expression::num_ids(); } | 1661 static int parent_num_ids() { return Expression::num_ids(); } |
1662 int local_id(int n) const { return base_id() + parent_num_ids() + n; } | 1662 int local_id(int n) const { return base_id() + parent_num_ids() + n; } |
1663 | 1663 |
1664 class IsThisField : public BitField8<bool, 0, 1> {}; | 1664 class IsThisField : public BitField8<bool, 0, 1> {}; |
1665 class IsAssignedField : public BitField8<bool, 1, 1> {}; | 1665 class IsAssignedField : public BitField8<bool, 1, 1> {}; |
1666 class IsResolvedField : public BitField8<bool, 2, 1> {}; | 1666 class IsResolvedField : public BitField8<bool, 2, 1> {}; |
1667 class IsNewTargetField : public BitField8<bool, 3, 1> {}; | 1667 class IsNewTargetField : public BitField8<bool, 3, 1> {}; |
(...skipping 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3240 ArrayLiteral(values, first_spread_index, literal_index, pos); | 3240 ArrayLiteral(values, first_spread_index, literal_index, pos); |
3241 } | 3241 } |
3242 | 3242 |
3243 VariableProxy* NewVariableProxy(Variable* var, | 3243 VariableProxy* NewVariableProxy(Variable* var, |
3244 int start_position = kNoSourcePosition, | 3244 int start_position = kNoSourcePosition, |
3245 int end_position = kNoSourcePosition) { | 3245 int end_position = kNoSourcePosition) { |
3246 return new (zone_) VariableProxy(var, start_position, end_position); | 3246 return new (zone_) VariableProxy(var, start_position, end_position); |
3247 } | 3247 } |
3248 | 3248 |
3249 VariableProxy* NewVariableProxy(const AstRawString* name, | 3249 VariableProxy* NewVariableProxy(const AstRawString* name, |
3250 Variable::Kind variable_kind, | 3250 VariableKind variable_kind, |
3251 int start_position = kNoSourcePosition, | 3251 int start_position = kNoSourcePosition, |
3252 int end_position = kNoSourcePosition) { | 3252 int end_position = kNoSourcePosition) { |
3253 DCHECK_NOT_NULL(name); | 3253 DCHECK_NOT_NULL(name); |
3254 return new (zone_) | 3254 return new (zone_) |
3255 VariableProxy(name, variable_kind, start_position, end_position); | 3255 VariableProxy(name, variable_kind, start_position, end_position); |
3256 } | 3256 } |
3257 | 3257 |
3258 // Recreates the VariableProxy in this Zone. | 3258 // Recreates the VariableProxy in this Zone. |
3259 VariableProxy* CopyVariableProxy(VariableProxy* proxy) { | 3259 VariableProxy* CopyVariableProxy(VariableProxy* proxy) { |
3260 return new (zone_) VariableProxy(proxy); | 3260 return new (zone_) VariableProxy(proxy); |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3503 : NULL; \ | 3503 : NULL; \ |
3504 } | 3504 } |
3505 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3505 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
3506 #undef DECLARE_NODE_FUNCTIONS | 3506 #undef DECLARE_NODE_FUNCTIONS |
3507 | 3507 |
3508 | 3508 |
3509 } // namespace internal | 3509 } // namespace internal |
3510 } // namespace v8 | 3510 } // namespace v8 |
3511 | 3511 |
3512 #endif // V8_AST_AST_H_ | 3512 #endif // V8_AST_AST_H_ |
OLD | NEW |