Commit 7fe7be16 authored by Benedikt Meurer's avatar Benedikt Meurer Committed by Commit Bot

[async] Remove obsolete AsyncFunctionPromiseCreate builtin.

This builtin was initially used to create the promise for an async
function, but that is now done by the AsyncFunctionEnter intrinsic.

Bug: v8:7253
Change-Id: I90d0bb31c1548bbfdb53833a5c06161db368f4f0
Reviewed-on: https://chromium-review.googlesource.com/c/1296129Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56878}
parent 499efdfd
......@@ -4298,13 +4298,6 @@ void Bootstrapper::ExportFromRuntime(Isolate* isolate,
factory->empty_string(), 1);
native_context->set_async_function_await_resolve_shared_fun(*info);
}
{
Handle<JSFunction> function =
SimpleCreateFunction(isolate, factory->empty_string(),
Builtins::kAsyncFunctionPromiseCreate, 0, false);
native_context->set_async_function_promise_create(*function);
}
}
{ // -- C a l l S i t e
......
......@@ -303,27 +303,5 @@ TF_BUILTIN(AsyncFunctionAwaitUncaught, AsyncFunctionBuiltinsAssembler) {
AsyncFunctionAwait<Descriptor>(kIsPredictedAsCaught);
}
TF_BUILTIN(AsyncFunctionPromiseCreate, AsyncFunctionBuiltinsAssembler) {
CSA_ASSERT_JS_ARGC_EQ(this, 0);
Node* const context = Parameter(Descriptor::kContext);
Node* const promise = AllocateAndInitJSPromise(context);
Label if_is_debug_active(this, Label::kDeferred);
GotoIf(IsDebugActive(), &if_is_debug_active);
// Early exit if debug is not active.
Return(promise);
BIND(&if_is_debug_active);
{
// Push the Promise under construction in an async function on
// the catch prediction stack to handle exceptions thrown before
// the first await.
CallRuntime(Runtime::kDebugPushPromise, context, promise);
Return(promise);
}
}
} // namespace internal
} // namespace v8
......@@ -435,7 +435,6 @@ namespace internal {
TFS(AsyncFunctionAwaitUncaught, kAsyncFunctionObject, kValue) \
TFJ(AsyncFunctionAwaitRejectClosure, 1, kReceiver, kSentError) \
TFJ(AsyncFunctionAwaitResolveClosure, 1, kReceiver, kSentValue) \
TFJ(AsyncFunctionPromiseCreate, 0, kReceiver) \
\
/* BigInt */ \
CPP(BigIntConstructor) \
......
......@@ -3655,8 +3655,6 @@ Reduction JSCallReducer::ReduceJSCall(Node* node,
return ReduceArrayIterator(node, IterationKind::kKeys);
case Builtins::kTypedArrayPrototypeValues:
return ReduceArrayIterator(node, IterationKind::kValues);
case Builtins::kAsyncFunctionPromiseCreate:
return ReduceAsyncFunctionPromiseCreate(node);
case Builtins::kPromiseInternalConstructor:
return ReducePromiseInternalConstructor(node);
case Builtins::kPromiseInternalReject:
......@@ -5495,25 +5493,6 @@ Reduction JSCallReducer::ReduceStringPrototypeConcat(
return Replace(value);
}
Reduction JSCallReducer::ReduceAsyncFunctionPromiseCreate(Node* node) {
DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
Node* context = NodeProperties::GetContextInput(node);
Node* effect = NodeProperties::GetEffectInput(node);
if (!isolate()->IsPromiseHookProtectorIntact()) return NoChange();
// Install a code dependency on the promise hook protector cell.
dependencies()->DependOnProtector(
PropertyCellRef(broker(), factory()->promise_hook_protector()));
// Morph this {node} into a JSCreatePromise node.
RelaxControls(node);
node->ReplaceInput(0, context);
node->ReplaceInput(1, effect);
node->TrimInputCount(2);
NodeProperties::ChangeOp(node, javascript()->CreatePromise());
return Changed(node);
}
Node* JSCallReducer::CreateArtificialFrameState(
Node* node, Node* outer_frame_state, int parameter_count,
BailoutId bailout_id, FrameStateType frame_state_type,
......
......@@ -133,7 +133,6 @@ class V8_EXPORT_PRIVATE JSCallReducer final : public AdvancedReducer {
Reduction ReduceStringPrototypeConcat(Node* node,
Handle<SharedFunctionInfo> shared);
Reduction ReduceAsyncFunctionPromiseCreate(Node* node);
Reduction ReducePromiseConstructor(Node* node);
Reduction ReducePromiseInternalConstructor(Node* node);
Reduction ReducePromiseInternalReject(Node* node);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment