9f28c129a0
Change the way we start collecting async stack traces by storing the current microtask as a root instead of trying to make sense of the last frame we see. This makes it possible to use the zero cost async stack traces in Node.js as well (where the last JavaScript frame we see is not the actual async function, but some frame related to the main event loop usually). In addition to the benefit that it now works with Node.js, we can also extend the new machinery to look through (almost arbitrary) promise chains. For example this code snippet ```js (async function() { await Promise.resolve().then(() => console.log(new Error().stack)); })(); ``` can be made to also show the async function frame, even though at the point where the stack trace is collected we don't have any async function on the stack. But instead there's a PromiseReactionJobTask as "current microtask", and we can dig into the chained promise to see where the async execution is going to continue and eventually find the await promise in the chain. This also removes the removes the need to allocate `.generator_object` specially during scope resolution. Bug: v8:7522 Ref: nodejs/node#11865 Tbr: ulan@chromium.org Design-Document: bit.ly/v8-zero-cost-async-stack-traces Change-Id: Ib96cb17c2f75cce083a24e5ba2bbb7914e20d203 Reviewed-on: https://chromium-review.googlesource.com/c/1277505 Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Reviewed-by: Maya Lekova <mslekova@chromium.org> Cr-Commit-Position: refs/heads/master@{#56590}
857 lines
32 KiB
Plaintext
857 lines
32 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: 18
|
|
parameter count: 1
|
|
bytecode array length: 438
|
|
bytecodes: [
|
|
B(SwitchOnGeneratorState), R(2), U8(0), U8(3),
|
|
B(Mov), R(closure), R(11),
|
|
B(Mov), R(this), R(12),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(11), U8(2),
|
|
B(Star), R(2),
|
|
/* 16 E> */ B(StackCheck),
|
|
B(Mov), R(context), R(11),
|
|
B(LdaZero),
|
|
B(Star), R(7),
|
|
B(Mov), R(context), R(14),
|
|
B(Mov), R(context), R(15),
|
|
/* 43 S> */ B(CreateArrayLiteral), U8(3), U8(0), U8(37),
|
|
B(Star), R(16),
|
|
B(LdaNamedProperty), R(16), U8(4), U8(1),
|
|
B(JumpIfUndefined), U8(17),
|
|
B(JumpIfNull), U8(15),
|
|
B(Star), R(17),
|
|
B(CallProperty0), R(17), R(16), U8(3),
|
|
B(JumpIfJSReceiver), U8(23),
|
|
B(CallRuntime), U16(Runtime::kThrowSymbolAsyncIteratorInvalid), R(0), U8(0),
|
|
B(LdaNamedProperty), R(16), U8(5), U8(5),
|
|
B(Star), R(17),
|
|
B(CallProperty0), R(17), R(16), U8(7),
|
|
B(Star), R(17),
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(17), U8(1),
|
|
B(Star), R(4),
|
|
/* 43 E> */ B(LdaNamedProperty), R(4), U8(6), U8(9),
|
|
B(Star), R(5),
|
|
/* 40 S> */ B(CallProperty0), R(5), R(4), U8(11),
|
|
B(Star), R(17),
|
|
B(Mov), R(2), R(16),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwaitUncaught), R(16), U8(2),
|
|
/* 40 E> */ B(SuspendGenerator), R(2), R(0), U8(16), U8(0),
|
|
B(ResumeGenerator), R(2), R(0), U8(16),
|
|
B(Star), R(16),
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), 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(6),
|
|
/* 40 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(16), U8(1),
|
|
B(ToBooleanLogicalNot),
|
|
B(JumpIfFalse), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
|
|
B(LdaNamedProperty), R(6), U8(7), U8(13),
|
|
B(JumpIfToBooleanTrue), U8(25),
|
|
B(LdaNamedProperty), R(6), U8(8), U8(15),
|
|
B(Star), R(8),
|
|
B(LdaSmi), I8(2),
|
|
B(Star), R(7),
|
|
B(Mov), R(8), R(3),
|
|
/* 23 E> */ B(StackCheck),
|
|
B(Mov), R(3), R(0),
|
|
B(LdaZero),
|
|
B(Star), R(7),
|
|
B(JumpLoop), U8(79), I8(0),
|
|
B(Jump), U8(37),
|
|
B(Star), R(16),
|
|
B(CreateCatchContext), R(16), U8(9),
|
|
B(Star), R(15),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(15),
|
|
B(PushContext), R(16),
|
|
B(LdaSmi), I8(2),
|
|
B(TestEqualStrict), R(7), U8(17),
|
|
B(JumpIfFalse), U8(6),
|
|
B(LdaSmi), I8(1),
|
|
B(Star), R(7),
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
|
B(Star), R(17),
|
|
B(CallRuntime), U16(Runtime::kReThrow), R(17), U8(1),
|
|
B(PopContext), R(16),
|
|
B(LdaSmi), I8(-1),
|
|
B(Star), R(13),
|
|
B(Star), R(12),
|
|
B(Jump), U8(7),
|
|
B(Star), R(13),
|
|
B(LdaZero),
|
|
B(Star), R(12),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Star), R(14),
|
|
B(LdaZero),
|
|
B(TestEqualStrict), R(7), U8(18),
|
|
B(JumpIfTrue), U8(161),
|
|
B(LdaNamedProperty), R(4), U8(10), U8(19),
|
|
B(Star), R(9),
|
|
B(TestUndetectable),
|
|
B(JumpIfFalse), U8(4),
|
|
B(Jump), U8(150),
|
|
B(LdaSmi), I8(1),
|
|
B(TestEqualStrict), R(7), U8(21),
|
|
B(JumpIfFalse), U8(83),
|
|
B(Ldar), R(9),
|
|
B(TestTypeOf), U8(6),
|
|
B(JumpIfFalse), U8(4),
|
|
B(Jump), U8(18),
|
|
B(Wide), B(LdaSmi), I16(154),
|
|
B(Star), R(15),
|
|
B(LdaConstant), U8(11),
|
|
B(Star), R(16),
|
|
B(CallRuntime), U16(Runtime::kNewTypeError), R(15), U8(2),
|
|
B(Throw),
|
|
B(Mov), R(context), R(15),
|
|
B(Mov), R(9), R(16),
|
|
B(Mov), R(4), R(17),
|
|
B(InvokeIntrinsic), U8(Runtime::k_Call), R(16), U8(2),
|
|
B(Star), R(17),
|
|
B(Mov), R(2), R(16),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwaitCaught), R(16), U8(2),
|
|
B(SuspendGenerator), R(2), R(0), U8(16), U8(1),
|
|
B(ResumeGenerator), R(2), R(0), U8(16),
|
|
B(Star), R(16),
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
|
|
B(Star), R(17),
|
|
B(LdaZero),
|
|
B(TestReferenceEqual), R(17),
|
|
B(JumpIfTrue), U8(5),
|
|
B(Ldar), R(16),
|
|
B(ReThrow),
|
|
B(Ldar), R(16),
|
|
B(Jump), U8(6),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(15),
|
|
B(Jump), U8(62),
|
|
B(Mov), R(9), R(15),
|
|
B(Mov), R(4), R(16),
|
|
B(InvokeIntrinsic), U8(Runtime::k_Call), R(15), U8(2),
|
|
B(Star), R(16),
|
|
B(Mov), R(2), R(15),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwaitUncaught), R(15), U8(2),
|
|
B(SuspendGenerator), R(2), R(0), U8(15), U8(2),
|
|
B(ResumeGenerator), R(2), R(0), U8(15),
|
|
B(Star), R(15),
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
|
|
B(Star), R(16),
|
|
B(LdaZero),
|
|
B(TestReferenceEqual), R(16),
|
|
B(JumpIfTrue), U8(5),
|
|
B(Ldar), R(15),
|
|
B(ReThrow),
|
|
B(Mov), R(15), R(10),
|
|
B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(15), U8(1),
|
|
B(JumpIfToBooleanFalse), U8(4),
|
|
B(Jump), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
|
|
B(Ldar), R(14),
|
|
B(SetPendingMessage),
|
|
B(LdaZero),
|
|
B(TestReferenceEqual), R(12),
|
|
B(JumpIfFalse), U8(5),
|
|
B(Ldar), R(13),
|
|
B(ReThrow),
|
|
B(LdaUndefined),
|
|
B(Star), R(13),
|
|
B(LdaTrue),
|
|
B(Star), R(14),
|
|
B(Mov), R(2), R(12),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(12), U8(3),
|
|
/* 57 S> */ B(Return),
|
|
B(Jump), U8(30),
|
|
B(Star), R(12),
|
|
B(CreateCatchContext), R(12), U8(12),
|
|
B(Star), R(11),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(11),
|
|
B(PushContext), R(12),
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
|
B(Star), R(14),
|
|
B(LdaTrue),
|
|
B(Star), R(15),
|
|
B(Mov), R(2), R(13),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(13), U8(3),
|
|
/* 57 S> */ B(Return),
|
|
B(LdaUndefined),
|
|
/* 57 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
Smi [98],
|
|
Smi [291],
|
|
Smi [345],
|
|
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: [
|
|
[20, 406, 408],
|
|
[26, 199, 207],
|
|
[29, 162, 164],
|
|
[267, 313, 315],
|
|
]
|
|
|
|
---
|
|
snippet: "
|
|
async function f() {
|
|
for await (let x of [1, 2, 3]) { return x; }
|
|
}
|
|
f();
|
|
"
|
|
frame size: 18
|
|
parameter count: 1
|
|
bytecode array length: 458
|
|
bytecodes: [
|
|
B(SwitchOnGeneratorState), R(2), U8(0), U8(3),
|
|
B(Mov), R(closure), R(11),
|
|
B(Mov), R(this), R(12),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(11), U8(2),
|
|
B(Star), R(2),
|
|
/* 16 E> */ B(StackCheck),
|
|
B(Mov), R(context), R(11),
|
|
B(LdaZero),
|
|
B(Star), R(7),
|
|
B(Mov), R(context), R(14),
|
|
B(Mov), R(context), R(15),
|
|
/* 43 S> */ B(CreateArrayLiteral), U8(3), U8(0), U8(37),
|
|
B(Star), R(16),
|
|
B(LdaNamedProperty), R(16), U8(4), U8(1),
|
|
B(JumpIfUndefined), U8(17),
|
|
B(JumpIfNull), U8(15),
|
|
B(Star), R(17),
|
|
B(CallProperty0), R(17), R(16), U8(3),
|
|
B(JumpIfJSReceiver), U8(23),
|
|
B(CallRuntime), U16(Runtime::kThrowSymbolAsyncIteratorInvalid), R(0), U8(0),
|
|
B(LdaNamedProperty), R(16), U8(5), U8(5),
|
|
B(Star), R(17),
|
|
B(CallProperty0), R(17), R(16), U8(7),
|
|
B(Star), R(17),
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(17), U8(1),
|
|
B(Star), R(4),
|
|
/* 43 E> */ B(LdaNamedProperty), R(4), U8(6), U8(9),
|
|
B(Star), R(5),
|
|
/* 40 S> */ B(CallProperty0), R(5), R(4), U8(11),
|
|
B(Star), R(17),
|
|
B(Mov), R(2), R(16),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwaitUncaught), R(16), U8(2),
|
|
/* 40 E> */ B(SuspendGenerator), R(2), R(0), U8(16), U8(0),
|
|
B(ResumeGenerator), R(2), R(0), U8(16),
|
|
B(Star), R(16),
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), 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(6),
|
|
/* 40 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(16), U8(1),
|
|
B(ToBooleanLogicalNot),
|
|
B(JumpIfFalse), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
|
|
B(LdaNamedProperty), R(6), U8(7), U8(13),
|
|
B(JumpIfToBooleanTrue), U8(27),
|
|
B(LdaNamedProperty), R(6), U8(8), U8(15),
|
|
B(Star), R(8),
|
|
B(LdaSmi), I8(2),
|
|
B(Star), R(7),
|
|
B(Mov), R(8), R(3),
|
|
/* 23 E> */ B(StackCheck),
|
|
B(Mov), R(3), R(0),
|
|
/* 56 S> */ B(LdaZero),
|
|
B(Star), R(12),
|
|
B(Mov), R(8), R(13),
|
|
B(Jump), U8(53),
|
|
B(Jump), U8(37),
|
|
B(Star), R(16),
|
|
B(CreateCatchContext), R(16), U8(9),
|
|
B(Star), R(15),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(15),
|
|
B(PushContext), R(16),
|
|
B(LdaSmi), I8(2),
|
|
B(TestEqualStrict), R(7), U8(17),
|
|
B(JumpIfFalse), U8(6),
|
|
B(LdaSmi), I8(1),
|
|
B(Star), R(7),
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
|
B(Star), R(17),
|
|
B(CallRuntime), U16(Runtime::kReThrow), R(17), U8(1),
|
|
B(PopContext), R(16),
|
|
B(LdaSmi), I8(-1),
|
|
B(Star), R(13),
|
|
B(Star), R(12),
|
|
B(Jump), U8(8),
|
|
B(Star), R(13),
|
|
B(LdaSmi), I8(1),
|
|
B(Star), R(12),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Star), R(14),
|
|
B(LdaZero),
|
|
B(TestEqualStrict), R(7), U8(18),
|
|
B(JumpIfTrue), U8(161),
|
|
B(LdaNamedProperty), R(4), U8(10), U8(19),
|
|
B(Star), R(9),
|
|
B(TestUndetectable),
|
|
B(JumpIfFalse), U8(4),
|
|
B(Jump), U8(150),
|
|
B(LdaSmi), I8(1),
|
|
B(TestEqualStrict), R(7), U8(21),
|
|
B(JumpIfFalse), U8(83),
|
|
B(Ldar), R(9),
|
|
B(TestTypeOf), U8(6),
|
|
B(JumpIfFalse), U8(4),
|
|
B(Jump), U8(18),
|
|
B(Wide), B(LdaSmi), I16(154),
|
|
B(Star), R(15),
|
|
B(LdaConstant), U8(11),
|
|
B(Star), R(16),
|
|
B(CallRuntime), U16(Runtime::kNewTypeError), R(15), U8(2),
|
|
B(Throw),
|
|
B(Mov), R(context), R(15),
|
|
B(Mov), R(9), R(16),
|
|
B(Mov), R(4), R(17),
|
|
B(InvokeIntrinsic), U8(Runtime::k_Call), R(16), U8(2),
|
|
B(Star), R(17),
|
|
B(Mov), R(2), R(16),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwaitCaught), R(16), U8(2),
|
|
B(SuspendGenerator), R(2), R(0), U8(16), U8(1),
|
|
B(ResumeGenerator), R(2), R(0), U8(16),
|
|
B(Star), R(16),
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
|
|
B(Star), R(17),
|
|
B(LdaZero),
|
|
B(TestReferenceEqual), R(17),
|
|
B(JumpIfTrue), U8(5),
|
|
B(Ldar), R(16),
|
|
B(ReThrow),
|
|
B(Ldar), R(16),
|
|
B(Jump), U8(6),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(15),
|
|
B(Jump), U8(62),
|
|
B(Mov), R(9), R(15),
|
|
B(Mov), R(4), R(16),
|
|
B(InvokeIntrinsic), U8(Runtime::k_Call), R(15), U8(2),
|
|
B(Star), R(16),
|
|
B(Mov), R(2), R(15),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwaitUncaught), R(15), U8(2),
|
|
B(SuspendGenerator), R(2), R(0), U8(15), U8(2),
|
|
B(ResumeGenerator), R(2), R(0), U8(15),
|
|
B(Star), R(15),
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
|
|
B(Star), R(16),
|
|
B(LdaZero),
|
|
B(TestReferenceEqual), R(16),
|
|
B(JumpIfTrue), U8(5),
|
|
B(Ldar), R(15),
|
|
B(ReThrow),
|
|
B(Mov), R(15), R(10),
|
|
B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(15), U8(1),
|
|
B(JumpIfToBooleanFalse), U8(4),
|
|
B(Jump), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
|
|
B(Ldar), R(14),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(12),
|
|
B(SwitchOnSmiNoFeedback), U8(12), U8(2), I8(0),
|
|
B(Jump), U8(19),
|
|
B(LdaTrue),
|
|
B(Star), R(17),
|
|
B(Mov), R(2), R(15),
|
|
B(Mov), R(13), R(16),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(15), U8(3),
|
|
/* 68 S> */ B(Return),
|
|
B(Ldar), R(13),
|
|
B(ReThrow),
|
|
B(LdaUndefined),
|
|
B(Star), R(13),
|
|
B(LdaTrue),
|
|
B(Star), R(14),
|
|
B(Mov), R(2), R(12),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(12), U8(3),
|
|
/* 68 S> */ B(Return),
|
|
B(Jump), U8(30),
|
|
B(Star), R(12),
|
|
B(CreateCatchContext), R(12), U8(14),
|
|
B(Star), R(11),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(11),
|
|
B(PushContext), R(12),
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
|
B(Star), R(14),
|
|
B(LdaTrue),
|
|
B(Star), R(15),
|
|
B(Mov), R(2), R(13),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(13), U8(3),
|
|
/* 68 S> */ B(Return),
|
|
B(LdaUndefined),
|
|
/* 68 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
Smi [98],
|
|
Smi [294],
|
|
Smi [348],
|
|
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: [
|
|
[20, 426, 428],
|
|
[26, 201, 209],
|
|
[29, 164, 166],
|
|
[270, 316, 318],
|
|
]
|
|
|
|
---
|
|
snippet: "
|
|
async function f() {
|
|
for await (let x of [10, 20, 30]) {
|
|
if (x == 10) continue;
|
|
if (x == 20) break;
|
|
}
|
|
}
|
|
f();
|
|
"
|
|
frame size: 18
|
|
parameter count: 1
|
|
bytecode array length: 456
|
|
bytecodes: [
|
|
B(SwitchOnGeneratorState), R(2), U8(0), U8(3),
|
|
B(Mov), R(closure), R(11),
|
|
B(Mov), R(this), R(12),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(11), U8(2),
|
|
B(Star), R(2),
|
|
/* 16 E> */ B(StackCheck),
|
|
B(Mov), R(context), R(11),
|
|
B(LdaZero),
|
|
B(Star), R(7),
|
|
B(Mov), R(context), R(14),
|
|
B(Mov), R(context), R(15),
|
|
/* 43 S> */ B(CreateArrayLiteral), U8(3), U8(0), U8(37),
|
|
B(Star), R(16),
|
|
B(LdaNamedProperty), R(16), U8(4), U8(1),
|
|
B(JumpIfUndefined), U8(17),
|
|
B(JumpIfNull), U8(15),
|
|
B(Star), R(17),
|
|
B(CallProperty0), R(17), R(16), U8(3),
|
|
B(JumpIfJSReceiver), U8(23),
|
|
B(CallRuntime), U16(Runtime::kThrowSymbolAsyncIteratorInvalid), R(0), U8(0),
|
|
B(LdaNamedProperty), R(16), U8(5), U8(5),
|
|
B(Star), R(17),
|
|
B(CallProperty0), R(17), R(16), U8(7),
|
|
B(Star), R(17),
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(17), U8(1),
|
|
B(Star), R(4),
|
|
/* 43 E> */ B(LdaNamedProperty), R(4), U8(6), U8(9),
|
|
B(Star), R(5),
|
|
/* 40 S> */ B(CallProperty0), R(5), R(4), U8(11),
|
|
B(Star), R(17),
|
|
B(Mov), R(2), R(16),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwaitUncaught), R(16), U8(2),
|
|
/* 40 E> */ B(SuspendGenerator), R(2), R(0), U8(16), U8(0),
|
|
B(ResumeGenerator), R(2), R(0), U8(16),
|
|
B(Star), R(16),
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), 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(6),
|
|
/* 40 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(16), U8(1),
|
|
B(ToBooleanLogicalNot),
|
|
B(JumpIfFalse), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
|
|
B(LdaNamedProperty), R(6), U8(7), U8(13),
|
|
B(JumpIfToBooleanTrue), U8(43),
|
|
B(LdaNamedProperty), R(6), U8(8), U8(15),
|
|
B(Star), R(8),
|
|
B(LdaSmi), I8(2),
|
|
B(Star), R(7),
|
|
B(Mov), R(8), R(3),
|
|
/* 23 E> */ B(StackCheck),
|
|
B(Mov), R(3), R(0),
|
|
/* 63 S> */ B(LdaSmi), I8(10),
|
|
/* 69 E> */ B(TestEqual), R(0), U8(17),
|
|
B(JumpIfFalse), U8(4),
|
|
/* 76 S> */ B(Jump), U8(14),
|
|
/* 90 S> */ B(LdaSmi), I8(20),
|
|
/* 96 E> */ B(TestEqual), R(0), U8(18),
|
|
B(JumpIfFalse), U8(4),
|
|
/* 103 S> */ B(Jump), U8(8),
|
|
B(LdaZero),
|
|
B(Star), R(7),
|
|
B(JumpLoop), U8(97), I8(0),
|
|
B(Jump), U8(37),
|
|
B(Star), R(16),
|
|
B(CreateCatchContext), R(16), U8(9),
|
|
B(Star), R(15),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(15),
|
|
B(PushContext), R(16),
|
|
B(LdaSmi), I8(2),
|
|
B(TestEqualStrict), R(7), U8(19),
|
|
B(JumpIfFalse), U8(6),
|
|
B(LdaSmi), I8(1),
|
|
B(Star), R(7),
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
|
B(Star), R(17),
|
|
B(CallRuntime), U16(Runtime::kReThrow), R(17), U8(1),
|
|
B(PopContext), R(16),
|
|
B(LdaSmi), I8(-1),
|
|
B(Star), R(13),
|
|
B(Star), R(12),
|
|
B(Jump), U8(7),
|
|
B(Star), R(13),
|
|
B(LdaZero),
|
|
B(Star), R(12),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Star), R(14),
|
|
B(LdaZero),
|
|
B(TestEqualStrict), R(7), U8(20),
|
|
B(JumpIfTrue), U8(161),
|
|
B(LdaNamedProperty), R(4), U8(10), U8(21),
|
|
B(Star), R(9),
|
|
B(TestUndetectable),
|
|
B(JumpIfFalse), U8(4),
|
|
B(Jump), U8(150),
|
|
B(LdaSmi), I8(1),
|
|
B(TestEqualStrict), R(7), U8(23),
|
|
B(JumpIfFalse), U8(83),
|
|
B(Ldar), R(9),
|
|
B(TestTypeOf), U8(6),
|
|
B(JumpIfFalse), U8(4),
|
|
B(Jump), U8(18),
|
|
B(Wide), B(LdaSmi), I16(154),
|
|
B(Star), R(15),
|
|
B(LdaConstant), U8(11),
|
|
B(Star), R(16),
|
|
B(CallRuntime), U16(Runtime::kNewTypeError), R(15), U8(2),
|
|
B(Throw),
|
|
B(Mov), R(context), R(15),
|
|
B(Mov), R(9), R(16),
|
|
B(Mov), R(4), R(17),
|
|
B(InvokeIntrinsic), U8(Runtime::k_Call), R(16), U8(2),
|
|
B(Star), R(17),
|
|
B(Mov), R(2), R(16),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwaitCaught), R(16), U8(2),
|
|
B(SuspendGenerator), R(2), R(0), U8(16), U8(1),
|
|
B(ResumeGenerator), R(2), R(0), U8(16),
|
|
B(Star), R(16),
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
|
|
B(Star), R(17),
|
|
B(LdaZero),
|
|
B(TestReferenceEqual), R(17),
|
|
B(JumpIfTrue), U8(5),
|
|
B(Ldar), R(16),
|
|
B(ReThrow),
|
|
B(Ldar), R(16),
|
|
B(Jump), U8(6),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(15),
|
|
B(Jump), U8(62),
|
|
B(Mov), R(9), R(15),
|
|
B(Mov), R(4), R(16),
|
|
B(InvokeIntrinsic), U8(Runtime::k_Call), R(15), U8(2),
|
|
B(Star), R(16),
|
|
B(Mov), R(2), R(15),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwaitUncaught), R(15), U8(2),
|
|
B(SuspendGenerator), R(2), R(0), U8(15), U8(2),
|
|
B(ResumeGenerator), R(2), R(0), U8(15),
|
|
B(Star), R(15),
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
|
|
B(Star), R(16),
|
|
B(LdaZero),
|
|
B(TestReferenceEqual), R(16),
|
|
B(JumpIfTrue), U8(5),
|
|
B(Ldar), R(15),
|
|
B(ReThrow),
|
|
B(Mov), R(15), R(10),
|
|
B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(15), U8(1),
|
|
B(JumpIfToBooleanFalse), U8(4),
|
|
B(Jump), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
|
|
B(Ldar), R(14),
|
|
B(SetPendingMessage),
|
|
B(LdaZero),
|
|
B(TestReferenceEqual), R(12),
|
|
B(JumpIfFalse), U8(5),
|
|
B(Ldar), R(13),
|
|
B(ReThrow),
|
|
B(LdaUndefined),
|
|
B(Star), R(13),
|
|
B(LdaTrue),
|
|
B(Star), R(14),
|
|
B(Mov), R(2), R(12),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(12), U8(3),
|
|
/* 114 S> */ B(Return),
|
|
B(Jump), U8(30),
|
|
B(Star), R(12),
|
|
B(CreateCatchContext), R(12), U8(12),
|
|
B(Star), R(11),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(11),
|
|
B(PushContext), R(12),
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
|
B(Star), R(14),
|
|
B(LdaTrue),
|
|
B(Star), R(15),
|
|
B(Mov), R(2), R(13),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(13), U8(3),
|
|
/* 114 S> */ B(Return),
|
|
B(LdaUndefined),
|
|
/* 114 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
Smi [98],
|
|
Smi [309],
|
|
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 [""],
|
|
SCOPE_INFO_TYPE,
|
|
]
|
|
handlers: [
|
|
[20, 424, 426],
|
|
[26, 217, 225],
|
|
[29, 180, 182],
|
|
[285, 331, 333],
|
|
]
|
|
|
|
---
|
|
snippet: "
|
|
async function f() {
|
|
var x = { 'a': 1, 'b': 2 };
|
|
for (x['a'] of [1,2,3]) { return x['a']; }
|
|
}
|
|
f();
|
|
"
|
|
frame size: 16
|
|
parameter count: 1
|
|
bytecode array length: 339
|
|
bytecodes: [
|
|
B(Mov), R(closure), R(9),
|
|
B(Mov), R(this), R(10),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(9), U8(2),
|
|
B(Star), R(0),
|
|
/* 16 E> */ B(StackCheck),
|
|
B(Mov), R(context), R(9),
|
|
/* 31 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41), R(10),
|
|
B(Mov), R(10), R(1),
|
|
B(LdaZero),
|
|
B(Star), R(5),
|
|
B(Mov), R(context), R(12),
|
|
B(Mov), R(context), R(13),
|
|
/* 68 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(37),
|
|
B(Star), R(14),
|
|
B(LdaNamedProperty), R(14), U8(2), U8(2),
|
|
B(Star), R(15),
|
|
B(CallProperty0), R(15), R(14), U8(4),
|
|
B(JumpIfJSReceiver), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
|
|
B(Star), R(2),
|
|
/* 68 E> */ B(LdaNamedProperty), R(2), U8(3), U8(6),
|
|
B(Star), R(3),
|
|
/* 59 S> */ B(CallProperty0), R(3), R(2), U8(8),
|
|
B(Star), R(4),
|
|
/* 59 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(4), U8(1),
|
|
B(ToBooleanLogicalNot),
|
|
B(JumpIfFalse), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(4), U8(1),
|
|
B(LdaNamedProperty), R(4), U8(4), U8(10),
|
|
B(JumpIfToBooleanTrue), U8(30),
|
|
/* 58 E> */ B(LdaNamedProperty), R(4), U8(5), U8(12),
|
|
B(Star), R(6),
|
|
B(LdaSmi), I8(2),
|
|
B(Star), R(5),
|
|
B(Ldar), R(6),
|
|
B(StaNamedProperty), R(1), U8(6), U8(14),
|
|
/* 53 E> */ B(StackCheck),
|
|
/* 87 S> */ B(LdaNamedProperty), R(1), U8(6), U8(16),
|
|
B(Star), R(11),
|
|
B(LdaZero),
|
|
B(Star), R(10),
|
|
B(Jump), U8(53),
|
|
B(Jump), U8(37),
|
|
B(Star), R(14),
|
|
B(CreateCatchContext), R(14), U8(7),
|
|
B(Star), R(13),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(13),
|
|
B(PushContext), R(14),
|
|
B(LdaSmi), I8(2),
|
|
B(TestEqualStrict), R(5), U8(18),
|
|
B(JumpIfFalse), U8(6),
|
|
B(LdaSmi), I8(1),
|
|
B(Star), R(5),
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
|
B(Star), R(15),
|
|
B(CallRuntime), U16(Runtime::kReThrow), R(15), U8(1),
|
|
B(PopContext), R(14),
|
|
B(LdaSmi), I8(-1),
|
|
B(Star), R(11),
|
|
B(Star), R(10),
|
|
B(Jump), U8(8),
|
|
B(Star), R(11),
|
|
B(LdaSmi), I8(1),
|
|
B(Star), R(10),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Star), R(12),
|
|
B(LdaZero),
|
|
B(TestEqualStrict), R(5), U8(19),
|
|
B(JumpIfTrue), U8(90),
|
|
B(LdaNamedProperty), R(2), U8(8), U8(20),
|
|
B(Star), R(7),
|
|
B(TestUndetectable),
|
|
B(JumpIfFalse), U8(4),
|
|
B(Jump), U8(79),
|
|
B(LdaSmi), I8(1),
|
|
B(TestEqualStrict), R(5), U8(22),
|
|
B(JumpIfFalse), U8(47),
|
|
B(Ldar), R(7),
|
|
B(TestTypeOf), U8(6),
|
|
B(JumpIfFalse), U8(4),
|
|
B(Jump), U8(18),
|
|
B(Wide), B(LdaSmi), I16(154),
|
|
B(Star), R(13),
|
|
B(LdaConstant), U8(9),
|
|
B(Star), R(14),
|
|
B(CallRuntime), U16(Runtime::kNewTypeError), R(13), U8(2),
|
|
B(Throw),
|
|
B(Mov), R(context), R(13),
|
|
B(Mov), R(7), R(14),
|
|
B(Mov), R(2), R(15),
|
|
B(InvokeIntrinsic), U8(Runtime::k_Call), R(14), U8(2),
|
|
B(Jump), U8(6),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(13),
|
|
B(Jump), U8(27),
|
|
B(Mov), R(7), R(13),
|
|
B(Mov), R(2), R(14),
|
|
B(InvokeIntrinsic), U8(Runtime::k_Call), R(13), U8(2),
|
|
B(Star), R(8),
|
|
B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(8), U8(1),
|
|
B(JumpIfToBooleanFalse), U8(4),
|
|
B(Jump), U8(7),
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(8), U8(1),
|
|
B(Ldar), R(12),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(10),
|
|
B(SwitchOnSmiNoFeedback), U8(10), U8(2), I8(0),
|
|
B(Jump), U8(19),
|
|
B(LdaFalse),
|
|
B(Star), R(15),
|
|
B(Mov), R(0), R(13),
|
|
B(Mov), R(11), R(14),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(13), U8(3),
|
|
/* 96 S> */ B(Return),
|
|
B(Ldar), R(11),
|
|
B(ReThrow),
|
|
B(LdaUndefined),
|
|
B(Star), R(11),
|
|
B(LdaFalse),
|
|
B(Star), R(12),
|
|
B(Mov), R(0), R(10),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(10), U8(3),
|
|
/* 96 S> */ B(Return),
|
|
B(Jump), U8(30),
|
|
B(Star), R(10),
|
|
B(CreateCatchContext), R(10), U8(12),
|
|
B(Star), R(9),
|
|
B(LdaTheHole),
|
|
B(SetPendingMessage),
|
|
B(Ldar), R(9),
|
|
B(PushContext), R(10),
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
|
B(Star), R(12),
|
|
B(LdaFalse),
|
|
B(Star), R(13),
|
|
B(Mov), R(0), R(11),
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(11), 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: [
|
|
[16, 307, 309],
|
|
[30, 153, 161],
|
|
[33, 116, 118],
|
|
[222, 232, 234],
|
|
]
|
|
|