Only drain the standalone Promise job queue when unwinding the outermost bytecode execution. Draining after every nested run_executable() return let sibling Promise reactions run before current-job reactions. Plain async function returns were relying on that extra drain because return values were compiled as implicit awaits. Resolve completed async functions through the Promise resolving function instead, while keeping the async generator return-await path. Add Promise ordering coverage and update the asm inline-call regression to check the pre-drain state.
40 lines
993 B
Text
40 lines
993 B
Text
$89d6cbb5 async-await.js:9:1
|
|
Registers: 7
|
|
Blocks: 1
|
|
Constants:
|
|
[0] = Undefined
|
|
|
|
block0:
|
|
[ 0] GetGlobal dst:reg6, `f`
|
|
[ 10] Call dst:reg5, callee:reg6, this_value:Undefined, f
|
|
[ 30] End value:reg5
|
|
|
|
|
|
f$5541cf89 async-await.js:7:5
|
|
Registers: 10
|
|
Blocks: 5
|
|
Constants:
|
|
[0] = Undefined
|
|
[1] = Int32(42)
|
|
[2] = Int32(1)
|
|
|
|
block0:
|
|
[ 0] Yield continuation_label:block1, value:Undefined
|
|
|
|
block1:
|
|
[ 10] GetGlobal dst:reg6, `Promise`
|
|
[ 20] GetById dst:reg7, base:reg6, `resolve` (Promise.resolve)
|
|
[ 38] Call dst:reg5, callee:reg7, this_value:reg6, Promise.resolve, arguments:[Int32(42)]
|
|
[ 60] Mov dst:reg7, src:reg0
|
|
[ 70] Await continuation_label:block2, argument:reg5
|
|
|
|
block2:
|
|
[ 80] Mov dst:reg7, src:reg0
|
|
[ 90] GetCompletionFields type_dst:reg6, value_dst:reg8, completion:reg7
|
|
[ a0] JumpStrictlyEquals lhs:reg6, rhs:Int32(1), true_target:block3, false_target:block4
|
|
|
|
block3:
|
|
[ b8] Yield value:reg8
|
|
|
|
block4:
|
|
[ c8] Throw src:reg8
|