Commit 4f023875 authored by Benedikt Meurer's avatar Benedikt Meurer Committed by Commit Bot

[async] Improve wrapper promise initialization code.

The code for the initialization of the wrapper promise was using the
generic InitializeJSObjectFromMap() helper, which generates a loop to
initialization all fields of some generic object. In this particular
case we're constructing a JSPromise, so we only need to initialize the
elements and properties pointers, since all the other fields are taken
care of by the PromiseInit() call on the next line anyways.

Bug: v8:7253, v8:8238
Change-Id: If11963d1f94607ed9e48788f597c81c7344aafbe
Reviewed-on: https://chromium-review.googlesource.com/c/1281602Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56665}
parent 599ee834
......@@ -73,9 +73,10 @@ Node* AsyncBuiltinsAssembler::AwaitOld(Node* context, Node* generator,
{
// Initialize Promise
StoreMapNoWriteBarrier(wrapped_value, promise_map);
InitializeJSObjectFromMap(
wrapped_value, promise_map,
IntPtrConstant(JSPromise::kSizeWithEmbedderFields));
StoreObjectFieldRoot(wrapped_value, JSPromise::kPropertiesOrHashOffset,
RootIndex::kEmptyFixedArray);
StoreObjectFieldRoot(wrapped_value, JSPromise::kElementsOffset,
RootIndex::kEmptyFixedArray);
PromiseInit(wrapped_value);
}
......
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