summaryrefslogtreecommitdiff
path: root/deps/v8/src/builtins/builtins-async-function-gen.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/builtins/builtins-async-function-gen.cc')
-rw-r--r--deps/v8/src/builtins/builtins-async-function-gen.cc18
1 files changed, 7 insertions, 11 deletions
diff --git a/deps/v8/src/builtins/builtins-async-function-gen.cc b/deps/v8/src/builtins/builtins-async-function-gen.cc
index 1644997ed0..3e87252673 100644
--- a/deps/v8/src/builtins/builtins-async-function-gen.cc
+++ b/deps/v8/src/builtins/builtins-async-function-gen.cc
@@ -103,19 +103,14 @@ TF_BUILTIN(AsyncFunctionEnter, AsyncFunctionBuiltinsAssembler) {
IntPtrConstant(0), parameters_and_register_length,
RootIndex::kUndefinedValue);
- // Allocate space for the promise, the async function object.
- TNode<IntPtrT> size = IntPtrConstant(JSPromise::kSizeWithEmbedderFields +
- JSAsyncFunctionObject::kHeaderSize);
- TNode<HeapObject> base = AllocateInNewSpace(size);
-
- // Initialize the promise.
+ // Allocate and initialize the promise.
TNode<NativeContext> native_context = LoadNativeContext(context);
TNode<JSFunction> promise_function =
CAST(LoadContextElement(native_context, Context::PROMISE_FUNCTION_INDEX));
TNode<Map> promise_map = LoadObjectField<Map>(
promise_function, JSFunction::kPrototypeOrInitialMapOffset);
TNode<JSPromise> promise = UncheckedCast<JSPromise>(
- InnerAllocate(base, JSAsyncFunctionObject::kHeaderSize));
+ AllocateInNewSpace(JSPromise::kSizeWithEmbedderFields));
StoreMapNoWriteBarrier(promise, promise_map);
StoreObjectFieldRoot(promise, JSPromise::kPropertiesOrHashOffset,
RootIndex::kEmptyFixedArray);
@@ -123,11 +118,12 @@ TF_BUILTIN(AsyncFunctionEnter, AsyncFunctionBuiltinsAssembler) {
RootIndex::kEmptyFixedArray);
PromiseInit(promise);
- // Initialize the async function object.
+ // Allocate and initialize the async function object.
TNode<Map> async_function_object_map = CAST(LoadContextElement(
native_context, Context::ASYNC_FUNCTION_OBJECT_MAP_INDEX));
TNode<JSAsyncFunctionObject> async_function_object =
- UncheckedCast<JSAsyncFunctionObject>(base);
+ UncheckedCast<JSAsyncFunctionObject>(
+ AllocateInNewSpace(JSAsyncFunctionObject::kHeaderSize));
StoreMapNoWriteBarrier(async_function_object, async_function_object_map);
StoreObjectFieldRoot(async_function_object,
JSAsyncFunctionObject::kPropertiesOrHashOffset,
@@ -188,7 +184,7 @@ TF_BUILTIN(AsyncFunctionReject, AsyncFunctionBuiltinsAssembler) {
// Reject the {promise} for the given {reason}, disabling the
// additional debug event for the rejection since a debug event
// already happend for the exception that got us here.
- CallBuiltin(Builtins::kRejectPromise, context, promise, reason,
+ CallBuiltin(Builtin::kRejectPromise, context, promise, reason,
FalseConstant());
Label if_debugging(this, Label::kDeferred);
@@ -210,7 +206,7 @@ TF_BUILTIN(AsyncFunctionResolve, AsyncFunctionBuiltinsAssembler) {
TNode<JSPromise> promise = LoadObjectField<JSPromise>(
async_function_object, JSAsyncFunctionObject::kPromiseOffset);
- CallBuiltin(Builtins::kResolvePromise, context, promise, value);
+ CallBuiltin(Builtin::kResolvePromise, context, promise, value);
Label if_debugging(this, Label::kDeferred);
GotoIf(HasAsyncEventDelegate(), &if_debugging);