Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: src/compiler/control-builders.h

Issue 970253002: [turbofan] Fix exception being re-thrown after finally-block. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Sneak in alpha sorting. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/compiler/control-builders.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/compiler/control-builders.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698