Skip to content

Commit d97bb31

Browse files
bmeurerCommit Bot
authored andcommitted
[async-await] Turn await closures into intrinsics.
There's no need to have the AsyncFunctionAwait/AsyncGeneratorAwait operations as separate closures that are called via JavaScript calling convention, but instead we can just have them as intrinsics (with the goal to eventually turn them into IC stubs). Drive-by-fix: Tail call to the ResumeGenerator builtin when resuming an async function. The earlier restrictions no only apply with the new machinery. Bug: v8:7253 Change-Id: I0c4d04dae15b4211158fc07151adafda69d4faec Reviewed-on: https://chromium-review.googlesource.com/924703 Reviewed-by: Yang Guo <[email protected]> Commit-Queue: Benedikt Meurer <[email protected]> Cr-Commit-Position: refs/heads/master@{#51382}
1 parent 99fcd7b commit d97bb31

16 files changed

Lines changed: 166 additions & 118 deletions

src/bootstrapper.cc

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,18 +1605,6 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
16051605
native_context()->set_async_iterator_value_unwrap_shared_fun(*info);
16061606
}
16071607

1608-
{ // --- A s y n c G e n e r a t o r ---
1609-
Handle<JSFunction> await_caught =
1610-
SimpleCreateFunction(isolate, factory->empty_string(),
1611-
Builtins::kAsyncGeneratorAwaitCaught, 1, false);
1612-
native_context()->set_async_generator_await_caught(*await_caught);
1613-
1614-
Handle<JSFunction> await_uncaught =
1615-
SimpleCreateFunction(isolate, factory->empty_string(),
1616-
Builtins::kAsyncGeneratorAwaitUncaught, 1, false);
1617-
native_context()->set_async_generator_await_uncaught(*await_uncaught);
1618-
}
1619-
16201608
{ // --- A r r a y ---
16211609
Handle<JSFunction> array_function = InstallFunction(
16221610
global, "Array", JS_ARRAY_TYPE, JSArray::kSize, 0,
@@ -4124,20 +4112,6 @@ void Bootstrapper::ExportFromRuntime(Isolate* isolate,
41244112
JSFunction::SetPrototype(async_function_constructor,
41254113
async_function_prototype);
41264114

4127-
{
4128-
Handle<JSFunction> function =
4129-
SimpleCreateFunction(isolate, factory->empty_string(),
4130-
Builtins::kAsyncFunctionAwaitCaught, 2, false);
4131-
native_context->set_async_function_await_caught(*function);
4132-
}
4133-
4134-
{
4135-
Handle<JSFunction> function =
4136-
SimpleCreateFunction(isolate, factory->empty_string(),
4137-
Builtins::kAsyncFunctionAwaitUncaught, 2, false);
4138-
native_context->set_async_function_await_uncaught(*function);
4139-
}
4140-
41414115
{
41424116
Handle<JSFunction> function =
41434117
SimpleCreateFunction(isolate, factory->empty_string(),

src/builtins/builtins-async-function-gen.cc

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,7 @@ void AsyncFunctionBuiltinsAssembler::AsyncFunctionAwaitResume(
4747

4848
// Resume the {receiver} using our trampoline.
4949
Callable callable = CodeFactory::ResumeGenerator(isolate());
50-
CallStub(callable, context, argument, generator);
51-
52-
// The resulting Promise is a throwaway, so it doesn't matter what it
53-
// resolves to. What is important is that we don't end up keeping the
54-
// whole chain of intermediate Promises alive by returning the return value
55-
// of ResumeGenerator, as that would create a memory leak.
50+
TailCallStub(callable, context, argument, generator);
5651
}
5752

5853
TF_BUILTIN(AsyncFunctionAwaitFulfill, AsyncFunctionBuiltinsAssembler) {
@@ -61,7 +56,6 @@ TF_BUILTIN(AsyncFunctionAwaitFulfill, AsyncFunctionBuiltinsAssembler) {
6156
Node* const context = Parameter(Descriptor::kContext);
6257
AsyncFunctionAwaitResume(context, argument, generator,
6358
JSGeneratorObject::kNext);
64-
Return(UndefinedConstant());
6559
}
6660

6761
TF_BUILTIN(AsyncFunctionAwaitReject, AsyncFunctionBuiltinsAssembler) {
@@ -70,7 +64,6 @@ TF_BUILTIN(AsyncFunctionAwaitReject, AsyncFunctionBuiltinsAssembler) {
7064
Node* const context = Parameter(Descriptor::kContext);
7165
AsyncFunctionAwaitResume(context, argument, generator,
7266
JSGeneratorObject::kThrow);
73-
Return(UndefinedConstant());
7467
}
7568

7669
// ES#abstract-ops-async-function-await
@@ -100,30 +93,28 @@ void AsyncFunctionBuiltinsAssembler::AsyncFunctionAwait(
10093
// Called by the parser from the desugaring of 'await' when catch
10194
// prediction indicates that there is a locally surrounding catch block.
10295
TF_BUILTIN(AsyncFunctionAwaitCaught, AsyncFunctionBuiltinsAssembler) {
103-
CSA_ASSERT_JS_ARGC_EQ(this, 3);
10496
Node* const generator = Parameter(Descriptor::kGenerator);
105-
Node* const awaited = Parameter(Descriptor::kAwaited);
97+
Node* const value = Parameter(Descriptor::kValue);
10698
Node* const outer_promise = Parameter(Descriptor::kOuterPromise);
10799
Node* const context = Parameter(Descriptor::kContext);
108100

109101
static const bool kIsPredictedAsCaught = true;
110102

111-
AsyncFunctionAwait(context, generator, awaited, outer_promise,
103+
AsyncFunctionAwait(context, generator, value, outer_promise,
112104
kIsPredictedAsCaught);
113105
}
114106

115107
// Called by the parser from the desugaring of 'await' when catch
116108
// prediction indicates no locally surrounding catch block.
117109
TF_BUILTIN(AsyncFunctionAwaitUncaught, AsyncFunctionBuiltinsAssembler) {
118-
CSA_ASSERT_JS_ARGC_EQ(this, 3);
119110
Node* const generator = Parameter(Descriptor::kGenerator);
120-
Node* const awaited = Parameter(Descriptor::kAwaited);
111+
Node* const value = Parameter(Descriptor::kValue);
121112
Node* const outer_promise = Parameter(Descriptor::kOuterPromise);
122113
Node* const context = Parameter(Descriptor::kContext);
123114

124115
static const bool kIsPredictedAsCaught = false;
125116

126-
AsyncFunctionAwait(context, generator, awaited, outer_promise,
117+
AsyncFunctionAwait(context, generator, value, outer_promise,
127118
kIsPredictedAsCaught);
128119
}
129120

src/builtins/builtins-async-generator-gen.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,9 @@ void AsyncGeneratorBuiltinsAssembler::AsyncGeneratorAwaitResume(
241241

242242
template <typename Descriptor>
243243
void AsyncGeneratorBuiltinsAssembler::AsyncGeneratorAwait(bool is_catchable) {
244-
Node* generator = Parameter(Descriptor::kGenerator);
245-
Node* value = Parameter(Descriptor::kAwaited);
246-
Node* context = Parameter(Descriptor::kContext);
244+
Node* const generator = Parameter(Descriptor::kGenerator);
245+
Node* const value = Parameter(Descriptor::kValue);
246+
Node* const context = Parameter(Descriptor::kContext);
247247

248248
CSA_SLOW_ASSERT(this, TaggedIsAsyncGenerator(generator));
249249

src/builtins/builtins-definitions.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,8 @@ namespace internal {
367367
/* AsyncFunction */ \
368368
TFC(AsyncFunctionAwaitFulfill, PromiseReactionHandler, 1) \
369369
TFC(AsyncFunctionAwaitReject, PromiseReactionHandler, 1) \
370-
TFJ(AsyncFunctionAwaitCaught, 3, kGenerator, kAwaited, kOuterPromise) \
371-
TFJ(AsyncFunctionAwaitUncaught, 3, kGenerator, kAwaited, kOuterPromise) \
370+
TFS(AsyncFunctionAwaitCaught, kGenerator, kValue, kOuterPromise) \
371+
TFS(AsyncFunctionAwaitUncaught, kGenerator, kValue, kOuterPromise) \
372372
TFJ(AsyncFunctionPromiseCreate, 0) \
373373
TFJ(AsyncFunctionPromiseRelease, 1, kPromise) \
374374
\
@@ -1178,8 +1178,8 @@ namespace internal {
11781178
\
11791179
/* Await (proposal-async-iteration/#await), with resume behaviour */ \
11801180
/* specific to Async Generators. Internal / Not exposed to JS code. */ \
1181-
TFJ(AsyncGeneratorAwaitCaught, 2, kGenerator, kAwaited) \
1182-
TFJ(AsyncGeneratorAwaitUncaught, 2, kGenerator, kAwaited) \
1181+
TFS(AsyncGeneratorAwaitCaught, kGenerator, kValue) \
1182+
TFS(AsyncGeneratorAwaitUncaught, kGenerator, kValue) \
11831183
TFC(AsyncGeneratorAwaitFulfill, PromiseReactionHandler, 1) \
11841184
TFC(AsyncGeneratorAwaitReject, PromiseReactionHandler, 1) \
11851185
TFC(AsyncGeneratorYieldFulfill, PromiseReactionHandler, 1) \
@@ -1257,11 +1257,7 @@ namespace internal {
12571257
V(AsyncFromSyncIteratorPrototypeNext) \
12581258
V(AsyncFromSyncIteratorPrototypeReturn) \
12591259
V(AsyncFromSyncIteratorPrototypeThrow) \
1260-
V(AsyncFunctionAwaitCaught) \
1261-
V(AsyncFunctionAwaitUncaught) \
12621260
V(AsyncGeneratorResolve) \
1263-
V(AsyncGeneratorAwaitCaught) \
1264-
V(AsyncGeneratorAwaitUncaught) \
12651261
V(PromiseAll) \
12661262
V(PromiseConstructor) \
12671263
V(PromiseFulfillReactionJob) \

src/compiler/js-intrinsic-lowering.cc

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
4141
return ReduceCreateJSGeneratorObject(node);
4242
case Runtime::kInlineGeneratorGetInputOrDebugPos:
4343
return ReduceGeneratorGetInputOrDebugPos(node);
44+
case Runtime::kInlineAsyncFunctionAwaitCaught:
45+
return ReduceAsyncFunctionAwaitCaught(node);
46+
case Runtime::kInlineAsyncFunctionAwaitUncaught:
47+
return ReduceAsyncFunctionAwaitUncaught(node);
48+
case Runtime::kInlineAsyncGeneratorAwaitCaught:
49+
return ReduceAsyncGeneratorAwaitCaught(node);
50+
case Runtime::kInlineAsyncGeneratorAwaitUncaught:
51+
return ReduceAsyncGeneratorAwaitUncaught(node);
4452
case Runtime::kInlineAsyncGeneratorReject:
4553
return ReduceAsyncGeneratorReject(node);
4654
case Runtime::kInlineAsyncGeneratorResolve:
@@ -177,6 +185,33 @@ Reduction JSIntrinsicLowering::ReduceGeneratorGetInputOrDebugPos(Node* node) {
177185
return Change(node, op, generator, effect, control);
178186
}
179187

188+
Reduction JSIntrinsicLowering::ReduceAsyncFunctionAwaitCaught(Node* node) {
189+
return Change(
190+
node,
191+
Builtins::CallableFor(isolate(), Builtins::kAsyncFunctionAwaitCaught), 0);
192+
}
193+
194+
Reduction JSIntrinsicLowering::ReduceAsyncFunctionAwaitUncaught(Node* node) {
195+
return Change(
196+
node,
197+
Builtins::CallableFor(isolate(), Builtins::kAsyncFunctionAwaitUncaught),
198+
0);
199+
}
200+
201+
Reduction JSIntrinsicLowering::ReduceAsyncGeneratorAwaitCaught(Node* node) {
202+
return Change(
203+
node,
204+
Builtins::CallableFor(isolate(), Builtins::kAsyncGeneratorAwaitCaught),
205+
0);
206+
}
207+
208+
Reduction JSIntrinsicLowering::ReduceAsyncGeneratorAwaitUncaught(Node* node) {
209+
return Change(
210+
node,
211+
Builtins::CallableFor(isolate(), Builtins::kAsyncGeneratorAwaitUncaught),
212+
0);
213+
}
214+
180215
Reduction JSIntrinsicLowering::ReduceAsyncGeneratorReject(Node* node) {
181216
return Change(
182217
node, Builtins::CallableFor(isolate(), Builtins::kAsyncGeneratorReject),

src/compiler/js-intrinsic-lowering.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ class V8_EXPORT_PRIVATE JSIntrinsicLowering final
4545
Reduction ReduceCreateJSGeneratorObject(Node* node);
4646
Reduction ReduceGeneratorClose(Node* node);
4747
Reduction ReduceGeneratorGetInputOrDebugPos(Node* node);
48+
Reduction ReduceAsyncFunctionAwaitCaught(Node* node);
49+
Reduction ReduceAsyncFunctionAwaitUncaught(Node* node);
50+
Reduction ReduceAsyncGeneratorAwaitCaught(Node* node);
51+
Reduction ReduceAsyncGeneratorAwaitUncaught(Node* node);
4852
Reduction ReduceAsyncGeneratorReject(Node* node);
4953
Reduction ReduceAsyncGeneratorResolve(Node* node);
5054
Reduction ReduceAsyncGeneratorYield(Node* node);

src/contexts.h

Lines changed: 34 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -32,46 +32,40 @@ enum ContextLookupFlags {
3232
// must always be allocated via Heap::AllocateContext() or
3333
// Factory::NewContext.
3434

35-
#define NATIVE_CONTEXT_INTRINSIC_FUNCTIONS(V) \
36-
V(ASYNC_FUNCTION_AWAIT_CAUGHT_INDEX, JSFunction, \
37-
async_function_await_caught) \
38-
V(ASYNC_FUNCTION_AWAIT_UNCAUGHT_INDEX, JSFunction, \
39-
async_function_await_uncaught) \
40-
V(ASYNC_FUNCTION_PROMISE_CREATE_INDEX, JSFunction, \
41-
async_function_promise_create) \
42-
V(ASYNC_FUNCTION_PROMISE_RELEASE_INDEX, JSFunction, \
43-
async_function_promise_release) \
44-
V(IS_ARRAYLIKE, JSFunction, is_arraylike) \
45-
V(GENERATOR_NEXT_INTERNAL, JSFunction, generator_next_internal) \
46-
V(MAKE_ERROR_INDEX, JSFunction, make_error) \
47-
V(MAKE_RANGE_ERROR_INDEX, JSFunction, make_range_error) \
48-
V(MAKE_SYNTAX_ERROR_INDEX, JSFunction, make_syntax_error) \
49-
V(MAKE_TYPE_ERROR_INDEX, JSFunction, make_type_error) \
50-
V(MAKE_URI_ERROR_INDEX, JSFunction, make_uri_error) \
51-
V(OBJECT_CREATE, JSFunction, object_create) \
52-
V(OBJECT_DEFINE_PROPERTIES, JSFunction, object_define_properties) \
53-
V(OBJECT_DEFINE_PROPERTY, JSFunction, object_define_property) \
54-
V(OBJECT_GET_PROTOTYPE_OF, JSFunction, object_get_prototype_of) \
55-
V(OBJECT_IS_EXTENSIBLE, JSFunction, object_is_extensible) \
56-
V(OBJECT_IS_FROZEN, JSFunction, object_is_frozen) \
57-
V(OBJECT_IS_SEALED, JSFunction, object_is_sealed) \
58-
V(OBJECT_KEYS, JSFunction, object_keys) \
59-
V(REGEXP_INTERNAL_MATCH, JSFunction, regexp_internal_match) \
60-
V(REFLECT_APPLY_INDEX, JSFunction, reflect_apply) \
61-
V(REFLECT_CONSTRUCT_INDEX, JSFunction, reflect_construct) \
62-
V(REFLECT_DEFINE_PROPERTY_INDEX, JSFunction, reflect_define_property) \
63-
V(REFLECT_DELETE_PROPERTY_INDEX, JSFunction, reflect_delete_property) \
64-
V(SPREAD_ARGUMENTS_INDEX, JSFunction, spread_arguments) \
65-
V(SPREAD_ITERABLE_INDEX, JSFunction, spread_iterable) \
66-
V(MATH_FLOOR_INDEX, JSFunction, math_floor) \
67-
V(MATH_POW_INDEX, JSFunction, math_pow) \
68-
V(NEW_PROMISE_CAPABILITY_INDEX, JSFunction, new_promise_capability) \
69-
V(PROMISE_INTERNAL_CONSTRUCTOR_INDEX, JSFunction, \
70-
promise_internal_constructor) \
71-
V(IS_PROMISE_INDEX, JSFunction, is_promise) \
72-
V(PROMISE_THEN_INDEX, JSFunction, promise_then) \
73-
V(ASYNC_GENERATOR_AWAIT_CAUGHT, JSFunction, async_generator_await_caught) \
74-
V(ASYNC_GENERATOR_AWAIT_UNCAUGHT, JSFunction, async_generator_await_uncaught)
35+
#define NATIVE_CONTEXT_INTRINSIC_FUNCTIONS(V) \
36+
V(ASYNC_FUNCTION_PROMISE_CREATE_INDEX, JSFunction, \
37+
async_function_promise_create) \
38+
V(ASYNC_FUNCTION_PROMISE_RELEASE_INDEX, JSFunction, \
39+
async_function_promise_release) \
40+
V(IS_ARRAYLIKE, JSFunction, is_arraylike) \
41+
V(GENERATOR_NEXT_INTERNAL, JSFunction, generator_next_internal) \
42+
V(MAKE_ERROR_INDEX, JSFunction, make_error) \
43+
V(MAKE_RANGE_ERROR_INDEX, JSFunction, make_range_error) \
44+
V(MAKE_SYNTAX_ERROR_INDEX, JSFunction, make_syntax_error) \
45+
V(MAKE_TYPE_ERROR_INDEX, JSFunction, make_type_error) \
46+
V(MAKE_URI_ERROR_INDEX, JSFunction, make_uri_error) \
47+
V(OBJECT_CREATE, JSFunction, object_create) \
48+
V(OBJECT_DEFINE_PROPERTIES, JSFunction, object_define_properties) \
49+
V(OBJECT_DEFINE_PROPERTY, JSFunction, object_define_property) \
50+
V(OBJECT_GET_PROTOTYPE_OF, JSFunction, object_get_prototype_of) \
51+
V(OBJECT_IS_EXTENSIBLE, JSFunction, object_is_extensible) \
52+
V(OBJECT_IS_FROZEN, JSFunction, object_is_frozen) \
53+
V(OBJECT_IS_SEALED, JSFunction, object_is_sealed) \
54+
V(OBJECT_KEYS, JSFunction, object_keys) \
55+
V(REGEXP_INTERNAL_MATCH, JSFunction, regexp_internal_match) \
56+
V(REFLECT_APPLY_INDEX, JSFunction, reflect_apply) \
57+
V(REFLECT_CONSTRUCT_INDEX, JSFunction, reflect_construct) \
58+
V(REFLECT_DEFINE_PROPERTY_INDEX, JSFunction, reflect_define_property) \
59+
V(REFLECT_DELETE_PROPERTY_INDEX, JSFunction, reflect_delete_property) \
60+
V(SPREAD_ARGUMENTS_INDEX, JSFunction, spread_arguments) \
61+
V(SPREAD_ITERABLE_INDEX, JSFunction, spread_iterable) \
62+
V(MATH_FLOOR_INDEX, JSFunction, math_floor) \
63+
V(MATH_POW_INDEX, JSFunction, math_pow) \
64+
V(NEW_PROMISE_CAPABILITY_INDEX, JSFunction, new_promise_capability) \
65+
V(PROMISE_INTERNAL_CONSTRUCTOR_INDEX, JSFunction, \
66+
promise_internal_constructor) \
67+
V(IS_PROMISE_INDEX, JSFunction, is_promise) \
68+
V(PROMISE_THEN_INDEX, JSFunction, promise_then)
7569

7670
#define NATIVE_CONTEXT_IMPORTED_FIELDS(V) \
7771
V(ARRAY_CONCAT_INDEX, JSFunction, array_concat) \

src/interpreter/bytecode-generator.cc

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3192,22 +3192,20 @@ void BytecodeGenerator::BuildAwait(Expression* await_expr) {
31923192
// Await(operand) and suspend.
31933193
RegisterAllocationScope register_scope(this);
31943194

3195-
int await_builtin_context_index;
3195+
Runtime::FunctionId id;
31963196
RegisterList args;
31973197
if (IsAsyncGeneratorFunction(function_kind())) {
3198-
await_builtin_context_index =
3199-
catch_prediction() == HandlerTable::ASYNC_AWAIT
3200-
? Context::ASYNC_GENERATOR_AWAIT_UNCAUGHT
3201-
: Context::ASYNC_GENERATOR_AWAIT_CAUGHT;
3198+
id = catch_prediction() == HandlerTable::ASYNC_AWAIT
3199+
? Runtime::kInlineAsyncGeneratorAwaitUncaught
3200+
: Runtime::kInlineAsyncGeneratorAwaitCaught;
32023201
args = register_allocator()->NewRegisterList(2);
32033202
builder()
32043203
->MoveRegister(generator_object(), args[0])
32053204
.StoreAccumulatorInRegister(args[1]);
32063205
} else {
3207-
await_builtin_context_index =
3208-
catch_prediction() == HandlerTable::ASYNC_AWAIT
3209-
? Context::ASYNC_FUNCTION_AWAIT_UNCAUGHT_INDEX
3210-
: Context::ASYNC_FUNCTION_AWAIT_CAUGHT_INDEX;
3206+
id = catch_prediction() == HandlerTable::ASYNC_AWAIT
3207+
? Runtime::kInlineAsyncFunctionAwaitUncaught
3208+
: Runtime::kInlineAsyncFunctionAwaitCaught;
32113209
args = register_allocator()->NewRegisterList(3);
32123210
builder()
32133211
->MoveRegister(generator_object(), args[0])
@@ -3220,7 +3218,7 @@ void BytecodeGenerator::BuildAwait(Expression* await_expr) {
32203218
builder()->StoreAccumulatorInRegister(args[2]);
32213219
}
32223220

3223-
builder()->CallJSRuntime(await_builtin_context_index, args);
3221+
builder()->CallRuntime(id, args);
32243222
}
32253223

32263224
BuildSuspendPoint(await_expr);

src/interpreter/interpreter-intrinsics-generator.cc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,30 @@ Node* IntrinsicsGenerator::GetImportMetaObject(
462462
return return_value.value();
463463
}
464464

465+
Node* IntrinsicsGenerator::AsyncFunctionAwaitCaught(
466+
const InterpreterAssembler::RegListNodePair& args, Node* context) {
467+
return IntrinsicAsBuiltinCall(args, context,
468+
Builtins::kAsyncFunctionAwaitCaught);
469+
}
470+
471+
Node* IntrinsicsGenerator::AsyncFunctionAwaitUncaught(
472+
const InterpreterAssembler::RegListNodePair& args, Node* context) {
473+
return IntrinsicAsBuiltinCall(args, context,
474+
Builtins::kAsyncFunctionAwaitUncaught);
475+
}
476+
477+
Node* IntrinsicsGenerator::AsyncGeneratorAwaitCaught(
478+
const InterpreterAssembler::RegListNodePair& args, Node* context) {
479+
return IntrinsicAsBuiltinCall(args, context,
480+
Builtins::kAsyncGeneratorAwaitCaught);
481+
}
482+
483+
Node* IntrinsicsGenerator::AsyncGeneratorAwaitUncaught(
484+
const InterpreterAssembler::RegListNodePair& args, Node* context) {
485+
return IntrinsicAsBuiltinCall(args, context,
486+
Builtins::kAsyncGeneratorAwaitUncaught);
487+
}
488+
465489
Node* IntrinsicsGenerator::AsyncGeneratorReject(
466490
const InterpreterAssembler::RegListNodePair& args, Node* context) {
467491
return IntrinsicAsBuiltinCall(args, context, Builtins::kAsyncGeneratorReject);

src/interpreter/interpreter-intrinsics.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ namespace interpreter {
1414
// List of supported intrisics, with upper case name, lower case name and
1515
// expected number of arguments (-1 denoting argument count is variable).
1616
#define INTRINSICS_LIST(V) \
17+
V(AsyncFunctionAwaitCaught, async_function_await_caught, 3) \
18+
V(AsyncFunctionAwaitUncaught, async_function_await_uncaught, 3) \
19+
V(AsyncGeneratorAwaitCaught, async_generator_await_caught, 2) \
20+
V(AsyncGeneratorAwaitUncaught, async_generator_await_uncaught, 2) \
1721
V(AsyncGeneratorReject, async_generator_reject, 2) \
1822
V(AsyncGeneratorResolve, async_generator_resolve, 3) \
1923
V(AsyncGeneratorYield, async_generator_yield, 3) \

0 commit comments

Comments
 (0)