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 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1148 | 1148 |
1149 TryFinallyStatement(Block* try_block, Block* finally_block, int pos) | 1149 TryFinallyStatement(Block* try_block, Block* finally_block, int pos) |
1150 : TryStatement(try_block, pos, kTryFinallyStatement), | 1150 : TryStatement(try_block, pos, kTryFinallyStatement), |
1151 finally_block_(finally_block) {} | 1151 finally_block_(finally_block) {} |
1152 | 1152 |
1153 Block* finally_block_; | 1153 Block* finally_block_; |
1154 }; | 1154 }; |
1155 | 1155 |
1156 | 1156 |
1157 class DebuggerStatement final : public Statement { | 1157 class DebuggerStatement final : public Statement { |
1158 public: | |
1159 void set_base_id(int id) { base_id_ = id; } | |
1160 static int num_ids() { return parent_num_ids() + 1; } | |
1161 BailoutId DebugBreakId() const { return BailoutId(local_id(0)); } | |
1162 | |
1163 private: | 1158 private: |
1164 friend class AstNodeFactory; | 1159 friend class AstNodeFactory; |
1165 | 1160 |
1166 explicit DebuggerStatement(int pos) | 1161 explicit DebuggerStatement(int pos) : Statement(pos, kDebuggerStatement) {} |
1167 : Statement(pos, kDebuggerStatement), | |
1168 base_id_(BailoutId::None().ToInt()) {} | |
1169 | |
1170 static int parent_num_ids() { return 0; } | |
1171 int base_id() const { | |
1172 DCHECK(!BailoutId(base_id_).IsNone()); | |
1173 return base_id_; | |
1174 } | |
1175 int local_id(int n) const { return base_id() + parent_num_ids() + n; } | |
1176 | |
1177 int base_id_; | |
1178 }; | 1162 }; |
1179 | 1163 |
1180 | 1164 |
1181 class EmptyStatement final : public Statement { | 1165 class EmptyStatement final : public Statement { |
1182 private: | 1166 private: |
1183 friend class AstNodeFactory; | 1167 friend class AstNodeFactory; |
1184 explicit EmptyStatement(int pos) : Statement(pos, kEmptyStatement) {} | 1168 explicit EmptyStatement(int pos) : Statement(pos, kEmptyStatement) {} |
1185 }; | 1169 }; |
1186 | 1170 |
1187 | 1171 |
(...skipping 2477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3665 : NULL; \ | 3649 : NULL; \ |
3666 } | 3650 } |
3667 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3651 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
3668 #undef DECLARE_NODE_FUNCTIONS | 3652 #undef DECLARE_NODE_FUNCTIONS |
3669 | 3653 |
3670 | 3654 |
3671 } // namespace internal | 3655 } // namespace internal |
3672 } // namespace v8 | 3656 } // namespace v8 |
3673 | 3657 |
3674 #endif // V8_AST_AST_H_ | 3658 #endif // V8_AST_AST_H_ |
OLD | NEW |