Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Unified Diff: test/cctest/interpreter/bytecode_expectations/AsyncFunctions.golden

Issue 2664083002: [ignition] desugar async functions/generators/modules in BytecodeGenerator
Patch Set: get rid of lambdas, for better or worse.. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/cctest/interpreter/bytecode_expectations/AsyncFunctions.golden
diff --git a/test/cctest/interpreter/bytecode_expectations/AsyncFunctions.golden b/test/cctest/interpreter/bytecode_expectations/AsyncFunctions.golden
new file mode 100644
index 0000000000000000000000000000000000000000..32e821e698ad44068ea85c34f16b5ba3ca7a44e2
--- /dev/null
+++ b/test/cctest/interpreter/bytecode_expectations/AsyncFunctions.golden
@@ -0,0 +1,479 @@
+#
+# Autogenerated by generate-bytecode-expectations.
+#
+
+---
+wrap: no
+test function name: f
+
+---
+snippet: "
+ async function f() { }
+ f();
+"
+frame size: 8
+parameter count: 1
+bytecode array length: 100
+bytecodes: [
+ B(Ldar), R(new_target),
+ B(JumpIfUndefined), U8(22),
+ B(CallRuntime), U16(Runtime::k_GeneratorGetContext), R(new_target), U8(1),
+ B(PushContext), R(2),
+ B(ResumeGenerator), R(new_target),
+ B(Star), R(1),
+ B(LdaSmi), I8(78),
+ B(Star), R(3),
+ B(CallRuntime), U16(Runtime::kAbort), R(3), U8(1),
+ B(LdaSmi), I8(-2),
+ B(Star), R(1),
+ B(CreateFunctionContext), U8(2),
+ B(PushContext), R(0),
+ /* 16 E> */ B(StackCheck),
+ B(LdaUndefined),
+ B(Star), R(3),
+ B(CallJSRuntime), U8(%UnknownIntrinsicIndex), R(3), U8(1),
+ B(StaCurrentContextSlot), U8(5),
+ B(Mov), R(context), R(3),
+ B(Mov), R(closure), R(4),
+ B(Mov), R(this), R(5),
+ /* 16 E> */ B(CallRuntime), U16(Runtime::kCreateJSGeneratorObject), R(4), U8(2),
+ B(StaCurrentContextSlot), U8(4),
+ B(LdaUndefined),
+ B(Star), R(4),
+ B(LdaCurrentContextSlot), U8(5),
+ B(Star), R(5),
+ B(LdaUndefined),
+ B(Star), R(6),
+ B(CallJSRuntime), U8(%promise_resolve), R(4), U8(3),
+ B(LdaCurrentContextSlot), U8(5),
+ /* 21 S> */ B(Return),
+ B(Jump), U8(23),
+ B(Star), R(6),
+ B(LdaTheHole),
+ B(SetPendingMessage),
+ B(LdaCurrentContextSlot), U8(5),
+ B(Star), R(5),
+ B(LdaUndefined),
+ B(Star), R(4),
+ B(LdaFalse),
+ B(Star), R(7),
+ B(CallJSRuntime), U8(%promise_internal_reject), R(4), U8(4),
+ B(Ldar), R(5),
+ /* 21 S> */ B(Return),
+ B(LdaUndefined),
+ /* 21 S> */ B(Return),
+]
+constant pool: [
+]
+handlers: [
+ [45, 75, 77],
+]
+
+---
+snippet: "
+ async function f() { await 42 }
+ f();
+"
+frame size: 10
+parameter count: 1
+bytecode array length: 190
+bytecodes: [
+ B(Ldar), R(new_target),
+ B(JumpIfUndefined), U8(28),
+ B(CallRuntime), U16(Runtime::k_GeneratorGetContext), R(new_target), U8(1),
+ B(PushContext), R(2),
+ B(ResumeGenerator), R(new_target),
+ B(Star), R(1),
+ B(LdaZero),
+ B(TestEqualStrict), R(1), U8(0),
+ B(JumpIfTrue), U8(82),
+ B(LdaSmi), I8(78),
+ B(Star), R(3),
+ B(CallRuntime), U16(Runtime::kAbort), R(3), U8(1),
+ B(LdaSmi), I8(-2),
+ B(Star), R(1),
+ B(CreateFunctionContext), U8(3),
+ B(PushContext), R(0),
+ /* 16 E> */ B(StackCheck),
+ B(LdaUndefined),
+ B(Star), R(3),
+ B(CallJSRuntime), U8(%UnknownIntrinsicIndex), R(3), U8(1),
+ B(StaCurrentContextSlot), U8(5),
+ B(Mov), R(context), R(3),
+ B(Mov), R(closure), R(4),
+ B(Mov), R(this), R(5),
+ /* 16 E> */ B(CallRuntime), U16(Runtime::kCreateJSGeneratorObject), R(4), U8(2),
+ B(StaCurrentContextSlot), U8(4),
+ /* 21 S> */ B(LdaCurrentContextSlot), U8(4),
+ B(Star), R(4),
+ /* 27 S> */ B(LdaSmi), I8(42),
+ B(StaCurrentContextSlot), U8(6),
+ /* 21 S> */ B(LdaUndefined),
+ B(Star), R(5),
+ B(LdaCurrentContextSlot), U8(4),
+ B(Star), R(6),
+ B(LdaCurrentContextSlot), U8(6),
+ B(Star), R(7),
+ B(LdaCurrentContextSlot), U8(5),
+ B(Star), R(8),
+ B(CallJSRuntime), U8(%UnknownIntrinsicIndex), R(5), U8(4),
+ B(LdaCurrentContextSlot), U8(5),
+ B(Star), R(5),
+ B(LdaZero),
+ B(SuspendGenerator), R(4),
+ B(Ldar), R(5),
+ /* 30 S> */ B(Return),
+ B(LdaSmi), I8(-2),
+ B(Star), R(1),
+ B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(4), U8(1),
+ B(Star), R(6),
+ B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(4), U8(1),
+ B(Star), R(7),
+ B(LdaZero),
+ B(TestEqualStrict), R(7), U8(0),
+ B(JumpIfTrue), U8(25),
+ B(LdaSmi), I8(2),
+ B(TestEqualStrict), R(7), U8(0),
+ B(JumpIfTrue), U8(15),
+ B(Jump), U8(2),
+ B(LdaTrue),
+ B(Star), R(9),
+ B(Mov), R(6), R(8),
+ B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(8), U8(2),
+ /* 30 S> */ B(Return),
+ B(Ldar), R(6),
+ B(ReThrow),
+ B(LdaUndefined),
+ B(Star), R(4),
+ B(LdaCurrentContextSlot), U8(5),
+ B(Star), R(5),
+ B(LdaUndefined),
+ B(Star), R(6),
+ B(CallJSRuntime), U8(%promise_resolve), R(4), U8(3),
+ B(LdaCurrentContextSlot), U8(5),
+ /* 30 S> */ B(Return),
+ B(Jump), U8(23),
+ B(Star), R(6),
+ B(LdaTheHole),
+ B(SetPendingMessage),
+ B(LdaCurrentContextSlot), U8(5),
+ B(Star), R(5),
+ B(LdaUndefined),
+ B(Star), R(4),
+ B(LdaFalse),
+ B(Star), R(7),
+ B(CallJSRuntime), U8(%promise_internal_reject), R(4), U8(4),
+ B(Ldar), R(5),
+ /* 30 S> */ B(Return),
+ B(LdaUndefined),
+ /* 30 S> */ B(Return),
+]
+constant pool: [
+]
+handlers: [
+ [51, 165, 167],
+]
+
+---
+snippet: "
+ async function f() { for (let x of [42]) await x }
+ f();
+"
+frame size: 16
+parameter count: 1
+bytecode array length: 665
+bytecodes: [
+ B(Ldar), R(new_target),
+ B(JumpIfUndefined), U8(28),
+ B(CallRuntime), U16(Runtime::k_GeneratorGetContext), R(new_target), U8(1),
+ B(PushContext), R(4),
+ B(ResumeGenerator), R(new_target),
+ B(Star), R(3),
+ B(LdaZero),
+ B(TestEqualStrict), R(3), U8(0),
+ B(JumpIfTrue), U8(96),
+ B(LdaSmi), I8(78),
+ B(Star), R(5),
+ B(CallRuntime), U16(Runtime::kAbort), R(5), U8(1),
+ B(LdaSmi), I8(-2),
+ B(Star), R(3),
+ B(CreateFunctionContext), U8(10),
+ B(PushContext), R(0),
+ /* 16 E> */ B(StackCheck),
+ B(LdaUndefined),
+ B(Star), R(5),
+ B(CallJSRuntime), U8(%UnknownIntrinsicIndex), R(5), U8(1),
+ B(StaCurrentContextSlot), U8(5),
+ B(Mov), R(context), R(5),
+ B(Mov), R(closure), R(6),
+ B(Mov), R(this), R(7),
+ /* 16 E> */ B(CallRuntime), U16(Runtime::kCreateJSGeneratorObject), R(6), U8(2),
+ B(StaCurrentContextSlot), U8(4),
+ B(Ldar), R(closure),
+ B(CreateBlockContext), U8(0),
+ B(PushContext), R(1),
+ B(LdaTheHole),
+ B(StaCurrentContextSlot), U8(4),
+ B(LdaZero),
+ B(StaContextSlot), R(1), U8(10), U8(0),
+ B(Mov), R(context), R(8),
+ B(Mov), R(closure), R(6),
+ B(Mov), R(context), R(9),
+ /* 35 S> */ B(CreateArrayLiteral), U8(1), U8(2), U8(9),
+ B(Star), R(10),
+ B(LdaNamedProperty), R(10), U8(2), U8(3),
+ B(Star), R(11),
+ B(CallProperty), R(11), R(10), U8(1), U8(5),
+ B(JumpIfJSReceiver), U8(7),
+ B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
+ /* 35 E> */ B(StaContextSlot), R(1), U8(8), U8(0),
+ B(LdaSmi), I8(-2),
+ B(TestEqual), R(3), U8(0),
+ B(JumpIfTrue), U8(17),
+ B(LdaZero),
+ B(TestEqualStrict), R(3), U8(0),
+ B(JumpIfTrue), U8(157),
+ B(LdaSmi), I8(78),
+ B(Star), R(10),
+ B(CallRuntime), U16(Runtime::kAbort), R(10), U8(1),
+ /* 32 S> */ B(LdaContextSlot), R(1), U8(8), U8(0),
+ B(Star), R(11),
+ B(LdaNamedProperty), R(11), U8(3), U8(9),
+ B(Star), R(10),
+ /* 32 E> */ B(CallProperty), R(10), R(11), U8(1), U8(7),
+ /* 32 E> */ B(StaContextSlot), R(1), U8(9), U8(0),
+ B(Star), R(10),
+ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(10), U8(1),
+ B(ToBooleanLogicalNot),
+ B(JumpIfFalse), U8(13),
+ B(LdaContextSlot), R(1), U8(9), U8(0),
+ B(Star), R(10),
+ B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
+ B(LdaContextSlot), R(1), U8(9), U8(0),
+ B(Star), R(10),
+ B(LdaNamedProperty), R(10), U8(4), U8(11),
+ B(JumpIfToBooleanTrue), U8(170),
+ B(LdaContextSlot), R(1), U8(9), U8(0),
+ B(Star), R(10),
+ B(LdaNamedProperty), R(10), U8(5), U8(13),
+ B(StaContextSlot), R(1), U8(11), U8(0),
+ B(LdaSmi), I8(2),
+ B(StaContextSlot), R(1), U8(10), U8(0),
+ B(LdaContextSlot), R(1), U8(11), U8(0),
+ B(StaContextSlot), R(1), U8(7), U8(0),
+ /* 21 E> */ B(StackCheck),
+ B(Ldar), R(closure),
+ B(CreateBlockContext), U8(6),
+ B(PushContext), R(2),
+ B(LdaTheHole),
+ B(StaCurrentContextSlot), U8(4),
+ B(LdaContextSlot), R(1), U8(7), U8(0),
+ B(StaCurrentContextSlot), U8(4),
+ /* 41 S> */ B(LdaContextSlot), R(1), U8(4), U8(0),
+ B(Star), R(10),
+ /* 47 S> */ B(LdaCurrentContextSlot), U8(4),
+ B(StaContextSlot), R(1), U8(6), U8(0),
+ /* 41 S> */ B(LdaUndefined),
+ B(Star), R(11),
+ B(LdaContextSlot), R(1), U8(4), U8(0),
+ B(Star), R(12),
+ B(LdaContextSlot), R(1), U8(6), U8(0),
+ B(Star), R(13),
+ B(LdaContextSlot), R(1), U8(5), U8(0),
+ B(Star), R(14),
+ B(CallJSRuntime), U8(%UnknownIntrinsicIndex), R(11), U8(4),
+ B(LdaContextSlot), R(1), U8(5), U8(0),
+ B(Star), R(11),
+ B(LdaZero),
+ B(SuspendGenerator), R(10),
+ B(Ldar), R(11),
+ /* 49 S> */ B(Return),
+ B(LdaSmi), I8(-2),
+ B(Star), R(3),
+ B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(10), U8(1),
+ B(Star), R(12),
+ B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(10), U8(1),
+ B(Star), R(13),
+ B(LdaZero),
+ B(TestEqualStrict), R(13), U8(0),
+ B(JumpIfTrue), U8(43),
+ B(LdaSmi), I8(2),
+ B(TestEqualStrict), R(13), U8(0),
+ B(JumpIfTrue), U8(33),
+ B(Jump), U8(2),
+ B(LdaTrue),
+ B(Star), R(15),
+ B(Mov), R(12), R(14),
+ B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(14), U8(2),
+ B(PopContext), R(2),
+ B(PopContext), R(2),
+ B(PopContext), R(2),
+ B(PopContext), R(2),
+ B(PopContext), R(2),
+ B(PopContext), R(2),
+ B(Star), R(7),
+ B(LdaZero),
+ B(Star), R(6),
+ B(Jump), U8(75),
+ B(Ldar), R(12),
+ B(ReThrow),
+ B(PopContext), R(2),
+ B(LdaZero),
+ B(StaContextSlot), R(1), U8(10), U8(0),
+ B(JumpLoop), U8(240), I8(0),
+ B(Jump), U8(48),
+ B(Star), R(10),
+ B(Ldar), R(closure),
+ B(CreateCatchContext), R(10), U8(7), U8(8),
+ B(Star), R(9),
+ B(LdaTheHole),
+ B(SetPendingMessage),
+ B(Ldar), R(9),
+ B(PushContext), R(2),
+ B(LdaContextSlot), R(1), U8(10), U8(0),
+ B(Star), R(10),
+ B(LdaSmi), I8(2),
+ B(TestEqualStrict), R(10), U8(15),
+ B(JumpIfFalse), U8(8),
+ B(LdaSmi), I8(1),
+ B(StaContextSlot), R(1), U8(10), U8(0),
+ B(LdaCurrentContextSlot), U8(4),
+ B(Star), R(10),
+ B(CallRuntime), U16(Runtime::kReThrow), R(10), U8(1),
+ B(PopContext), R(2),
+ B(LdaSmi), I8(-1),
+ B(Star), R(6),
+ B(Jump), U8(8),
+ B(Star), R(7),
+ B(LdaSmi), I8(1),
+ B(Star), R(6),
+ B(LdaTheHole),
+ B(SetPendingMessage),
+ B(Star), R(8),
+ B(LdaContextSlot), R(1), U8(10), U8(0),
+ B(Star), R(9),
+ B(LdaZero),
+ B(TestEqualStrict), R(9), U8(16),
+ B(JumpIfTrue), U8(159),
+ B(LdaContextSlot), R(1), U8(8), U8(0),
+ B(Star), R(9),
+ B(LdaNamedProperty), R(9), U8(9), U8(17),
+ B(StaContextSlot), R(1), U8(12), U8(0),
+ B(LdaContextSlot), R(1), U8(12), U8(0),
+ B(Star), R(9),
+ B(TestUndetectable), R(9),
+ B(JumpIfFalse), U8(4),
+ B(Jump), U8(133),
+ B(LdaContextSlot), R(1), U8(10), U8(0),
+ B(Star), R(9),
+ B(LdaSmi), I8(1),
+ B(TestEqualStrict), R(9), U8(20),
+ B(JumpIfFalse), U8(75),
+ B(LdaContextSlot), R(1), U8(12), U8(0),
+ B(TypeOf),
+ B(Star), R(9),
+ B(LdaConstant), U8(10),
+ B(TestEqualStrict), R(9), U8(21),
+ B(JumpIfFalse), U8(4),
+ B(Jump), U8(18),
+ B(Wide), B(LdaSmi), I16(131),
+ B(Star), R(9),
+ B(LdaConstant), U8(11),
+ B(Star), R(10),
+ B(CallRuntime), U16(Runtime::kNewTypeError), R(9), U8(2),
+ B(Throw),
+ B(Mov), R(context), R(9),
+ B(LdaContextSlot), R(1), U8(12), U8(0),
+ B(Star), R(10),
+ B(LdaContextSlot), R(1), U8(8), U8(0),
+ B(Star), R(11),
+ B(InvokeIntrinsic), U8(Runtime::k_Call), R(10), U8(2),
+ B(Jump), U8(20),
+ B(Star), R(10),
+ B(Ldar), R(closure),
+ B(CreateCatchContext), R(10), U8(7), U8(12),
+ B(Star), R(9),
+ B(LdaTheHole),
+ B(SetPendingMessage),
+ B(Ldar), R(9),
+ B(PushContext), R(2),
+ B(PopContext), R(2),
+ B(Jump), U8(47),
+ B(LdaContextSlot), R(1), U8(12), U8(0),
+ B(Star), R(9),
+ B(LdaContextSlot), R(1), U8(8), U8(0),
+ B(Star), R(10),
+ B(InvokeIntrinsic), U8(Runtime::k_Call), R(9), U8(2),
+ B(StaContextSlot), R(1), U8(13), U8(0),
+ B(LdaContextSlot), R(1), U8(13), U8(0),
+ B(Star), R(9),
+ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(9), U8(1),
+ B(JumpIfToBooleanFalse), U8(4),
+ B(Jump), U8(13),
+ B(LdaContextSlot), R(1), U8(13), U8(0),
+ B(Star), R(9),
+ B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(9), U8(1),
+ B(Ldar), R(8),
+ B(SetPendingMessage),
+ B(LdaZero),
+ B(TestEqualStrict), R(6), U8(0),
+ B(JumpIfTrue), U8(11),
+ B(LdaSmi), I8(1),
+ B(TestEqualStrict), R(6), U8(0),
+ B(JumpIfTrue), U8(11),
+ B(Jump), U8(14),
+ B(PopContext), R(1),
+ B(PopContext), R(0),
+ B(Ldar), R(7),
+ /* 49 S> */ B(Return),
+ B(PopContext), R(1),
+ B(Ldar), R(7),
+ B(ReThrow),
+ B(PopContext), R(1),
+ B(LdaUndefined),
+ B(Star), R(6),
+ B(LdaCurrentContextSlot), U8(5),
+ B(Star), R(7),
+ B(LdaUndefined),
+ B(Star), R(8),
+ B(CallJSRuntime), U8(%promise_resolve), R(6), U8(3),
+ B(LdaCurrentContextSlot), U8(5),
+ /* 49 S> */ B(Return),
+ B(Jump), U8(23),
+ B(Star), R(8),
+ B(LdaTheHole),
+ B(SetPendingMessage),
+ B(LdaCurrentContextSlot), U8(5),
+ B(Star), R(7),
+ B(LdaUndefined),
+ B(Star), R(6),
+ B(LdaFalse),
+ B(Star), R(9),
+ B(CallJSRuntime), U8(%promise_internal_reject), R(6), U8(4),
+ B(Ldar), R(7),
+ /* 49 S> */ B(Return),
+ B(LdaUndefined),
+ /* 49 S> */ B(Return),
+]
+constant pool: [
+ FIXED_ARRAY_TYPE,
+ CONSTANT_ELEMENTS_PAIR_TYPE,
+ SYMBOL_TYPE,
+ ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
+ ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
+ ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
+ FIXED_ARRAY_TYPE,
+ ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"],
+ FIXED_ARRAY_TYPE,
+ ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],
+ ONE_BYTE_INTERNALIZED_STRING_TYPE ["function"],
+ ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
+ FIXED_ARRAY_TYPE,
+]
+handlers: [
+ [51, 640, 642],
+ [84, 406, 412],
+ [87, 358, 360],
+ [508, 524, 526],
+]
+

Powered by Google App Engine
This is Rietveld 408576698