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

Unified Diff: src/builtins/builtins.h

Issue 2622833002: WIP [esnext] implement async iteration proposal (Closed)
Patch Set: simplify AsyncIteratorValueUnwrap Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/bootstrapper.cc ('k') | src/builtins/builtins-async.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/bootstrapper.cc ('k') | src/builtins/builtins-async.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698