Commit 8f8b5f8c authored by Benedikt Meurer's avatar Benedikt Meurer Committed by Commit Bot

[es2018] Consistently use AsyncReturnStatement in async functions.

The Parser desugaring didn't use the AsyncReturnStatement consistently
to return from async functions (aka resolve the .promise with the return
value and return the .promise from the async function). Instead the
Parser essentially had a copy of the BytecodeGenerator functionality.

This change unifies the handling of returns from async functions.

Bug: v8:7522, v8:8238
Change-Id: Ib00a60aee30d541b84835d9cc83e9937b7a39e26
Reviewed-on: https://chromium-review.googlesource.com/c/1269036Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56453}
parent 762bf214
...@@ -2926,19 +2926,6 @@ Block* Parser::BuildRejectPromiseOnException(Block* inner_block) { ...@@ -2926,19 +2926,6 @@ Block* Parser::BuildRejectPromiseOnException(Block* inner_block) {
return result; return result;
} }
Expression* Parser::BuildResolvePromise(Expression* value, int pos) {
// %ResolvePromise(.promise, value), .promise
ZonePtrList<Expression>* args =
new (zone()) ZonePtrList<Expression>(2, zone());
args->Add(factory()->NewVariableProxy(PromiseVariable()), zone());
args->Add(value, zone());
Expression* call_runtime =
factory()->NewCallRuntime(Runtime::kInlineResolvePromise, args, pos);
return factory()->NewBinaryOperation(
Token::COMMA, call_runtime,
factory()->NewVariableProxy(PromiseVariable()), pos);
}
Expression* Parser::BuildRejectPromise(Expression* value, int pos) { Expression* Parser::BuildRejectPromise(Expression* value, int pos) {
// %promise_internal_reject(.promise, value, false), .promise // %promise_internal_reject(.promise, value, false), .promise
// Disables the additional debug event for the rejection since a debug event // Disables the additional debug event for the rejection since a debug event
...@@ -3574,10 +3561,9 @@ void Parser::RewriteAsyncFunctionBody(ZonePtrList<Statement>* body, ...@@ -3574,10 +3561,9 @@ void Parser::RewriteAsyncFunctionBody(ZonePtrList<Statement>* body,
// }) // })
// } // }
return_value = BuildResolvePromise(return_value, return_value->position()); block->statements()->Add(factory()->NewAsyncReturnStatement(
block->statements()->Add( return_value, return_value->position()),
factory()->NewReturnStatement(return_value, return_value->position()), zone());
zone());
block = BuildRejectPromiseOnException(block); block = BuildRejectPromiseOnException(block);
body->Add(block, zone()); body->Add(block, zone());
} }
......
...@@ -547,7 +547,6 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) { ...@@ -547,7 +547,6 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
Expression* BuildInitialYield(int pos, FunctionKind kind); Expression* BuildInitialYield(int pos, FunctionKind kind);
Assignment* BuildCreateJSGeneratorObject(int pos, FunctionKind kind); Assignment* BuildCreateJSGeneratorObject(int pos, FunctionKind kind);
Expression* BuildResolvePromise(Expression* value, int pos);
Expression* BuildRejectPromise(Expression* value, int pos); Expression* BuildRejectPromise(Expression* value, int pos);
Variable* PromiseVariable(); Variable* PromiseVariable();
Variable* AsyncGeneratorAwaitVariable(); Variable* AsyncGeneratorAwaitVariable();
......
...@@ -16,7 +16,7 @@ snippet: " ...@@ -16,7 +16,7 @@ snippet: "
" "
frame size: 23 frame size: 23
parameter count: 1 parameter count: 1
bytecode array length: 514 bytecode array length: 518
bytecodes: [ bytecodes: [
B(SwitchOnGeneratorState), R(3), U8(0), U8(3), B(SwitchOnGeneratorState), R(3), U8(0), U8(3),
B(Mov), R(closure), R(12), B(Mov), R(closure), R(12),
...@@ -183,14 +183,11 @@ bytecodes: [ ...@@ -183,14 +183,11 @@ bytecodes: [
B(Ldar), R(17), B(Ldar), R(17),
B(ReThrow), B(ReThrow),
B(LdaUndefined), B(LdaUndefined),
B(Star), R(17), B(Star), R(13),
B(Mov), R(0), R(16),
B(InvokeIntrinsic), U8(Runtime::k_ResolvePromise), R(16), U8(2),
B(LdaZero), B(LdaZero),
B(Star), R(12), B(Star), R(12),
B(Mov), R(0), R(13), B(Jump), U8(56),
B(Jump), U8(55), B(Jump), U8(40),
B(Jump), U8(39),
B(Star), R(16), B(Star), R(16),
B(CreateCatchContext), R(16), U8(12), B(CreateCatchContext), R(16), U8(12),
B(Star), R(15), B(Star), R(15),
...@@ -205,7 +202,7 @@ bytecodes: [ ...@@ -205,7 +202,7 @@ bytecodes: [
B(Mov), R(0), R(17), B(Mov), R(0), R(17),
B(InvokeIntrinsic), U8(Runtime::k_RejectPromise), R(17), U8(3), B(InvokeIntrinsic), U8(Runtime::k_RejectPromise), R(17), U8(3),
B(PopContext), R(16), B(PopContext), R(16),
B(LdaZero), B(LdaSmi), I8(1),
B(Star), R(12), B(Star), R(12),
B(Mov), R(0), R(13), B(Mov), R(0), R(13),
B(Jump), U8(16), B(Jump), U8(16),
...@@ -214,7 +211,7 @@ bytecodes: [ ...@@ -214,7 +211,7 @@ bytecodes: [
B(Star), R(12), B(Star), R(12),
B(Jump), U8(8), B(Jump), U8(8),
B(Star), R(13), B(Star), R(13),
B(LdaSmi), I8(1), B(LdaSmi), I8(2),
B(Star), R(12), B(Star), R(12),
B(LdaTheHole), B(LdaTheHole),
B(SetPendingMessage), B(SetPendingMessage),
...@@ -226,8 +223,13 @@ bytecodes: [ ...@@ -226,8 +223,13 @@ bytecodes: [
B(Ldar), R(14), B(Ldar), R(14),
B(SetPendingMessage), B(SetPendingMessage),
B(Ldar), R(12), B(Ldar), R(12),
B(SwitchOnSmiNoFeedback), U8(13), U8(2), I8(0), B(SwitchOnSmiNoFeedback), U8(13), U8(3), I8(0),
B(Jump), U8(8), B(Jump), U8(21),
B(Mov), R(0), R(15),
B(Mov), R(13), R(16),
B(InvokeIntrinsic), U8(Runtime::k_ResolvePromise), R(15), U8(2),
B(Ldar), R(0),
/* 57 S> */ B(Return),
B(Ldar), R(13), B(Ldar), R(13),
/* 57 S> */ B(Return), /* 57 S> */ B(Return),
B(Ldar), R(13), B(Ldar), R(13),
...@@ -250,11 +252,12 @@ constant pool: [ ...@@ -250,11 +252,12 @@ constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE [""], ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
SCOPE_INFO_TYPE, SCOPE_INFO_TYPE,
Smi [6], Smi [6],
Smi [9], Smi [19],
Smi [22],
] ]
handlers: [ handlers: [
[26, 467, 475], [26, 458, 466],
[29, 428, 430], [29, 418, 420],
[35, 211, 219], [35, 211, 219],
[38, 174, 176], [38, 174, 176],
[279, 328, 330], [279, 328, 330],
...@@ -269,7 +272,7 @@ snippet: " ...@@ -269,7 +272,7 @@ snippet: "
" "
frame size: 23 frame size: 23
parameter count: 1 parameter count: 1
bytecode array length: 543 bytecode array length: 532
bytecodes: [ bytecodes: [
B(SwitchOnGeneratorState), R(3), U8(0), U8(3), B(SwitchOnGeneratorState), R(3), U8(0), U8(3),
B(Mov), R(closure), R(12), B(Mov), R(closure), R(12),
...@@ -437,16 +440,13 @@ bytecodes: [ ...@@ -437,16 +440,13 @@ bytecodes: [
B(LdaZero), B(LdaZero),
B(Star), R(12), B(Star), R(12),
B(Mov), R(17), R(13), B(Mov), R(17), R(13),
B(Jump), U8(78), B(Jump), U8(67),
B(Ldar), R(17), B(Ldar), R(17),
B(ReThrow), B(ReThrow),
B(LdaUndefined), B(LdaUndefined),
B(Star), R(17), B(Star), R(13),
B(Mov), R(0), R(16), B(LdaZero),
B(InvokeIntrinsic), U8(Runtime::k_ResolvePromise), R(16), U8(2),
B(LdaSmi), I8(1),
B(Star), R(12), B(Star), R(12),
B(Mov), R(0), R(13),
B(Jump), U8(56), B(Jump), U8(56),
B(Jump), U8(40), B(Jump), U8(40),
B(Star), R(16), B(Star), R(16),
...@@ -519,8 +519,8 @@ constant pool: [ ...@@ -519,8 +519,8 @@ constant pool: [
Smi [22], Smi [22],
] ]
handlers: [ handlers: [
[26, 483, 491], [26, 472, 480],
[29, 443, 445], [29, 432, 434],
[35, 213, 221], [35, 213, 221],
[38, 176, 178], [38, 176, 178],
[282, 331, 333], [282, 331, 333],
...@@ -538,7 +538,7 @@ snippet: " ...@@ -538,7 +538,7 @@ snippet: "
" "
frame size: 23 frame size: 23
parameter count: 1 parameter count: 1
bytecode array length: 532 bytecode array length: 536
bytecodes: [ bytecodes: [
B(SwitchOnGeneratorState), R(3), U8(0), U8(3), B(SwitchOnGeneratorState), R(3), U8(0), U8(3),
B(Mov), R(closure), R(12), B(Mov), R(closure), R(12),
...@@ -713,14 +713,11 @@ bytecodes: [ ...@@ -713,14 +713,11 @@ bytecodes: [
B(Ldar), R(17), B(Ldar), R(17),
B(ReThrow), B(ReThrow),
B(LdaUndefined), B(LdaUndefined),
B(Star), R(17), B(Star), R(13),
B(Mov), R(0), R(16),
B(InvokeIntrinsic), U8(Runtime::k_ResolvePromise), R(16), U8(2),
B(LdaZero), B(LdaZero),
B(Star), R(12), B(Star), R(12),
B(Mov), R(0), R(13), B(Jump), U8(56),
B(Jump), U8(55), B(Jump), U8(40),
B(Jump), U8(39),
B(Star), R(16), B(Star), R(16),
B(CreateCatchContext), R(16), U8(12), B(CreateCatchContext), R(16), U8(12),
B(Star), R(15), B(Star), R(15),
...@@ -735,7 +732,7 @@ bytecodes: [ ...@@ -735,7 +732,7 @@ bytecodes: [
B(Mov), R(0), R(17), B(Mov), R(0), R(17),
B(InvokeIntrinsic), U8(Runtime::k_RejectPromise), R(17), U8(3), B(InvokeIntrinsic), U8(Runtime::k_RejectPromise), R(17), U8(3),
B(PopContext), R(16), B(PopContext), R(16),
B(LdaZero), B(LdaSmi), I8(1),
B(Star), R(12), B(Star), R(12),
B(Mov), R(0), R(13), B(Mov), R(0), R(13),
B(Jump), U8(16), B(Jump), U8(16),
...@@ -744,7 +741,7 @@ bytecodes: [ ...@@ -744,7 +741,7 @@ bytecodes: [
B(Star), R(12), B(Star), R(12),
B(Jump), U8(8), B(Jump), U8(8),
B(Star), R(13), B(Star), R(13),
B(LdaSmi), I8(1), B(LdaSmi), I8(2),
B(Star), R(12), B(Star), R(12),
B(LdaTheHole), B(LdaTheHole),
B(SetPendingMessage), B(SetPendingMessage),
...@@ -756,8 +753,13 @@ bytecodes: [ ...@@ -756,8 +753,13 @@ bytecodes: [
B(Ldar), R(14), B(Ldar), R(14),
B(SetPendingMessage), B(SetPendingMessage),
B(Ldar), R(12), B(Ldar), R(12),
B(SwitchOnSmiNoFeedback), U8(13), U8(2), I8(0), B(SwitchOnSmiNoFeedback), U8(13), U8(3), I8(0),
B(Jump), U8(8), B(Jump), U8(21),
B(Mov), R(0), R(15),
B(Mov), R(13), R(16),
B(InvokeIntrinsic), U8(Runtime::k_ResolvePromise), R(15), U8(2),
B(Ldar), R(0),
/* 114 S> */ B(Return),
B(Ldar), R(13), B(Ldar), R(13),
/* 114 S> */ B(Return), /* 114 S> */ B(Return),
B(Ldar), R(13), B(Ldar), R(13),
...@@ -780,11 +782,12 @@ constant pool: [ ...@@ -780,11 +782,12 @@ constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE [""], ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
SCOPE_INFO_TYPE, SCOPE_INFO_TYPE,
Smi [6], Smi [6],
Smi [9], Smi [19],
Smi [22],
] ]
handlers: [ handlers: [
[26, 485, 493], [26, 476, 484],
[29, 446, 448], [29, 436, 438],
[35, 229, 237], [35, 229, 237],
[38, 192, 194], [38, 192, 194],
[297, 346, 348], [297, 346, 348],
...@@ -800,7 +803,7 @@ snippet: " ...@@ -800,7 +803,7 @@ snippet: "
" "
frame size: 20 frame size: 20
parameter count: 1 parameter count: 1
bytecode array length: 403 bytecode array length: 392
bytecodes: [ bytecodes: [
/* 16 E> */ B(StackCheck), /* 16 E> */ B(StackCheck),
B(CallJSRuntime), U8(%async_function_promise_create), R(0), U8(0), B(CallJSRuntime), U8(%async_function_promise_create), R(0), U8(0),
...@@ -916,16 +919,13 @@ bytecodes: [ ...@@ -916,16 +919,13 @@ bytecodes: [
B(LdaZero), B(LdaZero),
B(Star), R(10), B(Star), R(10),
B(Mov), R(15), R(11), B(Mov), R(15), R(11),
B(Jump), U8(78), B(Jump), U8(67),
B(Ldar), R(15), B(Ldar), R(15),
B(ReThrow), B(ReThrow),
B(LdaUndefined), B(LdaUndefined),
B(Star), R(15), B(Star), R(11),
B(Mov), R(0), R(14), B(LdaZero),
B(InvokeIntrinsic), U8(Runtime::k_ResolvePromise), R(14), U8(2),
B(LdaSmi), I8(1),
B(Star), R(10), B(Star), R(10),
B(Mov), R(0), R(11),
B(Jump), U8(56), B(Jump), U8(56),
B(Jump), U8(40), B(Jump), U8(40),
B(Star), R(14), B(Star), R(14),
...@@ -996,8 +996,8 @@ constant pool: [ ...@@ -996,8 +996,8 @@ constant pool: [
Smi [22], Smi [22],
] ]
handlers: [ handlers: [
[10, 343, 351], [10, 332, 340],
[13, 303, 305], [13, 292, 294],
[27, 150, 158], [27, 150, 158],
[30, 113, 115], [30, 113, 115],
[219, 229, 231], [219, 229, 231],
......
...@@ -926,7 +926,7 @@ snippet: " ...@@ -926,7 +926,7 @@ snippet: "
" "
frame size: 23 frame size: 23
parameter count: 2 parameter count: 2
bytecode array length: 363 bytecode array length: 367
bytecodes: [ bytecodes: [
/* 16 E> */ B(StackCheck), /* 16 E> */ B(StackCheck),
B(CallJSRuntime), U8(%async_function_promise_create), R(0), U8(0), B(CallJSRuntime), U8(%async_function_promise_create), R(0), U8(0),
...@@ -1038,14 +1038,11 @@ bytecodes: [ ...@@ -1038,14 +1038,11 @@ bytecodes: [
B(Ldar), R(18), B(Ldar), R(18),
B(ReThrow), B(ReThrow),
B(LdaUndefined), B(LdaUndefined),
B(Star), R(18), B(Star), R(14),
B(Mov), R(0), R(17),
B(InvokeIntrinsic), U8(Runtime::k_ResolvePromise), R(17), U8(2),
B(LdaZero), B(LdaZero),
B(Star), R(13), B(Star), R(13),
B(Mov), R(0), R(14), B(Jump), U8(56),
B(Jump), U8(55), B(Jump), U8(40),
B(Jump), U8(39),
B(Star), R(17), B(Star), R(17),
B(CreateCatchContext), R(17), U8(7), B(CreateCatchContext), R(17), U8(7),
B(Star), R(16), B(Star), R(16),
...@@ -1060,7 +1057,7 @@ bytecodes: [ ...@@ -1060,7 +1057,7 @@ bytecodes: [
B(Mov), R(0), R(18), B(Mov), R(0), R(18),
B(InvokeIntrinsic), U8(Runtime::k_RejectPromise), R(18), U8(3), B(InvokeIntrinsic), U8(Runtime::k_RejectPromise), R(18), U8(3),
B(PopContext), R(17), B(PopContext), R(17),
B(LdaZero), B(LdaSmi), I8(1),
B(Star), R(13), B(Star), R(13),
B(Mov), R(0), R(14), B(Mov), R(0), R(14),
B(Jump), U8(16), B(Jump), U8(16),
...@@ -1069,7 +1066,7 @@ bytecodes: [ ...@@ -1069,7 +1066,7 @@ bytecodes: [
B(Star), R(13), B(Star), R(13),
B(Jump), U8(8), B(Jump), U8(8),
B(Star), R(14), B(Star), R(14),
B(LdaSmi), I8(1), B(LdaSmi), I8(2),
B(Star), R(13), B(Star), R(13),
B(LdaTheHole), B(LdaTheHole),
B(SetPendingMessage), B(SetPendingMessage),
...@@ -1081,8 +1078,13 @@ bytecodes: [ ...@@ -1081,8 +1078,13 @@ bytecodes: [
B(Ldar), R(15), B(Ldar), R(15),
B(SetPendingMessage), B(SetPendingMessage),
B(Ldar), R(13), B(Ldar), R(13),
B(SwitchOnSmiNoFeedback), U8(8), U8(2), I8(0), B(SwitchOnSmiNoFeedback), U8(8), U8(3), I8(0),
B(Jump), U8(8), B(Jump), U8(21),
B(Mov), R(0), R(16),
B(Mov), R(14), R(17),
B(InvokeIntrinsic), U8(Runtime::k_ResolvePromise), R(16), U8(2),
B(Ldar), R(0),
/* 60 S> */ B(Return),
B(Ldar), R(14), B(Ldar), R(14),
/* 60 S> */ B(Return), /* 60 S> */ B(Return),
B(Ldar), R(14), B(Ldar), R(14),
...@@ -1100,11 +1102,12 @@ constant pool: [ ...@@ -1100,11 +1102,12 @@ constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE [""], ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
SCOPE_INFO_TYPE, SCOPE_INFO_TYPE,
Smi [6], Smi [6],
Smi [9], Smi [19],
Smi [22],
] ]
handlers: [ handlers: [
[10, 316, 324], [10, 307, 315],
[13, 277, 279], [13, 267, 269],
[19, 137, 145], [19, 137, 145],
[22, 100, 102], [22, 100, 102],
[205, 215, 217], [205, 215, 217],
...@@ -1119,7 +1122,7 @@ snippet: " ...@@ -1119,7 +1122,7 @@ snippet: "
" "
frame size: 23 frame size: 23
parameter count: 2 parameter count: 2
bytecode array length: 414 bytecode array length: 418
bytecodes: [ bytecodes: [
B(SwitchOnGeneratorState), R(3), U8(0), U8(1), B(SwitchOnGeneratorState), R(3), U8(0), U8(1),
B(Mov), R(closure), R(12), B(Mov), R(closure), R(12),
...@@ -1249,14 +1252,11 @@ bytecodes: [ ...@@ -1249,14 +1252,11 @@ bytecodes: [
B(Ldar), R(17), B(Ldar), R(17),
B(ReThrow), B(ReThrow),
B(LdaUndefined), B(LdaUndefined),
B(Star), R(17), B(Star), R(13),
B(Mov), R(0), R(16),
B(InvokeIntrinsic), U8(Runtime::k_ResolvePromise), R(16), U8(2),
B(LdaZero), B(LdaZero),
B(Star), R(12), B(Star), R(12),
B(Mov), R(0), R(13), B(Jump), U8(56),
B(Jump), U8(55), B(Jump), U8(40),
B(Jump), U8(39),
B(Star), R(16), B(Star), R(16),
B(CreateCatchContext), R(16), U8(8), B(CreateCatchContext), R(16), U8(8),
B(Star), R(15), B(Star), R(15),
...@@ -1271,7 +1271,7 @@ bytecodes: [ ...@@ -1271,7 +1271,7 @@ bytecodes: [
B(Mov), R(0), R(17), B(Mov), R(0), R(17),
B(InvokeIntrinsic), U8(Runtime::k_RejectPromise), R(17), U8(3), B(InvokeIntrinsic), U8(Runtime::k_RejectPromise), R(17), U8(3),
B(PopContext), R(16), B(PopContext), R(16),
B(LdaZero), B(LdaSmi), I8(1),
B(Star), R(12), B(Star), R(12),
B(Mov), R(0), R(13), B(Mov), R(0), R(13),
B(Jump), U8(16), B(Jump), U8(16),
...@@ -1280,7 +1280,7 @@ bytecodes: [ ...@@ -1280,7 +1280,7 @@ bytecodes: [
B(Star), R(12), B(Star), R(12),
B(Jump), U8(8), B(Jump), U8(8),
B(Star), R(13), B(Star), R(13),
B(LdaSmi), I8(1), B(LdaSmi), I8(2),
B(Star), R(12), B(Star), R(12),
B(LdaTheHole), B(LdaTheHole),
B(SetPendingMessage), B(SetPendingMessage),
...@@ -1292,8 +1292,13 @@ bytecodes: [ ...@@ -1292,8 +1292,13 @@ bytecodes: [
B(Ldar), R(14), B(Ldar), R(14),
B(SetPendingMessage), B(SetPendingMessage),
B(Ldar), R(12), B(Ldar), R(12),
B(SwitchOnSmiNoFeedback), U8(9), U8(2), I8(0), B(SwitchOnSmiNoFeedback), U8(9), U8(3), I8(0),
B(Jump), U8(8), B(Jump), U8(21),
B(Mov), R(0), R(15),
B(Mov), R(13), R(16),
B(InvokeIntrinsic), U8(Runtime::k_ResolvePromise), R(15), U8(2),
B(Ldar), R(0),
/* 54 S> */ B(Return),
B(Ldar), R(13), B(Ldar), R(13),
/* 54 S> */ B(Return), /* 54 S> */ B(Return),
B(Ldar), R(13), B(Ldar), R(13),
...@@ -1312,11 +1317,12 @@ constant pool: [ ...@@ -1312,11 +1317,12 @@ constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE [""], ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
SCOPE_INFO_TYPE, SCOPE_INFO_TYPE,
Smi [6], Smi [6],
Smi [9], Smi [19],
Smi [22],
] ]
handlers: [ handlers: [
[26, 367, 375], [26, 358, 366],
[29, 328, 330], [29, 318, 320],
[35, 188, 196], [35, 188, 196],
[38, 151, 153], [38, 151, 153],
[256, 266, 268], [256, 266, 268],
......
...@@ -381,7 +381,7 @@ snippet: " ...@@ -381,7 +381,7 @@ snippet: "
" "
frame size: 12 frame size: 12
parameter count: 1 parameter count: 1
bytecode array length: 140 bytecode array length: 144
bytecodes: [ bytecodes: [
/* 16 E> */ B(StackCheck), /* 16 E> */ B(StackCheck),
B(CallJSRuntime), U8(%async_function_promise_create), R(0), U8(0), B(CallJSRuntime), U8(%async_function_promise_create), R(0), U8(0),
...@@ -400,16 +400,13 @@ bytecodes: [ ...@@ -400,16 +400,13 @@ bytecodes: [
B(Star), R(2), B(Star), R(2),
B(JumpLoop), U8(17), I8(0), B(JumpLoop), U8(17), I8(0),
B(LdaUndefined), B(LdaUndefined),
B(Star), R(9), B(Star), R(5),
B(Mov), R(0), R(8),
/* 49 E> */ B(InvokeIntrinsic), U8(Runtime::k_ResolvePromise), R(8), U8(2),
B(LdaZero), B(LdaZero),
B(Star), R(4), B(Star), R(4),
B(Mov), R(0), R(5), B(Jump), U8(56),
B(Jump), U8(55), B(Jump), U8(40),
B(Jump), U8(39),
B(Star), R(8), B(Star), R(8),
B(CreateCatchContext), R(8), U8(0), /* 49 E> */ B(CreateCatchContext), R(8), U8(0),
B(Star), R(7), B(Star), R(7),
B(LdaTheHole), B(LdaTheHole),
B(SetPendingMessage), B(SetPendingMessage),
...@@ -422,7 +419,7 @@ bytecodes: [ ...@@ -422,7 +419,7 @@ bytecodes: [
B(Mov), R(0), R(9), B(Mov), R(0), R(9),
B(InvokeIntrinsic), U8(Runtime::k_RejectPromise), R(9), U8(3), B(InvokeIntrinsic), U8(Runtime::k_RejectPromise), R(9), U8(3),
B(PopContext), R(8), B(PopContext), R(8),
B(LdaZero), B(LdaSmi), I8(1),
B(Star), R(4), B(Star), R(4),
B(Mov), R(0), R(5), B(Mov), R(0), R(5),
B(Jump), U8(16), B(Jump), U8(16),
...@@ -431,7 +428,7 @@ bytecodes: [ ...@@ -431,7 +428,7 @@ bytecodes: [
B(Star), R(4), B(Star), R(4),
B(Jump), U8(8), B(Jump), U8(8),
B(Star), R(5), B(Star), R(5),
B(LdaSmi), I8(1), B(LdaSmi), I8(2),
B(Star), R(4), B(Star), R(4),
B(LdaTheHole), B(LdaTheHole),
B(SetPendingMessage), B(SetPendingMessage),
...@@ -443,8 +440,13 @@ bytecodes: [ ...@@ -443,8 +440,13 @@ bytecodes: [
B(Ldar), R(6), B(Ldar), R(6),
B(SetPendingMessage), B(SetPendingMessage),
B(Ldar), R(4), B(Ldar), R(4),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0), B(SwitchOnSmiNoFeedback), U8(1), U8(3), I8(0),
B(Jump), U8(8), B(Jump), U8(21),
B(Mov), R(0), R(7),
B(Mov), R(5), R(8),
B(InvokeIntrinsic), U8(Runtime::k_ResolvePromise), R(7), U8(2),
B(Ldar), R(0),
/* 67 S> */ B(Return),
B(Ldar), R(5), B(Ldar), R(5),
/* 67 S> */ B(Return), /* 67 S> */ B(Return),
B(Ldar), R(5), B(Ldar), R(5),
...@@ -455,11 +457,12 @@ bytecodes: [ ...@@ -455,11 +457,12 @@ bytecodes: [
constant pool: [ constant pool: [
SCOPE_INFO_TYPE, SCOPE_INFO_TYPE,
Smi [6], Smi [6],
Smi [9], Smi [19],
Smi [22],
] ]
handlers: [ handlers: [
[10, 93, 101], [10, 84, 92],
[13, 54, 56], [13, 44, 46],
] ]
--- ---
...@@ -471,7 +474,7 @@ snippet: " ...@@ -471,7 +474,7 @@ snippet: "
" "
frame size: 11 frame size: 11
parameter count: 1 parameter count: 1
bytecode array length: 191 bytecode array length: 195
bytecodes: [ bytecodes: [
B(SwitchOnGeneratorState), R(2), U8(0), U8(1), B(SwitchOnGeneratorState), R(2), U8(0), U8(1),
B(Mov), R(closure), R(3), B(Mov), R(closure), R(3),
...@@ -508,16 +511,13 @@ bytecodes: [ ...@@ -508,16 +511,13 @@ bytecodes: [
B(Star), R(1), B(Star), R(1),
B(JumpLoop), U8(52), I8(0), B(JumpLoop), U8(52), I8(0),
B(LdaUndefined), B(LdaUndefined),
B(Star), R(8), B(Star), R(4),
B(Mov), R(0), R(7),
/* 49 E> */ B(InvokeIntrinsic), U8(Runtime::k_ResolvePromise), R(7), U8(2),
B(LdaZero), B(LdaZero),
B(Star), R(3), B(Star), R(3),
B(Mov), R(0), R(4), B(Jump), U8(56),
B(Jump), U8(55), B(Jump), U8(40),
B(Jump), U8(39),
B(Star), R(7), B(Star), R(7),
B(CreateCatchContext), R(7), U8(1), /* 49 E> */ B(CreateCatchContext), R(7), U8(1),
B(Star), R(6), B(Star), R(6),
B(LdaTheHole), B(LdaTheHole),
B(SetPendingMessage), B(SetPendingMessage),
...@@ -530,7 +530,7 @@ bytecodes: [ ...@@ -530,7 +530,7 @@ bytecodes: [
B(Mov), R(0), R(8), B(Mov), R(0), R(8),
B(InvokeIntrinsic), U8(Runtime::k_RejectPromise), R(8), U8(3), B(InvokeIntrinsic), U8(Runtime::k_RejectPromise), R(8), U8(3),
B(PopContext), R(7), B(PopContext), R(7),
B(LdaZero), B(LdaSmi), I8(1),
B(Star), R(3), B(Star), R(3),
B(Mov), R(0), R(4), B(Mov), R(0), R(4),
B(Jump), U8(16), B(Jump), U8(16),
...@@ -539,7 +539,7 @@ bytecodes: [ ...@@ -539,7 +539,7 @@ bytecodes: [
B(Star), R(3), B(Star), R(3),
B(Jump), U8(8), B(Jump), U8(8),
B(Star), R(4), B(Star), R(4),
B(LdaSmi), I8(1), B(LdaSmi), I8(2),
B(Star), R(3), B(Star), R(3),
B(LdaTheHole), B(LdaTheHole),
B(SetPendingMessage), B(SetPendingMessage),
...@@ -551,8 +551,13 @@ bytecodes: [ ...@@ -551,8 +551,13 @@ bytecodes: [
B(Ldar), R(5), B(Ldar), R(5),
B(SetPendingMessage), B(SetPendingMessage),
B(Ldar), R(3), B(Ldar), R(3),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0), B(SwitchOnSmiNoFeedback), U8(2), U8(3), I8(0),
B(Jump), U8(8), B(Jump), U8(21),
B(Mov), R(0), R(6),
B(Mov), R(4), R(7),
B(InvokeIntrinsic), U8(Runtime::k_ResolvePromise), R(6), U8(2),
B(Ldar), R(0),
/* 61 S> */ B(Return),
B(Ldar), R(4), B(Ldar), R(4),
/* 61 S> */ B(Return), /* 61 S> */ B(Return),
B(Ldar), R(4), B(Ldar), R(4),
...@@ -564,10 +569,11 @@ constant pool: [ ...@@ -564,10 +569,11 @@ constant pool: [
Smi [58], Smi [58],
SCOPE_INFO_TYPE, SCOPE_INFO_TYPE,
Smi [6], Smi [6],
Smi [9], Smi [19],
Smi [22],
] ]
handlers: [ handlers: [
[26, 144, 152], [26, 135, 143],
[29, 105, 107], [29, 95, 97],
] ]
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