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

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

Issue 1607433005: [interpreter] Implement exception handler table building. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added moar tests. 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 // This method is called when all cases comparisons have been emitted if there 137 // This method is called when all cases comparisons have been emitted if there
138 // is a default case statement. Inserts a Jump to a unbound label that is 138 // is a default case statement. Inserts a Jump to a unbound label that is
139 // patched when the corresponding SetCaseTarget is called. 139 // patched when the corresponding SetCaseTarget is called.
140 void DefaultAt(int index) { EmitJump(&case_sites_, index); } 140 void DefaultAt(int index) { EmitJump(&case_sites_, index); }
141 141
142 private: 142 private:
143 // Unbound labels that identify jumps for case statements in the code. 143 // Unbound labels that identify jumps for case statements in the code.
144 ZoneVector<BytecodeLabel> case_sites_; 144 ZoneVector<BytecodeLabel> case_sites_;
145 }; 145 };
146 146
147
148 // A class to help with co-ordinating control flow in try-catch statements.
149 class TryCatchBuilder final : public ControlFlowBuilder {
150 public:
151 explicit TryCatchBuilder(BytecodeArrayBuilder* builder)
152 : ControlFlowBuilder(builder), handler_id_(builder->NewHandlerEntry()) {}
153
154 void BeginTry(Register context);
155 void EndTry();
156 void EndCatch();
157
158 private:
159 int handler_id_;
160 BytecodeLabel handler_;
161 BytecodeLabel exit_;
162 };
163
164
165 // A class to help with co-ordinating control flow in try-finally statements.
166 class TryFinallyBuilder final : public ControlFlowBuilder {
167 public:
168 explicit TryFinallyBuilder(BytecodeArrayBuilder* builder)
169 : ControlFlowBuilder(builder), handler_id_(builder->NewHandlerEntry()) {}
170
171 void BeginTry(Register context);
172 void EndTry();
173 void EndFinally();
174
175 private:
176 int handler_id_;
177 BytecodeLabel handler_;
178 };
179
147 } // namespace interpreter 180 } // namespace interpreter
148 } // namespace internal 181 } // namespace internal
149 } // namespace v8 182 } // namespace v8
150 183
151 #endif // V8_INTERPRETER_CONTROL_FLOW_BUILDERS_H_ 184 #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