Index: src/builtins/builtins.h |
diff --git a/src/builtins/builtins.h b/src/builtins/builtins.h |
index dcff15068f83275b86dea74085b89feff6cda0c2..692f3c215217197d0273fa6863b80a618c1f9c0b 100644 |
--- a/src/builtins/builtins.h |
+++ b/src/builtins/builtins.h |
@@ -119,6 +119,7 @@ namespace internal { |
ASM(JSEntryTrampoline) \ |
ASM(JSConstructEntryTrampoline) \ |
ASM(ResumeGeneratorTrampoline) \ |
+ ASM(ResumeAwaitedGeneratorTrampoline) \ |
\ |
/* Stack and interrupt check */ \ |
ASM(InterruptCheck) \ |
@@ -771,7 +772,46 @@ namespace internal { |
/* ES6 #sec-%typedarray%.prototype.keys */ \ |
TFJ(TypedArrayPrototypeKeys, 0) \ |
/* ES6 #sec-%typedarray%.prototype.values */ \ |
- TFJ(TypedArrayPrototypeValues, 0) |
+ TFJ(TypedArrayPrototypeValues, 0) \ |
+ \ |
+ /* AsyncGenerator builtins */ \ |
+ \ |
+ /* AsyncGeneratorFunction( p1, p2, ... pn, body ) */ \ |
+ /* proposal-async-iteration/#sec-asyncgeneratorfunction-constructor */ \ |
+ CPP(AsyncGeneratorFunctionConstructor) \ |
+ /* AsyncGenerator.prototype.next ( value ) */ \ |
+ /* proposal-async-iteration/#sec-asyncgenerator-prototype-next */ \ |
+ TFJ(AsyncGeneratorPrototypeNext, 1) \ |
+ /* AsyncGenerator.prototype.return ( value ) */ \ |
+ /* proposal-async-iteration/#sec-asyncgenerator-prototype-return */ \ |
+ TFJ(AsyncGeneratorPrototypeReturn, 1) \ |
+ /* AsyncGenerator.prototype.throw ( exception ) */ \ |
+ /* proposal-async-iteration/#sec-asyncgenerator-prototype-throw */ \ |
+ TFJ(AsyncGeneratorPrototypeThrow, 1) \ |
+ \ |
+ /* Await (proposal-async-iteration/#await), with resume behaviour */ \ |
+ /* specific to Async Generators. Internal / Not exposed to JS code. */ \ |
+ TFJ(AsyncGeneratorAwaitCaught, 2) \ |
+ TFJ(AsyncGeneratorAwaitUncaught, 2) \ |
+ TFJ(AsyncGeneratorAwaitResolveClosure, 1) \ |
+ TFJ(AsyncGeneratorAwaitRejectClosure, 1) \ |
+ \ |
+ /* GeneratorYield (proposal-async-iteration/#sec-generatoryield) with */ \ |
+ /* resume behaviour specific to Async Generators. Internal / not exposed */ \ |
+ /* to JS code. */ \ |
+ TFJ(AsyncGeneratorYield, 1) \ |
+ TFJ(AsyncGeneratorRawYield, 1) \ |
+ \ |
+ /* Async-from-Sync Iterator builtins */ \ |
+ \ |
+ /* %AsyncFromSyncIteratorPrototype% */ \ |
+ /* (proposal-async-iteration/#sec-%asyncfromsynciteratorprototype%-object)*/ \ |
+ TFJ(AsyncFromSyncIteratorPrototypeNext, 1) \ |
+ TFJ(AsyncFromSyncIteratorPrototypeThrow, 1) \ |
+ TFJ(AsyncFromSyncIteratorPrototypeReturn, 1) \ |
+ \ |
+ /* proposal-async-iteration/#sec-async-iterator-value-unwrap-functions */ \ |
+ TFJ(AsyncIteratorValueUnwrap, 1) |
#define IGNORE_BUILTIN(...) |
@@ -895,6 +935,13 @@ class Builtins { |
static void Generate_InterpreterPushArgsAndConstructImpl( |
MacroAssembler* masm, CallableType function_type); |
+ enum class ResumeGeneratorType { |
+ kYield, // Resume generator after Yield |
+ kAwait // Resume async generator after Await |
+ }; |
+ static void Generate_ResumeGenerator(MacroAssembler* masm, |
+ ResumeGeneratorType type); |
+ |
enum class MathMaxMinKind { kMax, kMin }; |
static void Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind); |