OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_COMPILER_CONTROL_BUILDERS_H_ | 5 #ifndef V8_COMPILER_CONTROL_BUILDERS_H_ |
6 #define V8_COMPILER_CONTROL_BUILDERS_H_ | 6 #define V8_COMPILER_CONTROL_BUILDERS_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/compiler/ast-graph-builder.h" | 10 #include "src/compiler/ast-graph-builder.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 // Interface for break. | 25 // Interface for break. |
26 virtual void Break() { UNREACHABLE(); } | 26 virtual void Break() { UNREACHABLE(); } |
27 | 27 |
28 protected: | 28 protected: |
29 typedef AstGraphBuilder Builder; | 29 typedef AstGraphBuilder Builder; |
30 typedef AstGraphBuilder::Environment Environment; | 30 typedef AstGraphBuilder::Environment Environment; |
31 | 31 |
32 Zone* zone() const { return builder_->local_zone(); } | 32 Zone* zone() const { return builder_->local_zone(); } |
33 Environment* environment() { return builder_->environment(); } | 33 Environment* environment() { return builder_->environment(); } |
34 void set_environment(Environment* env) { builder_->set_environment(env); } | 34 void set_environment(Environment* env) { builder_->set_environment(env); } |
| 35 Node* the_hole() const { return builder_->jsgraph()->TheHoleConstant(); } |
35 | 36 |
36 Builder* builder_; | 37 Builder* builder_; |
37 }; | 38 }; |
38 | 39 |
39 | 40 |
40 // Tracks control flow for a conditional statement. | 41 // Tracks control flow for a conditional statement. |
41 class IfBuilder FINAL : public ControlBuilder { | 42 class IfBuilder FINAL : public ControlBuilder { |
42 public: | 43 public: |
43 explicit IfBuilder(AstGraphBuilder* builder) | 44 explicit IfBuilder(AstGraphBuilder* builder) |
44 : ControlBuilder(builder), | 45 : ControlBuilder(builder), |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 private: | 183 private: |
183 Environment* finally_environment_; // Environment for the 'finally' body. | 184 Environment* finally_environment_; // Environment for the 'finally' body. |
184 Node* token_node_; // Node for token in 'finally' body. | 185 Node* token_node_; // Node for token in 'finally' body. |
185 }; | 186 }; |
186 | 187 |
187 } // namespace compiler | 188 } // namespace compiler |
188 } // namespace internal | 189 } // namespace internal |
189 } // namespace v8 | 190 } // namespace v8 |
190 | 191 |
191 #endif // V8_COMPILER_CONTROL_BUILDERS_H_ | 192 #endif // V8_COMPILER_CONTROL_BUILDERS_H_ |
OLD | NEW |