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

Unified Diff: src/interpreter/bytecode-generator.h

Issue 2664083002: [ignition] desugar async functions/generators/modules in BytecodeGenerator
Patch Set: make it a little easier to read 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 side-by-side diff with in-line comments
Download patch
Index: src/interpreter/bytecode-generator.h
diff --git a/src/interpreter/bytecode-generator.h b/src/interpreter/bytecode-generator.h
index f15829dea82514ca6f8fb7ebbebbcd16e3afdaa7..dc0141d4b32f9be8e8bdd1e1a450f3377802774e 100644
--- a/src/interpreter/bytecode-generator.h
+++ b/src/interpreter/bytecode-generator.h
@@ -53,6 +53,15 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
enum class TestFallthrough { kThen, kElse, kNone };
void GenerateBytecodeBody();
+ void GenerateBytecodeBodyForAsyncFunction();
+ void GenerateBytecodeBodyForGenerator();
+ void GenerateBytecodeBodyForModule();
+
+ enum class BuildJSGeneratorObject { kNoInitialYield, kInitialYield };
+ void BuildAllocateAndStoreJSGeneratorObject(BuildJSGeneratorObject tag);
+ void BuildAllocateAndStoreJSPromise();
+ void BindUnboundGeneratorResumePoints();
+
void AllocateDeferredConstants(Isolate* isolate);
DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
@@ -164,6 +173,16 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
void VisitForTest(Expression* expr, BytecodeLabels* then_labels,
BytecodeLabels* else_labels, TestFallthrough fallthrough);
+ void BuildYield(int yield_id, Register generator, Register value);
+ void BuildYieldResumePoint(int yield_id, Yield::OnException on_exception,
+ Register generator, int position);
+
+ void BuildTryCatch(HandlerTable::CatchPrediction catch_prediction,
+ std::function<void()> build_try,
+ std::function<void(Register context)> build_catch);
+ void BuildTryFinally(std::function<void()> build_try,
+ std::function<void()> build_finally);
+
// Returns the runtime function id for a store to super for the function's
// language mode.
inline Runtime::FunctionId StoreToSuperRuntimeId();
@@ -220,6 +239,7 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
ZoneVector<BytecodeLabel> generator_resume_points_;
Register generator_state_;
int loop_depth_;
+ HandlerTable::CatchPrediction catch_prediction_;
Handle<Name> home_object_symbol_;
Handle<Name> iterator_symbol_;

Powered by Google App Engine
This is Rietveld 408576698