Commit 71898faf authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

PPC/s390: [async] Introduce dedicated JSAsyncFunctionObject.

Port a63987a4

Original Commit Message:

    This JSAsyncFunctionObject represents the implicit generator object
    inside of async functions, and also holds the outer promise for the
    async functions. This in turn allows us to get rid of the .promise
    in the Parser / BytecodeGenerator completely, and will make it
    possible to build zero-cost async stack traces independent of the
    concrete synchronous part of the stack frame (which currently breaks
    in Node.js).

    In the bytecode all the async function operations now take this new
    JSAsyncFunctionObject instead of passing both the .generator_object
    and the .promise, which further simplifies and shrinks the bytecode.
    It also reduces the size of async function frames, potentially making
    the suspend/resume cheaper.

    This also changes `await` to use intrinsics instead of calling to
    special JSFunctions on the native context, and thus reduces the size of
    the native contexts.

    to TurboFan.

R=bmeurer@chromium.org, joransiu@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: Ife0aa45b11580f316e657942485907cf78336e4b
Reviewed-on: https://chromium-review.googlesource.com/c/1276867
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Reviewed-by: 's avatarJoran Siu <joransiu@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#56581}
parent 817dd117
......@@ -1875,6 +1875,10 @@ void MacroAssembler::AssertGeneratorObject(Register object) {
CompareInstanceType(map, instance_type, JS_GENERATOR_OBJECT_TYPE);
beq(&do_check);
// Check if JSAsyncFunctionObject (See MacroAssembler::CompareInstanceType)
cmpi(instance_type, Operand(JS_ASYNC_FUNCTION_OBJECT_TYPE));
beq(&do_check);
// Check if JSAsyncGeneratorObject (See MacroAssembler::CompareInstanceType)
cmpi(instance_type, Operand(JS_ASYNC_GENERATOR_OBJECT_TYPE));
......
......@@ -1821,6 +1821,10 @@ void MacroAssembler::AssertGeneratorObject(Register object) {
CompareInstanceType(map, instance_type, JS_GENERATOR_OBJECT_TYPE);
beq(&do_check);
// Check if JSAsyncFunctionObject (See MacroAssembler::CompareInstanceType)
CmpP(instance_type, Operand(JS_ASYNC_FUNCTION_OBJECT_TYPE));
beq(&do_check);
// Check if JSAsyncGeneratorObject (See MacroAssembler::CompareInstanceType)
CmpP(instance_type, Operand(JS_ASYNC_GENERATOR_OBJECT_TYPE));
......
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