| 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 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1139 | 1139 |
| 1140 TryFinallyStatement(Block* try_block, Block* finally_block, int pos) | 1140 TryFinallyStatement(Block* try_block, Block* finally_block, int pos) |
| 1141 : TryStatement(try_block, pos, kTryFinallyStatement), | 1141 : TryStatement(try_block, pos, kTryFinallyStatement), |
| 1142 finally_block_(finally_block) {} | 1142 finally_block_(finally_block) {} |
| 1143 | 1143 |
| 1144 Block* finally_block_; | 1144 Block* finally_block_; |
| 1145 }; | 1145 }; |
| 1146 | 1146 |
| 1147 | 1147 |
| 1148 class DebuggerStatement final : public Statement { | 1148 class DebuggerStatement final : public Statement { |
| 1149 public: |
| 1150 void set_base_id(int id) { base_id_ = id; } |
| 1151 static int num_ids() { return parent_num_ids() + 1; } |
| 1152 BailoutId DebugBreakId() const { return BailoutId(local_id(0)); } |
| 1153 |
| 1149 private: | 1154 private: |
| 1150 friend class AstNodeFactory; | 1155 friend class AstNodeFactory; |
| 1151 | 1156 |
| 1152 explicit DebuggerStatement(int pos) : Statement(pos, kDebuggerStatement) {} | 1157 explicit DebuggerStatement(int pos) |
| 1158 : Statement(pos, kDebuggerStatement), |
| 1159 base_id_(BailoutId::None().ToInt()) {} |
| 1160 |
| 1161 static int parent_num_ids() { return 0; } |
| 1162 int base_id() const { |
| 1163 DCHECK(!BailoutId(base_id_).IsNone()); |
| 1164 return base_id_; |
| 1165 } |
| 1166 int local_id(int n) const { return base_id() + parent_num_ids() + n; } |
| 1167 |
| 1168 int base_id_; |
| 1153 }; | 1169 }; |
| 1154 | 1170 |
| 1155 | 1171 |
| 1156 class EmptyStatement final : public Statement { | 1172 class EmptyStatement final : public Statement { |
| 1157 private: | 1173 private: |
| 1158 friend class AstNodeFactory; | 1174 friend class AstNodeFactory; |
| 1159 explicit EmptyStatement(int pos) : Statement(pos, kEmptyStatement) {} | 1175 explicit EmptyStatement(int pos) : Statement(pos, kEmptyStatement) {} |
| 1160 }; | 1176 }; |
| 1161 | 1177 |
| 1162 | 1178 |
| (...skipping 2460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3623 : NULL; \ | 3639 : NULL; \ |
| 3624 } | 3640 } |
| 3625 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3641 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
| 3626 #undef DECLARE_NODE_FUNCTIONS | 3642 #undef DECLARE_NODE_FUNCTIONS |
| 3627 | 3643 |
| 3628 | 3644 |
| 3629 } // namespace internal | 3645 } // namespace internal |
| 3630 } // namespace v8 | 3646 } // namespace v8 |
| 3631 | 3647 |
| 3632 #endif // V8_AST_AST_H_ | 3648 #endif // V8_AST_AST_H_ |
| OLD | NEW |