0038e5f05f
This change introduces new intrinsics used to desugar async functions in the Parser and the BytecodeGenerator, namely we introduce a new %_AsyncFunctionEnter intrinsic that constructs the generator object for the async function (and in the future will also create the outer promise for the async function). This generator object is internal and never escapes to user code, plus since async functions don't have a "prototype" property, we can just a single map here instead of tracking the prototype/initial_map on every async function. This saves one word per async function plus one initial_map per async function that was invoked at least once. We also introduce two new intrinsics %_AsyncFunctionReject, which rejects the outer promise with the caught exception, and another %_AsyncFunctionResolve, which resolves the outer promise with the right hand side of the `return` statement. These functions also perform the DevTools part of the job (aka popping from the promise stack and sending the debug event). This allows us to get rid of the implicit try-finally from async functions completely; because the finally block only called to the %AsyncFunctionPromiseRelease builtin, which was used to inform DevTools. In essence we now turn an async function like ```js async function f(x) { return await bar(x); } ``` into something like this (in Parser and BytecodeGenerator respectively): ``` function f(x) { .generator_object = %_AsyncFunctionEnter(.closure, this); .promise = %AsyncFunctionCreatePromise(); try { .tmp = await bar(x); return %_AsyncFunctionResolve(.promise, .tmp); } catch (e) { return %_AsyncFunctionReject(.promise, e); } } ``` Overall the bytecode for async functions gets significantly shorter already (and will get even shorter once we put the outer promise into the async function generator object). For example the bytecode for a simple async function ```js async function f(x) { return await x; } ``` goes from 175 bytes to 110 bytes (a ~38% reduction in size), which is in particular due to the simplification around the try-finally removal. Overall this seems to improve the doxbee-async-es2017-native test by around 2-3%. On the test case mentioned in v8:8276 we go from 1124ms to 441ms, which corresponds to a 60% reduction in total execution time! Tbr: marja@chromium.org Bug: v8:7253, v8:7522, v8:8276 Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel Change-Id: Id29dc92de7490b387ff697860c900cee44c9a7a4 Reviewed-on: https://chromium-review.googlesource.com/c/1269041 Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org> Reviewed-by: Maya Lekova <mslekova@chromium.org> Reviewed-by: Yang Guo <yangguo@chromium.org> Cr-Commit-Position: refs/heads/master@{#56502}
874 lines
33 KiB
Plaintext
874 lines
33 KiB
Plaintext
#
|
|
# Autogenerated by generate-bytecode-expectations.
|
|
#
|
|
|
|
---
|
|
wrap: no
|
|
test function name: f
|
|
async iteration: yes
|
|
|
|
---
|
|
snippet: "
|
|
async function f() {
|
|
for await (let x of [1, 2, 3]) {}
|
|
}
|
|
f();
|
|
"
|
|
frame size: 20
|
|
parameter count: 1
|
|
bytecode array length: 453
|
|
bytecodes: [
|
|
B(SwitchOnGeneratorState), R(3), U8(0), U8(3),
|
|
B(Mov), R(closure), R(12),
|
|
B(Mov), R(this), R(13),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(12), U8(2),
|
|
B(Star), R(3),
|
|
/* 16 E> */ B(StackCheck),
|
|
B(CallJSRuntime), U8(%async_function_promise_create), R(0), U8(0),
|
|
B(Star), R(0),
|
|
B(Mov), R(context), R(12),
|
|
B(LdaZero),
|
|
B(Star), R(8),
|
|
B(Mov), R(context), R(15),
|
|
B(Mov), R(context), R(16),
|
|
/* 43 S> */ B(CreateArrayLiteral), U8(3), U8(0), U8(37),
|
|
B(Star), R(17),
|
|
B(LdaNamedProperty), R(17), U8(4), U8(1),
|
|
B(JumpIfUndefined), U8(17),
|
|
B(JumpIfNull), U8(15),
|
|
B(Star), R(18),
|
|
B(CallProperty0), R(18), R(17), U8(3),
|
|
B(JumpIfJSReceiver), U8(23),
|
|
B(CallRuntime), U16(Runtime::kThrowSymbolAsyncIteratorInvalid), R(0), U8(0),
|
|
B(LdaNamedProperty), R(17), U8(5), U8(5),
|
|
B(Star), R(18),
|
|
B(CallProperty0), R(18), R(17), U8(7),
|
|
B(Star), R(18),
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(18), U8(1),
|
|
B(Star), R(5),
|
|
/* 43 E> */ B(LdaNamedProperty), R(5), U8(6), U8(9),
|
|
B(Star), R(6),
|
|
/* 40 S> */ B(CallProperty0), R(6), R(5), U8(11),
|
|
B(Star), R(18),
|
|
B(Mov), R(3), R(17),
|
|
B(Mov), R(0), R(19),
|
|
B(CallJSRuntime), U8(%async_function_await_uncaught), R(17), U8(3),
|
|
/* 40 E> */ B(SuspendGenerator), R(3), R(0), U8(17), U8(0),
|
|
B(ResumeGenerator), R(3), R(0), U8(17),
|
|
B(Star), R(17),
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(3), U8(1),
|
|
B(Star), R(18),
|
|
B(LdaZero),
|
|
B(TestReferenceEqual), R(18),
|
|
B(JumpIfTrue), U8(5),
|
|
B(Ldar), R(17),
|
|
B(ReThrow),
|
|
B(Mov), R(17), R(7),
|
|
/* 40 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(17), U8(1),
|
|
B(ToBooleanLogicalNot),
|
|
B(JumpIfFalse), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(7), U8(1),
|
|
B(LdaNamedProperty), R(7), U8(7), U8(13),
|
|
B(JumpIfToBooleanTrue), U8(25),
|
|
B(LdaNamedProperty), R(7), U8(8), U8(15),
|
|
B(Star), R(9),
|
|
B(LdaSmi), I8(2),
|
|
B(Star), R(8),
|
|
B(Mov), R(9), R(4),
|
|
/* 23 E> */ B(StackCheck),
|
|
B(Mov), R(4), R(1),
|
|
B(LdaZero),
|
|
B(Star), R(8),
|
|
B(JumpLoop), U8(82), I8(0),
|
|
B(Jump), U8(37),
|
|
B(Star), R(17),
|
|
B(CreateCatchContext), R(17), U8(9),
|
|
B(Star), R(16),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(16),
|
|
B(PushContext), R(17),
|
|
B(LdaSmi), I8(2),
|
|
B(TestEqualStrict), R(8), U8(17),
|
|
B(JumpIfFalse), U8(6),
|
|
B(LdaSmi), I8(1),
|
|
B(Star), R(8),
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
|
B(Star), R(18),
|
|
B(CallRuntime), U16(Runtime::kReThrow), R(18), U8(1),
|
|
B(PopContext), R(17),
|
|
B(LdaSmi), I8(-1),
|
|
B(Star), R(14),
|
|
B(Star), R(13),
|
|
B(Jump), U8(7),
|
|
B(Star), R(14),
|
|
B(LdaZero),
|
|
B(Star), R(13),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Star), R(15),
|
|
B(LdaZero),
|
|
B(TestEqualStrict), R(8), U8(18),
|
|
B(JumpIfTrue), U8(167),
|
|
B(LdaNamedProperty), R(5), U8(10), U8(19),
|
|
B(Star), R(10),
|
|
B(TestUndetectable),
|
|
B(JumpIfFalse), U8(4),
|
|
B(Jump), U8(156),
|
|
B(LdaSmi), I8(1),
|
|
B(TestEqualStrict), R(8), U8(21),
|
|
B(JumpIfFalse), U8(86),
|
|
B(Ldar), R(10),
|
|
B(TestTypeOf), U8(6),
|
|
B(JumpIfFalse), U8(4),
|
|
B(Jump), U8(18),
|
|
B(Wide), B(LdaSmi), I16(154),
|
|
B(Star), R(16),
|
|
B(LdaConstant), U8(11),
|
|
B(Star), R(17),
|
|
B(CallRuntime), U16(Runtime::kNewTypeError), R(16), U8(2),
|
|
B(Throw),
|
|
B(Mov), R(context), R(16),
|
|
B(Mov), R(10), R(17),
|
|
B(Mov), R(5), R(18),
|
|
B(InvokeIntrinsic), U8(Runtime::k_Call), R(17), U8(2),
|
|
B(Star), R(18),
|
|
B(Mov), R(3), R(17),
|
|
B(Mov), R(0), R(19),
|
|
B(CallJSRuntime), U8(%async_function_await_caught), R(17), U8(3),
|
|
B(SuspendGenerator), R(3), R(0), U8(17), U8(1),
|
|
B(ResumeGenerator), R(3), R(0), U8(17),
|
|
B(Star), R(17),
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(3), U8(1),
|
|
B(Star), R(18),
|
|
B(LdaZero),
|
|
B(TestReferenceEqual), R(18),
|
|
B(JumpIfTrue), U8(5),
|
|
B(Ldar), R(17),
|
|
B(ReThrow),
|
|
B(Ldar), R(17),
|
|
B(Jump), U8(6),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(16),
|
|
B(Jump), U8(65),
|
|
B(Mov), R(10), R(16),
|
|
B(Mov), R(5), R(17),
|
|
B(InvokeIntrinsic), U8(Runtime::k_Call), R(16), U8(2),
|
|
B(Star), R(17),
|
|
B(Mov), R(3), R(16),
|
|
B(Mov), R(0), R(18),
|
|
B(CallJSRuntime), U8(%async_function_await_uncaught), R(16), U8(3),
|
|
B(SuspendGenerator), R(3), R(0), U8(16), U8(2),
|
|
B(ResumeGenerator), R(3), R(0), U8(16),
|
|
B(Star), R(16),
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(3), U8(1),
|
|
B(Star), R(17),
|
|
B(LdaZero),
|
|
B(TestReferenceEqual), R(17),
|
|
B(JumpIfTrue), U8(5),
|
|
B(Ldar), R(16),
|
|
B(ReThrow),
|
|
B(Mov), R(16), R(11),
|
|
B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(16), U8(1),
|
|
B(JumpIfToBooleanFalse), U8(4),
|
|
B(Jump), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
|
|
B(Ldar), R(15),
|
|
B(SetPendingMessage),
|
|
B(LdaZero),
|
|
B(TestReferenceEqual), R(13),
|
|
B(JumpIfFalse), U8(5),
|
|
B(Ldar), R(14),
|
|
B(ReThrow),
|
|
B(LdaUndefined),
|
|
B(Star), R(14),
|
|
B(LdaTrue),
|
|
B(Star), R(15),
|
|
B(Mov), R(0), R(13),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(13), U8(3),
|
|
/* 57 S> */ B(Return),
|
|
B(Jump), U8(30),
|
|
B(Star), R(13),
|
|
B(CreateCatchContext), R(13), U8(12),
|
|
B(Star), R(12),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(12),
|
|
B(PushContext), R(13),
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
|
B(Star), R(15),
|
|
B(LdaTrue),
|
|
B(Star), R(16),
|
|
B(Mov), R(0), R(14),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(14), U8(3),
|
|
/* 57 S> */ B(Return),
|
|
B(LdaUndefined),
|
|
/* 57 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
Smi [107],
|
|
Smi [303],
|
|
Smi [360],
|
|
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
|
|
SYMBOL_TYPE,
|
|
SYMBOL_TYPE,
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
|
|
SCOPE_INFO_TYPE,
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
|
|
SCOPE_INFO_TYPE,
|
|
]
|
|
handlers: [
|
|
[26, 421, 423],
|
|
[32, 208, 216],
|
|
[35, 171, 173],
|
|
[276, 325, 327],
|
|
]
|
|
|
|
---
|
|
snippet: "
|
|
async function f() {
|
|
for await (let x of [1, 2, 3]) { return x; }
|
|
}
|
|
f();
|
|
"
|
|
frame size: 20
|
|
parameter count: 1
|
|
bytecode array length: 473
|
|
bytecodes: [
|
|
B(SwitchOnGeneratorState), R(3), U8(0), U8(3),
|
|
B(Mov), R(closure), R(12),
|
|
B(Mov), R(this), R(13),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(12), U8(2),
|
|
B(Star), R(3),
|
|
/* 16 E> */ B(StackCheck),
|
|
B(CallJSRuntime), U8(%async_function_promise_create), R(0), U8(0),
|
|
B(Star), R(0),
|
|
B(Mov), R(context), R(12),
|
|
B(LdaZero),
|
|
B(Star), R(8),
|
|
B(Mov), R(context), R(15),
|
|
B(Mov), R(context), R(16),
|
|
/* 43 S> */ B(CreateArrayLiteral), U8(3), U8(0), U8(37),
|
|
B(Star), R(17),
|
|
B(LdaNamedProperty), R(17), U8(4), U8(1),
|
|
B(JumpIfUndefined), U8(17),
|
|
B(JumpIfNull), U8(15),
|
|
B(Star), R(18),
|
|
B(CallProperty0), R(18), R(17), U8(3),
|
|
B(JumpIfJSReceiver), U8(23),
|
|
B(CallRuntime), U16(Runtime::kThrowSymbolAsyncIteratorInvalid), R(0), U8(0),
|
|
B(LdaNamedProperty), R(17), U8(5), U8(5),
|
|
B(Star), R(18),
|
|
B(CallProperty0), R(18), R(17), U8(7),
|
|
B(Star), R(18),
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(18), U8(1),
|
|
B(Star), R(5),
|
|
/* 43 E> */ B(LdaNamedProperty), R(5), U8(6), U8(9),
|
|
B(Star), R(6),
|
|
/* 40 S> */ B(CallProperty0), R(6), R(5), U8(11),
|
|
B(Star), R(18),
|
|
B(Mov), R(3), R(17),
|
|
B(Mov), R(0), R(19),
|
|
B(CallJSRuntime), U8(%async_function_await_uncaught), R(17), U8(3),
|
|
/* 40 E> */ B(SuspendGenerator), R(3), R(0), U8(17), U8(0),
|
|
B(ResumeGenerator), R(3), R(0), U8(17),
|
|
B(Star), R(17),
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(3), U8(1),
|
|
B(Star), R(18),
|
|
B(LdaZero),
|
|
B(TestReferenceEqual), R(18),
|
|
B(JumpIfTrue), U8(5),
|
|
B(Ldar), R(17),
|
|
B(ReThrow),
|
|
B(Mov), R(17), R(7),
|
|
/* 40 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(17), U8(1),
|
|
B(ToBooleanLogicalNot),
|
|
B(JumpIfFalse), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(7), U8(1),
|
|
B(LdaNamedProperty), R(7), U8(7), U8(13),
|
|
B(JumpIfToBooleanTrue), U8(27),
|
|
B(LdaNamedProperty), R(7), U8(8), U8(15),
|
|
B(Star), R(9),
|
|
B(LdaSmi), I8(2),
|
|
B(Star), R(8),
|
|
B(Mov), R(9), R(4),
|
|
/* 23 E> */ B(StackCheck),
|
|
B(Mov), R(4), R(1),
|
|
/* 56 S> */ B(LdaZero),
|
|
B(Star), R(13),
|
|
B(Mov), R(9), R(14),
|
|
B(Jump), U8(53),
|
|
B(Jump), U8(37),
|
|
B(Star), R(17),
|
|
B(CreateCatchContext), R(17), U8(9),
|
|
B(Star), R(16),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(16),
|
|
B(PushContext), R(17),
|
|
B(LdaSmi), I8(2),
|
|
B(TestEqualStrict), R(8), U8(17),
|
|
B(JumpIfFalse), U8(6),
|
|
B(LdaSmi), I8(1),
|
|
B(Star), R(8),
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
|
B(Star), R(18),
|
|
B(CallRuntime), U16(Runtime::kReThrow), R(18), U8(1),
|
|
B(PopContext), R(17),
|
|
B(LdaSmi), I8(-1),
|
|
B(Star), R(14),
|
|
B(Star), R(13),
|
|
B(Jump), U8(8),
|
|
B(Star), R(14),
|
|
B(LdaSmi), I8(1),
|
|
B(Star), R(13),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Star), R(15),
|
|
B(LdaZero),
|
|
B(TestEqualStrict), R(8), U8(18),
|
|
B(JumpIfTrue), U8(167),
|
|
B(LdaNamedProperty), R(5), U8(10), U8(19),
|
|
B(Star), R(10),
|
|
B(TestUndetectable),
|
|
B(JumpIfFalse), U8(4),
|
|
B(Jump), U8(156),
|
|
B(LdaSmi), I8(1),
|
|
B(TestEqualStrict), R(8), U8(21),
|
|
B(JumpIfFalse), U8(86),
|
|
B(Ldar), R(10),
|
|
B(TestTypeOf), U8(6),
|
|
B(JumpIfFalse), U8(4),
|
|
B(Jump), U8(18),
|
|
B(Wide), B(LdaSmi), I16(154),
|
|
B(Star), R(16),
|
|
B(LdaConstant), U8(11),
|
|
B(Star), R(17),
|
|
B(CallRuntime), U16(Runtime::kNewTypeError), R(16), U8(2),
|
|
B(Throw),
|
|
B(Mov), R(context), R(16),
|
|
B(Mov), R(10), R(17),
|
|
B(Mov), R(5), R(18),
|
|
B(InvokeIntrinsic), U8(Runtime::k_Call), R(17), U8(2),
|
|
B(Star), R(18),
|
|
B(Mov), R(3), R(17),
|
|
B(Mov), R(0), R(19),
|
|
B(CallJSRuntime), U8(%async_function_await_caught), R(17), U8(3),
|
|
B(SuspendGenerator), R(3), R(0), U8(17), U8(1),
|
|
B(ResumeGenerator), R(3), R(0), U8(17),
|
|
B(Star), R(17),
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(3), U8(1),
|
|
B(Star), R(18),
|
|
B(LdaZero),
|
|
B(TestReferenceEqual), R(18),
|
|
B(JumpIfTrue), U8(5),
|
|
B(Ldar), R(17),
|
|
B(ReThrow),
|
|
B(Ldar), R(17),
|
|
B(Jump), U8(6),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(16),
|
|
B(Jump), U8(65),
|
|
B(Mov), R(10), R(16),
|
|
B(Mov), R(5), R(17),
|
|
B(InvokeIntrinsic), U8(Runtime::k_Call), R(16), U8(2),
|
|
B(Star), R(17),
|
|
B(Mov), R(3), R(16),
|
|
B(Mov), R(0), R(18),
|
|
B(CallJSRuntime), U8(%async_function_await_uncaught), R(16), U8(3),
|
|
B(SuspendGenerator), R(3), R(0), U8(16), U8(2),
|
|
B(ResumeGenerator), R(3), R(0), U8(16),
|
|
B(Star), R(16),
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(3), U8(1),
|
|
B(Star), R(17),
|
|
B(LdaZero),
|
|
B(TestReferenceEqual), R(17),
|
|
B(JumpIfTrue), U8(5),
|
|
B(Ldar), R(16),
|
|
B(ReThrow),
|
|
B(Mov), R(16), R(11),
|
|
B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(16), U8(1),
|
|
B(JumpIfToBooleanFalse), U8(4),
|
|
B(Jump), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
|
|
B(Ldar), R(15),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(13),
|
|
B(SwitchOnSmiNoFeedback), U8(12), U8(2), I8(0),
|
|
B(Jump), U8(19),
|
|
B(LdaTrue),
|
|
B(Star), R(18),
|
|
B(Mov), R(0), R(16),
|
|
B(Mov), R(14), R(17),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(16), U8(3),
|
|
/* 68 S> */ B(Return),
|
|
B(Ldar), R(14),
|
|
B(ReThrow),
|
|
B(LdaUndefined),
|
|
B(Star), R(14),
|
|
B(LdaTrue),
|
|
B(Star), R(15),
|
|
B(Mov), R(0), R(13),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(13), U8(3),
|
|
/* 68 S> */ B(Return),
|
|
B(Jump), U8(30),
|
|
B(Star), R(13),
|
|
B(CreateCatchContext), R(13), U8(14),
|
|
B(Star), R(12),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(12),
|
|
B(PushContext), R(13),
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
|
B(Star), R(15),
|
|
B(LdaTrue),
|
|
B(Star), R(16),
|
|
B(Mov), R(0), R(14),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(14), U8(3),
|
|
/* 68 S> */ B(Return),
|
|
B(LdaUndefined),
|
|
/* 68 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
Smi [107],
|
|
Smi [306],
|
|
Smi [363],
|
|
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
|
|
SYMBOL_TYPE,
|
|
SYMBOL_TYPE,
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
|
|
SCOPE_INFO_TYPE,
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
|
|
Smi [6],
|
|
Smi [20],
|
|
SCOPE_INFO_TYPE,
|
|
]
|
|
handlers: [
|
|
[26, 441, 443],
|
|
[32, 210, 218],
|
|
[35, 173, 175],
|
|
[279, 328, 330],
|
|
]
|
|
|
|
---
|
|
snippet: "
|
|
async function f() {
|
|
for await (let x of [10, 20, 30]) {
|
|
if (x == 10) continue;
|
|
if (x == 20) break;
|
|
}
|
|
}
|
|
f();
|
|
"
|
|
frame size: 20
|
|
parameter count: 1
|
|
bytecode array length: 471
|
|
bytecodes: [
|
|
B(SwitchOnGeneratorState), R(3), U8(0), U8(3),
|
|
B(Mov), R(closure), R(12),
|
|
B(Mov), R(this), R(13),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(12), U8(2),
|
|
B(Star), R(3),
|
|
/* 16 E> */ B(StackCheck),
|
|
B(CallJSRuntime), U8(%async_function_promise_create), R(0), U8(0),
|
|
B(Star), R(0),
|
|
B(Mov), R(context), R(12),
|
|
B(LdaZero),
|
|
B(Star), R(8),
|
|
B(Mov), R(context), R(15),
|
|
B(Mov), R(context), R(16),
|
|
/* 43 S> */ B(CreateArrayLiteral), U8(3), U8(0), U8(37),
|
|
B(Star), R(17),
|
|
B(LdaNamedProperty), R(17), U8(4), U8(1),
|
|
B(JumpIfUndefined), U8(17),
|
|
B(JumpIfNull), U8(15),
|
|
B(Star), R(18),
|
|
B(CallProperty0), R(18), R(17), U8(3),
|
|
B(JumpIfJSReceiver), U8(23),
|
|
B(CallRuntime), U16(Runtime::kThrowSymbolAsyncIteratorInvalid), R(0), U8(0),
|
|
B(LdaNamedProperty), R(17), U8(5), U8(5),
|
|
B(Star), R(18),
|
|
B(CallProperty0), R(18), R(17), U8(7),
|
|
B(Star), R(18),
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(18), U8(1),
|
|
B(Star), R(5),
|
|
/* 43 E> */ B(LdaNamedProperty), R(5), U8(6), U8(9),
|
|
B(Star), R(6),
|
|
/* 40 S> */ B(CallProperty0), R(6), R(5), U8(11),
|
|
B(Star), R(18),
|
|
B(Mov), R(3), R(17),
|
|
B(Mov), R(0), R(19),
|
|
B(CallJSRuntime), U8(%async_function_await_uncaught), R(17), U8(3),
|
|
/* 40 E> */ B(SuspendGenerator), R(3), R(0), U8(17), U8(0),
|
|
B(ResumeGenerator), R(3), R(0), U8(17),
|
|
B(Star), R(17),
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(3), U8(1),
|
|
B(Star), R(18),
|
|
B(LdaZero),
|
|
B(TestReferenceEqual), R(18),
|
|
B(JumpIfTrue), U8(5),
|
|
B(Ldar), R(17),
|
|
B(ReThrow),
|
|
B(Mov), R(17), R(7),
|
|
/* 40 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(17), U8(1),
|
|
B(ToBooleanLogicalNot),
|
|
B(JumpIfFalse), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(7), U8(1),
|
|
B(LdaNamedProperty), R(7), U8(7), U8(13),
|
|
B(JumpIfToBooleanTrue), U8(43),
|
|
B(LdaNamedProperty), R(7), U8(8), U8(15),
|
|
B(Star), R(9),
|
|
B(LdaSmi), I8(2),
|
|
B(Star), R(8),
|
|
B(Mov), R(9), R(4),
|
|
/* 23 E> */ B(StackCheck),
|
|
B(Mov), R(4), R(1),
|
|
/* 63 S> */ B(LdaSmi), I8(10),
|
|
/* 69 E> */ B(TestEqual), R(1), U8(17),
|
|
B(JumpIfFalse), U8(4),
|
|
/* 76 S> */ B(Jump), U8(14),
|
|
/* 90 S> */ B(LdaSmi), I8(20),
|
|
/* 96 E> */ B(TestEqual), R(1), U8(18),
|
|
B(JumpIfFalse), U8(4),
|
|
/* 103 S> */ B(Jump), U8(8),
|
|
B(LdaZero),
|
|
B(Star), R(8),
|
|
B(JumpLoop), U8(100), I8(0),
|
|
B(Jump), U8(37),
|
|
B(Star), R(17),
|
|
B(CreateCatchContext), R(17), U8(9),
|
|
B(Star), R(16),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(16),
|
|
B(PushContext), R(17),
|
|
B(LdaSmi), I8(2),
|
|
B(TestEqualStrict), R(8), U8(19),
|
|
B(JumpIfFalse), U8(6),
|
|
B(LdaSmi), I8(1),
|
|
B(Star), R(8),
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
|
B(Star), R(18),
|
|
B(CallRuntime), U16(Runtime::kReThrow), R(18), U8(1),
|
|
B(PopContext), R(17),
|
|
B(LdaSmi), I8(-1),
|
|
B(Star), R(14),
|
|
B(Star), R(13),
|
|
B(Jump), U8(7),
|
|
B(Star), R(14),
|
|
B(LdaZero),
|
|
B(Star), R(13),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Star), R(15),
|
|
B(LdaZero),
|
|
B(TestEqualStrict), R(8), U8(20),
|
|
B(JumpIfTrue), U8(167),
|
|
B(LdaNamedProperty), R(5), U8(10), U8(21),
|
|
B(Star), R(10),
|
|
B(TestUndetectable),
|
|
B(JumpIfFalse), U8(4),
|
|
B(Jump), U8(156),
|
|
B(LdaSmi), I8(1),
|
|
B(TestEqualStrict), R(8), U8(23),
|
|
B(JumpIfFalse), U8(86),
|
|
B(Ldar), R(10),
|
|
B(TestTypeOf), U8(6),
|
|
B(JumpIfFalse), U8(4),
|
|
B(Jump), U8(18),
|
|
B(Wide), B(LdaSmi), I16(154),
|
|
B(Star), R(16),
|
|
B(LdaConstant), U8(11),
|
|
B(Star), R(17),
|
|
B(CallRuntime), U16(Runtime::kNewTypeError), R(16), U8(2),
|
|
B(Throw),
|
|
B(Mov), R(context), R(16),
|
|
B(Mov), R(10), R(17),
|
|
B(Mov), R(5), R(18),
|
|
B(InvokeIntrinsic), U8(Runtime::k_Call), R(17), U8(2),
|
|
B(Star), R(18),
|
|
B(Mov), R(3), R(17),
|
|
B(Mov), R(0), R(19),
|
|
B(CallJSRuntime), U8(%async_function_await_caught), R(17), U8(3),
|
|
B(SuspendGenerator), R(3), R(0), U8(17), U8(1),
|
|
B(ResumeGenerator), R(3), R(0), U8(17),
|
|
B(Star), R(17),
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(3), U8(1),
|
|
B(Star), R(18),
|
|
B(LdaZero),
|
|
B(TestReferenceEqual), R(18),
|
|
B(JumpIfTrue), U8(5),
|
|
B(Ldar), R(17),
|
|
B(ReThrow),
|
|
B(Ldar), R(17),
|
|
B(Jump), U8(6),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(16),
|
|
B(Jump), U8(65),
|
|
B(Mov), R(10), R(16),
|
|
B(Mov), R(5), R(17),
|
|
B(InvokeIntrinsic), U8(Runtime::k_Call), R(16), U8(2),
|
|
B(Star), R(17),
|
|
B(Mov), R(3), R(16),
|
|
B(Mov), R(0), R(18),
|
|
B(CallJSRuntime), U8(%async_function_await_uncaught), R(16), U8(3),
|
|
B(SuspendGenerator), R(3), R(0), U8(16), U8(2),
|
|
B(ResumeGenerator), R(3), R(0), U8(16),
|
|
B(Star), R(16),
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(3), U8(1),
|
|
B(Star), R(17),
|
|
B(LdaZero),
|
|
B(TestReferenceEqual), R(17),
|
|
B(JumpIfTrue), U8(5),
|
|
B(Ldar), R(16),
|
|
B(ReThrow),
|
|
B(Mov), R(16), R(11),
|
|
B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(16), U8(1),
|
|
B(JumpIfToBooleanFalse), U8(4),
|
|
B(Jump), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
|
|
B(Ldar), R(15),
|
|
B(SetPendingMessage),
|
|
B(LdaZero),
|
|
B(TestReferenceEqual), R(13),
|
|
B(JumpIfFalse), U8(5),
|
|
B(Ldar), R(14),
|
|
B(ReThrow),
|
|
B(LdaUndefined),
|
|
B(Star), R(14),
|
|
B(LdaTrue),
|
|
B(Star), R(15),
|
|
B(Mov), R(0), R(13),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(13), U8(3),
|
|
/* 114 S> */ B(Return),
|
|
B(Jump), U8(30),
|
|
B(Star), R(13),
|
|
B(CreateCatchContext), R(13), U8(12),
|
|
B(Star), R(12),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(12),
|
|
B(PushContext), R(13),
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
|
B(Star), R(15),
|
|
B(LdaTrue),
|
|
B(Star), R(16),
|
|
B(Mov), R(0), R(14),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(14), U8(3),
|
|
/* 114 S> */ B(Return),
|
|
B(LdaUndefined),
|
|
/* 114 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
Smi [107],
|
|
Smi [321],
|
|
Smi [378],
|
|
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
|
|
SYMBOL_TYPE,
|
|
SYMBOL_TYPE,
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
|
|
SCOPE_INFO_TYPE,
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
|
|
SCOPE_INFO_TYPE,
|
|
]
|
|
handlers: [
|
|
[26, 439, 441],
|
|
[32, 226, 234],
|
|
[35, 189, 191],
|
|
[294, 343, 345],
|
|
]
|
|
|
|
---
|
|
snippet: "
|
|
async function f() {
|
|
var x = { 'a': 1, 'b': 2 };
|
|
for (x['a'] of [1,2,3]) { return x['a']; }
|
|
}
|
|
f();
|
|
"
|
|
frame size: 17
|
|
parameter count: 1
|
|
bytecode array length: 345
|
|
bytecodes: [
|
|
B(Mov), R(closure), R(10),
|
|
B(Mov), R(this), R(11),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(10), U8(2),
|
|
B(Star), R(1),
|
|
/* 16 E> */ B(StackCheck),
|
|
B(CallJSRuntime), U8(%async_function_promise_create), R(0), U8(0),
|
|
B(Star), R(0),
|
|
B(Mov), R(context), R(10),
|
|
/* 31 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41), R(11),
|
|
B(Mov), R(11), R(2),
|
|
B(LdaZero),
|
|
B(Star), R(6),
|
|
B(Mov), R(context), R(13),
|
|
B(Mov), R(context), R(14),
|
|
/* 68 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(37),
|
|
B(Star), R(15),
|
|
B(LdaNamedProperty), R(15), U8(2), U8(2),
|
|
B(Star), R(16),
|
|
B(CallProperty0), R(16), R(15), U8(4),
|
|
B(JumpIfJSReceiver), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
|
|
B(Star), R(3),
|
|
/* 68 E> */ B(LdaNamedProperty), R(3), U8(3), U8(6),
|
|
B(Star), R(4),
|
|
/* 59 S> */ B(CallProperty0), R(4), R(3), U8(8),
|
|
B(Star), R(5),
|
|
/* 59 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(5), U8(1),
|
|
B(ToBooleanLogicalNot),
|
|
B(JumpIfFalse), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(5), U8(1),
|
|
B(LdaNamedProperty), R(5), U8(4), U8(10),
|
|
B(JumpIfToBooleanTrue), U8(30),
|
|
/* 58 E> */ B(LdaNamedProperty), R(5), U8(5), U8(12),
|
|
B(Star), R(7),
|
|
B(LdaSmi), I8(2),
|
|
B(Star), R(6),
|
|
B(Ldar), R(7),
|
|
B(StaNamedProperty), R(2), U8(6), U8(14),
|
|
/* 53 E> */ B(StackCheck),
|
|
/* 87 S> */ B(LdaNamedProperty), R(2), U8(6), U8(16),
|
|
B(Star), R(12),
|
|
B(LdaZero),
|
|
B(Star), R(11),
|
|
B(Jump), U8(53),
|
|
B(Jump), U8(37),
|
|
B(Star), R(15),
|
|
B(CreateCatchContext), R(15), U8(7),
|
|
B(Star), R(14),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(14),
|
|
B(PushContext), R(15),
|
|
B(LdaSmi), I8(2),
|
|
B(TestEqualStrict), R(6), U8(18),
|
|
B(JumpIfFalse), U8(6),
|
|
B(LdaSmi), I8(1),
|
|
B(Star), R(6),
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
|
B(Star), R(16),
|
|
B(CallRuntime), U16(Runtime::kReThrow), R(16), U8(1),
|
|
B(PopContext), R(15),
|
|
B(LdaSmi), I8(-1),
|
|
B(Star), R(12),
|
|
B(Star), R(11),
|
|
B(Jump), U8(8),
|
|
B(Star), R(12),
|
|
B(LdaSmi), I8(1),
|
|
B(Star), R(11),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Star), R(13),
|
|
B(LdaZero),
|
|
B(TestEqualStrict), R(6), U8(19),
|
|
B(JumpIfTrue), U8(90),
|
|
B(LdaNamedProperty), R(3), U8(8), U8(20),
|
|
B(Star), R(8),
|
|
B(TestUndetectable),
|
|
B(JumpIfFalse), U8(4),
|
|
B(Jump), U8(79),
|
|
B(LdaSmi), I8(1),
|
|
B(TestEqualStrict), R(6), U8(22),
|
|
B(JumpIfFalse), U8(47),
|
|
B(Ldar), R(8),
|
|
B(TestTypeOf), U8(6),
|
|
B(JumpIfFalse), U8(4),
|
|
B(Jump), U8(18),
|
|
B(Wide), B(LdaSmi), I16(154),
|
|
B(Star), R(14),
|
|
B(LdaConstant), U8(9),
|
|
B(Star), R(15),
|
|
B(CallRuntime), U16(Runtime::kNewTypeError), R(14), U8(2),
|
|
B(Throw),
|
|
B(Mov), R(context), R(14),
|
|
B(Mov), R(8), R(15),
|
|
B(Mov), R(3), R(16),
|
|
B(InvokeIntrinsic), U8(Runtime::k_Call), R(15), U8(2),
|
|
B(Jump), U8(6),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(14),
|
|
B(Jump), U8(27),
|
|
B(Mov), R(8), R(14),
|
|
B(Mov), R(3), R(15),
|
|
B(InvokeIntrinsic), U8(Runtime::k_Call), R(14), U8(2),
|
|
B(Star), R(9),
|
|
B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(9), U8(1),
|
|
B(JumpIfToBooleanFalse), U8(4),
|
|
B(Jump), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(9), U8(1),
|
|
B(Ldar), R(13),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(11),
|
|
B(SwitchOnSmiNoFeedback), U8(10), U8(2), I8(0),
|
|
B(Jump), U8(19),
|
|
B(LdaFalse),
|
|
B(Star), R(16),
|
|
B(Mov), R(0), R(14),
|
|
B(Mov), R(12), R(15),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(14), U8(3),
|
|
/* 96 S> */ B(Return),
|
|
B(Ldar), R(12),
|
|
B(ReThrow),
|
|
B(LdaUndefined),
|
|
B(Star), R(12),
|
|
B(LdaFalse),
|
|
B(Star), R(13),
|
|
B(Mov), R(0), R(11),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(11), U8(3),
|
|
/* 96 S> */ B(Return),
|
|
B(Jump), U8(30),
|
|
B(Star), R(11),
|
|
B(CreateCatchContext), R(11), U8(12),
|
|
B(Star), R(10),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(10),
|
|
B(PushContext), R(11),
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
|
B(Star), R(13),
|
|
B(LdaFalse),
|
|
B(Star), R(14),
|
|
B(Mov), R(0), R(12),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(12), U8(3),
|
|
/* 96 S> */ B(Return),
|
|
B(LdaUndefined),
|
|
/* 96 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
|
|
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
|
|
SYMBOL_TYPE,
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["a"],
|
|
SCOPE_INFO_TYPE,
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
|
|
Smi [6],
|
|
Smi [20],
|
|
SCOPE_INFO_TYPE,
|
|
]
|
|
handlers: [
|
|
[22, 313, 315],
|
|
[36, 159, 167],
|
|
[39, 122, 124],
|
|
[228, 238, 240],
|
|
]
|
|
|