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

Side by Side Diff: src/interpreter/bytecode-generator.h

Issue 2654423004: [async-functions] support await expressions in finally statements (Closed)
Patch Set: Get everything working (except possibly inspector tests) Created 3 years, 10 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
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_BYTECODE_GENERATOR_H_ 5 #ifndef V8_INTERPRETER_BYTECODE_GENERATOR_H_
6 #define V8_INTERPRETER_BYTECODE_GENERATOR_H_ 6 #define V8_INTERPRETER_BYTECODE_GENERATOR_H_
7 7
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/interpreter/bytecode-array-builder.h" 9 #include "src/interpreter/bytecode-array-builder.h"
10 #include "src/interpreter/bytecode-label.h" 10 #include "src/interpreter/bytecode-label.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 // register, or just getting the effect. 157 // register, or just getting the effect.
158 void VisitForAccumulatorValue(Expression* expr); 158 void VisitForAccumulatorValue(Expression* expr);
159 void VisitForAccumulatorValueOrTheHole(Expression* expr); 159 void VisitForAccumulatorValueOrTheHole(Expression* expr);
160 MUST_USE_RESULT Register VisitForRegisterValue(Expression* expr); 160 MUST_USE_RESULT Register VisitForRegisterValue(Expression* expr);
161 void VisitForRegisterValue(Expression* expr, Register destination); 161 void VisitForRegisterValue(Expression* expr, Register destination);
162 void VisitAndPushIntoRegisterList(Expression* expr, RegisterList* reg_list); 162 void VisitAndPushIntoRegisterList(Expression* expr, RegisterList* reg_list);
163 void VisitForEffect(Expression* expr); 163 void VisitForEffect(Expression* expr);
164 void VisitForTest(Expression* expr, BytecodeLabels* then_labels, 164 void VisitForTest(Expression* expr, BytecodeLabels* then_labels,
165 BytecodeLabels* else_labels, TestFallthrough fallthrough); 165 BytecodeLabels* else_labels, TestFallthrough fallthrough);
166 166
167 void BuildYield(int yield_id, Yield::OnException on_exception,
168 Yield::YieldType yield_type, Register value, int position);
169
170 void BuildTryCatch(HandlerTable::CatchPrediction catch_prediction,
171 std::function<void()> build_try,
172 std::function<void(Register context)> build_catch);
173 void BuildTryFinally(HandlerTable::CatchPrediction catch_prediction,
174 std::function<void()> build_try,
175 std::function<void()> build_finally);
176 void BuildTryCatchFinally(
177 HandlerTable::CatchPrediction outer_catch_prediction,
178 HandlerTable::CatchPrediction inner_catch_prediction,
179 std::function<void()> build_try,
180 std::function<void(Register context)> build_catch,
181 std::function<void()> build_finally);
182
183 // If FLAG_trace is enabled, invoke Runtime::kTraceExit with the return value
184 // in the accumulator. The return value is restored on exit.
185 void BuildTraceExit();
186
167 // Returns the runtime function id for a store to super for the function's 187 // Returns the runtime function id for a store to super for the function's
168 // language mode. 188 // language mode.
169 inline Runtime::FunctionId StoreToSuperRuntimeId(); 189 inline Runtime::FunctionId StoreToSuperRuntimeId();
170 inline Runtime::FunctionId StoreKeyedToSuperRuntimeId(); 190 inline Runtime::FunctionId StoreKeyedToSuperRuntimeId();
171 191
172 inline BytecodeArrayBuilder* builder() const { return builder_; } 192 inline BytecodeArrayBuilder* builder() const { return builder_; }
173 inline Zone* zone() const { return zone_; } 193 inline Zone* zone() const { return zone_; }
174 inline DeclarationScope* scope() const { return scope_; } 194 inline DeclarationScope* scope() const { return scope_; }
175 inline CompilationInfo* info() const { return info_; } 195 inline CompilationInfo* info() const { return info_; }
176 196
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 native_function_literals_; 232 native_function_literals_;
213 ZoneVector<std::pair<ObjectLiteral*, size_t>> object_literals_; 233 ZoneVector<std::pair<ObjectLiteral*, size_t>> object_literals_;
214 ZoneVector<std::pair<ArrayLiteral*, size_t>> array_literals_; 234 ZoneVector<std::pair<ArrayLiteral*, size_t>> array_literals_;
215 235
216 ControlScope* execution_control_; 236 ControlScope* execution_control_;
217 ContextScope* execution_context_; 237 ContextScope* execution_context_;
218 ExpressionResultScope* execution_result_; 238 ExpressionResultScope* execution_result_;
219 239
220 ZoneVector<BytecodeLabel> generator_resume_points_; 240 ZoneVector<BytecodeLabel> generator_resume_points_;
221 Register generator_state_; 241 Register generator_state_;
242 Register generator_object_;
243 Register promise_;
222 int loop_depth_; 244 int loop_depth_;
245 HandlerTable::CatchPrediction catch_prediction_;
223 246
224 Handle<Name> home_object_symbol_; 247 Handle<Name> home_object_symbol_;
225 Handle<Name> iterator_symbol_; 248 Handle<Name> iterator_symbol_;
226 Handle<Name> prototype_string_; 249 Handle<Name> prototype_string_;
227 Handle<FixedArray> empty_fixed_array_; 250 Handle<FixedArray> empty_fixed_array_;
228 const AstRawString* undefined_string_; 251 const AstRawString* undefined_string_;
229 }; 252 };
230 253
231 } // namespace interpreter 254 } // namespace interpreter
232 } // namespace internal 255 } // namespace internal
233 } // namespace v8 256 } // namespace v8
234 257
235 #endif // V8_INTERPRETER_BYTECODE_GENERATOR_H_ 258 #endif // V8_INTERPRETER_BYTECODE_GENERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698