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

Side by Side Diff: src/interpreter/control-flow-builders.h

Issue 1613443002: [interpreter] Implement handling of try-finally constructs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. Created 4 years, 11 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/interpreter/bytecode-generator.cc ('k') | src/interpreter/control-flow-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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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_INTERPRETER_CONTROL_FLOW_BUILDERS_H_ 5 #ifndef V8_INTERPRETER_CONTROL_FLOW_BUILDERS_H_
6 #define V8_INTERPRETER_CONTROL_FLOW_BUILDERS_H_ 6 #define V8_INTERPRETER_CONTROL_FLOW_BUILDERS_H_
7 7
8 #include "src/interpreter/bytecode-array-builder.h" 8 #include "src/interpreter/bytecode-array-builder.h"
9 9
10 #include "src/zone-containers.h" 10 #include "src/zone-containers.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 int handler_id_; 159 int handler_id_;
160 BytecodeLabel handler_; 160 BytecodeLabel handler_;
161 BytecodeLabel exit_; 161 BytecodeLabel exit_;
162 }; 162 };
163 163
164 164
165 // A class to help with co-ordinating control flow in try-finally statements. 165 // A class to help with co-ordinating control flow in try-finally statements.
166 class TryFinallyBuilder final : public ControlFlowBuilder { 166 class TryFinallyBuilder final : public ControlFlowBuilder {
167 public: 167 public:
168 explicit TryFinallyBuilder(BytecodeArrayBuilder* builder) 168 explicit TryFinallyBuilder(BytecodeArrayBuilder* builder)
169 : ControlFlowBuilder(builder), handler_id_(builder->NewHandlerEntry()) {} 169 : ControlFlowBuilder(builder),
170 handler_id_(builder->NewHandlerEntry()),
171 finalization_sites_(builder->zone()) {}
170 172
171 void BeginTry(Register context); 173 void BeginTry(Register context);
174 void LeaveTry();
172 void EndTry(); 175 void EndTry();
176 void BeginHandler();
177 void BeginFinally();
173 void EndFinally(); 178 void EndFinally();
174 179
175 private: 180 private:
176 int handler_id_; 181 int handler_id_;
177 BytecodeLabel handler_; 182 BytecodeLabel handler_;
183
184 // Unbound labels that identify jumps to the finally block in the code.
185 ZoneVector<BytecodeLabel> finalization_sites_;
178 }; 186 };
179 187
180 } // namespace interpreter 188 } // namespace interpreter
181 } // namespace internal 189 } // namespace internal
182 } // namespace v8 190 } // namespace v8
183 191
184 #endif // V8_INTERPRETER_CONTROL_FLOW_BUILDERS_H_ 192 #endif // V8_INTERPRETER_CONTROL_FLOW_BUILDERS_H_
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/interpreter/control-flow-builders.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698