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

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

Issue 2664083002: [ignition] desugar async functions/generators/modules in BytecodeGenerator
Patch Set: get rid of lambdas, for better or worse.. 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..970a13a47a0cc64de05a1f9d05955e72b0682e7b 100644
--- a/src/interpreter/bytecode-generator.h
+++ b/src/interpreter/bytecode-generator.h
@@ -49,10 +49,32 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
class RegisterAllocationScope;
class TestResultScope;
class ValueResultScope;
+ class SimpleTryCatchBuilder;
+ class SimpleTryFinallyBuilder;
+
+ template <class T>
+ class TryBlockBuilder;
+ typedef TryBlockBuilder<SimpleTryCatchBuilder> TryBlockBuilderForCatch;
+ typedef TryBlockBuilder<SimpleTryFinallyBuilder> TryBlockBuilderForFinally;
+ class CatchBlockBuilder;
+ class FinallyBlockBuilder;
+
+ friend class SimpleTryCatchBuilder;
+ friend class SimpleTryFinallyBuilder;
enum class TestFallthrough { kThen, kElse, kNone };
void GenerateBytecodeBody();
+ void GenerateBytecodeBodyForAsyncFunction(FunctionLiteral* literal);
+ void GenerateBytecodeBodyForGenerator(FunctionLiteral* literal);
+ void GenerateBytecodeBodyForModule(FunctionLiteral* literal);
+
+ enum class BuildJSGeneratorObject { kNoInitialYield, kInitialYield };
+ void BuildAllocateAndStoreJSGeneratorObject(FunctionLiteral* literal,
+ BuildJSGeneratorObject tag);
+ void BuildAllocateAndStoreJSPromise();
+ void BindUnboundGeneratorResumePoints();
+
void AllocateDeferredConstants(Isolate* isolate);
DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
@@ -164,6 +186,10 @@ 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);
+
// Returns the runtime function id for a store to super for the function's
// language mode.
inline Runtime::FunctionId StoreToSuperRuntimeId();
@@ -220,6 +246,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