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/compiler/ast-graph-builder.h" | 8 #include "src/compiler/ast-graph-builder.h" |
9 #include "src/compiler/node.h" | 9 #include "src/compiler/node.h" |
10 | 10 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 Node* exception_node_; // Node for exception in 'catch' body. | 160 Node* exception_node_; // Node for exception in 'catch' body. |
161 }; | 161 }; |
162 | 162 |
163 | 163 |
164 // Tracks control flow for a try-finally statement. | 164 // Tracks control flow for a try-finally statement. |
165 class TryFinallyBuilder FINAL : public ControlBuilder { | 165 class TryFinallyBuilder FINAL : public ControlBuilder { |
166 public: | 166 public: |
167 explicit TryFinallyBuilder(AstGraphBuilder* builder) | 167 explicit TryFinallyBuilder(AstGraphBuilder* builder) |
168 : ControlBuilder(builder), | 168 : ControlBuilder(builder), |
169 finally_environment_(NULL), | 169 finally_environment_(NULL), |
170 token_node_(NULL) {} | 170 token_node_(NULL), |
| 171 value_node_(NULL) {} |
171 | 172 |
172 // Primitive control commands. | 173 // Primitive control commands. |
173 void BeginTry(); | 174 void BeginTry(); |
174 void LeaveTry(Node* token); | 175 void LeaveTry(Node* token, Node* value); |
175 void EndTry(Node* token); | 176 void EndTry(Node* token, Node* value); |
176 void EndFinally(); | 177 void EndFinally(); |
177 | 178 |
178 // Returns the dispatch token value inside the 'finally' body. | 179 // Returns the dispatch token value inside the 'finally' body. |
179 Node* GetDispatchTokenNode() const { return token_node_; } | 180 Node* GetDispatchTokenNode() const { return token_node_; } |
180 | 181 |
| 182 // Returns the saved result value inside the 'finally' body. |
| 183 Node* GetResultValueNode() const { return value_node_; } |
| 184 |
181 private: | 185 private: |
182 Environment* finally_environment_; // Environment for the 'finally' body. | 186 Environment* finally_environment_; // Environment for the 'finally' body. |
183 Node* token_node_; // Node for token in 'finally' body. | 187 Node* token_node_; // Node for token in 'finally' body. |
| 188 Node* value_node_; // Node for value in 'finally' body. |
184 }; | 189 }; |
185 | 190 |
186 } // namespace compiler | 191 } // namespace compiler |
187 } // namespace internal | 192 } // namespace internal |
188 } // namespace v8 | 193 } // namespace v8 |
189 | 194 |
190 #endif // V8_COMPILER_CONTROL_BUILDERS_H_ | 195 #endif // V8_COMPILER_CONTROL_BUILDERS_H_ |
OLD | NEW |