2016-04-18 14:13:04 +00:00
|
|
|
#
|
|
|
|
# Autogenerated by generate-bytecode-expectations.
|
|
|
|
#
|
|
|
|
|
|
|
|
---
|
|
|
|
wrap: no
|
|
|
|
test function name: f
|
|
|
|
|
|
|
|
---
|
|
|
|
snippet: "
|
|
|
|
function* f() { }
|
2016-05-24 12:51:18 +00:00
|
|
|
f();
|
2016-04-18 14:13:04 +00:00
|
|
|
"
|
2017-01-17 13:44:10 +00:00
|
|
|
frame size: 12
|
2016-04-18 14:13:04 +00:00
|
|
|
parameter count: 1
|
2017-05-09 16:49:04 +00:00
|
|
|
bytecode array length: 196
|
2016-04-18 14:13:04 +00:00
|
|
|
bytecodes: [
|
2016-05-11 12:21:56 +00:00
|
|
|
B(Ldar), R(new_target),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(JumpIfUndefined), U8(27),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(CallRuntime), U16(Runtime::k_GeneratorGetContext), R(new_target), U8(1),
|
|
|
|
B(PushContext), R(2),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(ResumeGenerator), R(new_target),
|
|
|
|
B(Star), R(1),
|
|
|
|
B(LdaZero),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(1),
|
2017-05-05 18:33:00 +00:00
|
|
|
B(JumpIfTrue), U8(53),
|
2017-04-11 09:33:11 +00:00
|
|
|
B(LdaSmi), I8(79),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(3),
|
|
|
|
B(CallRuntime), U16(Runtime::kAbort), R(3), U8(1),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(-2),
|
2016-08-17 15:03:19 +00:00
|
|
|
B(Star), R(1),
|
2016-08-03 14:41:47 +00:00
|
|
|
B(CreateFunctionContext), U8(2),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(PushContext), R(0),
|
|
|
|
B(Ldar), R(this),
|
2016-10-28 10:10:32 +00:00
|
|
|
B(StaCurrentContextSlot), U8(4),
|
2016-05-11 12:21:56 +00:00
|
|
|
/* 11 E> */ B(StackCheck),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Mov), R(context), R(5),
|
2017-02-07 20:42:03 +00:00
|
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(7),
|
|
|
|
B(Mov), R(closure), R(6),
|
2017-05-05 18:33:00 +00:00
|
|
|
/* 11 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(6), U8(2),
|
2016-10-28 10:10:32 +00:00
|
|
|
B(StaCurrentContextSlot), U8(5),
|
2016-11-10 10:41:48 +00:00
|
|
|
B(Star), R(6),
|
2017-02-07 20:42:03 +00:00
|
|
|
B(LdaImmutableCurrentContextSlot), U8(5),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(7),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaZero),
|
[async-iteration] implement AsyncGenerator
- Introduce new struct AsyncGeneratorRequest, which holds
information pertinent to resuming execution of an
AsyncGenerator, such as the Promise associated with the async
generator request. It is intended to be used as a singly
linked list, and holds a pointer to the next item in te queue.
- Introduce JSAsyncGeneratorObject (subclass of
JSGeneratorObject), which includes several new internal fields
(`queue` which contains a singly linked list of
AsyncGeneratorRequest objects, and `await_input` which
contains the sent value from an Await expression (This is
necessary to prevent function.sent (used by yield*) from
having the sent value observably overwritten during
execution).
- Modify SuspendGenerator to accept a set of Flags, which
indicate whether the suspend is for a Yield or Await, and
whether it takes place on an async generator or ES6
generator.
- Introduce interpreter intrinsics and TF intrinsic lowering for
accessing the await input of an async generator
- Modify the JSGeneratorStore operator to understand whether or
not it's suspending for a normal yield, or an AsyncGenerator
Await. This ensures appropriate registers are stored.
- Add versions of ResumeGeneratorTrampoline which store the
input value in a different field depending on wether it's an
AsyncGenerator Await resume, or an ordinary resume. Also modifies
whether debug code will assert that the generator object is a
JSGeneratorObject or a JSAsyncGeneratorObject depending on the
resume type.
BUG=v8:5855
R=bmeurer@chromium.org, rmcilroy@chromium.org, jgruber@chromium.org,
littledan@chromium.org, neis@chromium.org
TBR=marja@chromium.org
Change-Id: I9d58df1d344465fc937fe7eed322424204497187
Reviewed-on: https://chromium-review.googlesource.com/446961
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44240}
2017-03-29 13:41:45 +00:00
|
|
|
B(SuspendGenerator), R(7), U8(0),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(6),
|
2016-06-10 13:28:34 +00:00
|
|
|
/* 16 S> */ B(Return),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(-2),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(Star), R(1),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(7), U8(1),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(Star), R(8),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(7), U8(1),
|
|
|
|
B(Star), R(9),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaZero),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(9),
|
2017-05-09 16:49:04 +00:00
|
|
|
B(JumpIfTrue), U8(28),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(2),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(9),
|
2017-05-09 16:49:04 +00:00
|
|
|
B(JumpIfTrue), U8(19),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaTrue),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(11),
|
|
|
|
B(Mov), R(8), R(10),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(10), U8(2),
|
|
|
|
B(Star), R(4),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaZero),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(3),
|
2017-01-11 11:34:02 +00:00
|
|
|
B(Jump), U8(35),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(8),
|
2016-06-10 13:28:34 +00:00
|
|
|
/* 11 E> */ B(Throw),
|
2016-11-10 10:41:48 +00:00
|
|
|
B(LdaUndefined),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(Star), R(6),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(LdaTrue),
|
|
|
|
B(Star), R(7),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(6), U8(2),
|
|
|
|
B(Star), R(4),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(1),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(3),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(Jump), U8(14),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(-1),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(Star), R(3),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Jump), U8(8),
|
|
|
|
B(Star), R(4),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(2),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(3),
|
2016-11-16 10:46:23 +00:00
|
|
|
B(LdaTheHole),
|
|
|
|
B(SetPendingMessage),
|
2016-11-10 10:41:48 +00:00
|
|
|
B(Star), R(5),
|
2017-02-07 20:42:03 +00:00
|
|
|
B(LdaImmutableCurrentContextSlot), U8(5),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(6),
|
|
|
|
B(CallRuntime), U16(Runtime::k_GeneratorClose), R(6), U8(1),
|
|
|
|
B(Ldar), R(5),
|
2016-11-16 10:46:23 +00:00
|
|
|
B(SetPendingMessage),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaZero),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(3),
|
|
|
|
B(JumpIfTrue), U8(16),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(1),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(3),
|
|
|
|
B(JumpIfTrue), U8(13),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(2),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(3),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(JumpIfTrue), U8(10),
|
|
|
|
B(Jump), U8(11),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(4),
|
2016-05-11 12:21:56 +00:00
|
|
|
/* 16 S> */ B(Return),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(4),
|
2016-05-11 12:21:56 +00:00
|
|
|
/* 16 S> */ B(Return),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(4),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(ReThrow),
|
|
|
|
B(LdaUndefined),
|
|
|
|
/* 16 S> */ B(Return),
|
2016-04-18 14:13:04 +00:00
|
|
|
]
|
|
|
|
constant pool: [
|
|
|
|
]
|
|
|
|
handlers: [
|
2017-05-09 16:49:04 +00:00
|
|
|
[45, 138, 144],
|
2016-04-18 14:13:04 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
---
|
|
|
|
snippet: "
|
|
|
|
function* f() { yield 42 }
|
2016-05-24 12:51:18 +00:00
|
|
|
f();
|
2016-04-18 14:13:04 +00:00
|
|
|
"
|
2017-01-17 13:44:10 +00:00
|
|
|
frame size: 12
|
2016-04-18 14:13:04 +00:00
|
|
|
parameter count: 1
|
2017-05-09 16:49:04 +00:00
|
|
|
bytecode array length: 286
|
2016-04-18 14:13:04 +00:00
|
|
|
bytecodes: [
|
2016-05-11 12:21:56 +00:00
|
|
|
B(Ldar), R(new_target),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(JumpIfUndefined), U8(33),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(CallRuntime), U16(Runtime::k_GeneratorGetContext), R(new_target), U8(1),
|
|
|
|
B(PushContext), R(2),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(ResumeGenerator), R(new_target),
|
|
|
|
B(Star), R(1),
|
|
|
|
B(LdaZero),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(1),
|
2017-05-05 18:33:00 +00:00
|
|
|
B(JumpIfTrue), U8(59),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(1),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(1),
|
2017-05-09 16:49:04 +00:00
|
|
|
B(JumpIfTrue), U8(127),
|
2017-04-11 09:33:11 +00:00
|
|
|
B(LdaSmi), I8(79),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(3),
|
|
|
|
B(CallRuntime), U16(Runtime::kAbort), R(3), U8(1),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(-2),
|
2016-08-17 15:03:19 +00:00
|
|
|
B(Star), R(1),
|
2016-08-03 14:41:47 +00:00
|
|
|
B(CreateFunctionContext), U8(2),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(PushContext), R(0),
|
|
|
|
B(Ldar), R(this),
|
2016-10-28 10:10:32 +00:00
|
|
|
B(StaCurrentContextSlot), U8(4),
|
2016-05-11 12:21:56 +00:00
|
|
|
/* 11 E> */ B(StackCheck),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Mov), R(context), R(5),
|
2017-02-07 20:42:03 +00:00
|
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(7),
|
|
|
|
B(Mov), R(closure), R(6),
|
2017-05-05 18:33:00 +00:00
|
|
|
/* 11 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(6), U8(2),
|
2016-10-28 10:10:32 +00:00
|
|
|
B(StaCurrentContextSlot), U8(5),
|
2016-11-10 10:41:48 +00:00
|
|
|
B(Star), R(6),
|
2017-02-07 20:42:03 +00:00
|
|
|
B(LdaImmutableCurrentContextSlot), U8(5),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(7),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaZero),
|
[async-iteration] implement AsyncGenerator
- Introduce new struct AsyncGeneratorRequest, which holds
information pertinent to resuming execution of an
AsyncGenerator, such as the Promise associated with the async
generator request. It is intended to be used as a singly
linked list, and holds a pointer to the next item in te queue.
- Introduce JSAsyncGeneratorObject (subclass of
JSGeneratorObject), which includes several new internal fields
(`queue` which contains a singly linked list of
AsyncGeneratorRequest objects, and `await_input` which
contains the sent value from an Await expression (This is
necessary to prevent function.sent (used by yield*) from
having the sent value observably overwritten during
execution).
- Modify SuspendGenerator to accept a set of Flags, which
indicate whether the suspend is for a Yield or Await, and
whether it takes place on an async generator or ES6
generator.
- Introduce interpreter intrinsics and TF intrinsic lowering for
accessing the await input of an async generator
- Modify the JSGeneratorStore operator to understand whether or
not it's suspending for a normal yield, or an AsyncGenerator
Await. This ensures appropriate registers are stored.
- Add versions of ResumeGeneratorTrampoline which store the
input value in a different field depending on wether it's an
AsyncGenerator Await resume, or an ordinary resume. Also modifies
whether debug code will assert that the generator object is a
JSGeneratorObject or a JSAsyncGeneratorObject depending on the
resume type.
BUG=v8:5855
R=bmeurer@chromium.org, rmcilroy@chromium.org, jgruber@chromium.org,
littledan@chromium.org, neis@chromium.org
TBR=marja@chromium.org
Change-Id: I9d58df1d344465fc937fe7eed322424204497187
Reviewed-on: https://chromium-review.googlesource.com/446961
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44240}
2017-03-29 13:41:45 +00:00
|
|
|
B(SuspendGenerator), R(7), U8(0),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(6),
|
2016-06-10 13:28:34 +00:00
|
|
|
/* 25 S> */ B(Return),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(-2),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(Star), R(1),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(7), U8(1),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(Star), R(8),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(7), U8(1),
|
|
|
|
B(Star), R(9),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaZero),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(9),
|
2017-05-09 16:49:04 +00:00
|
|
|
B(JumpIfTrue), U8(28),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(2),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(9),
|
2017-05-09 16:49:04 +00:00
|
|
|
B(JumpIfTrue), U8(19),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaTrue),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(11),
|
|
|
|
B(Mov), R(8), R(10),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(10), U8(2),
|
|
|
|
B(Star), R(4),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaZero),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(3),
|
2017-05-09 16:49:04 +00:00
|
|
|
B(Jump), U8(110),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(8),
|
2016-06-10 13:28:34 +00:00
|
|
|
/* 11 E> */ B(Throw),
|
2017-01-25 17:39:24 +00:00
|
|
|
/* 16 S> */ B(LdaSmi), I8(42),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(6),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaFalse),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(7),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(6), U8(2),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(Star), R(6),
|
2017-02-07 20:42:03 +00:00
|
|
|
B(LdaImmutableCurrentContextSlot), U8(5),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(7),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(1),
|
[async-iteration] implement AsyncGenerator
- Introduce new struct AsyncGeneratorRequest, which holds
information pertinent to resuming execution of an
AsyncGenerator, such as the Promise associated with the async
generator request. It is intended to be used as a singly
linked list, and holds a pointer to the next item in te queue.
- Introduce JSAsyncGeneratorObject (subclass of
JSGeneratorObject), which includes several new internal fields
(`queue` which contains a singly linked list of
AsyncGeneratorRequest objects, and `await_input` which
contains the sent value from an Await expression (This is
necessary to prevent function.sent (used by yield*) from
having the sent value observably overwritten during
execution).
- Modify SuspendGenerator to accept a set of Flags, which
indicate whether the suspend is for a Yield or Await, and
whether it takes place on an async generator or ES6
generator.
- Introduce interpreter intrinsics and TF intrinsic lowering for
accessing the await input of an async generator
- Modify the JSGeneratorStore operator to understand whether or
not it's suspending for a normal yield, or an AsyncGenerator
Await. This ensures appropriate registers are stored.
- Add versions of ResumeGeneratorTrampoline which store the
input value in a different field depending on wether it's an
AsyncGenerator Await resume, or an ordinary resume. Also modifies
whether debug code will assert that the generator object is a
JSGeneratorObject or a JSAsyncGeneratorObject depending on the
resume type.
BUG=v8:5855
R=bmeurer@chromium.org, rmcilroy@chromium.org, jgruber@chromium.org,
littledan@chromium.org, neis@chromium.org
TBR=marja@chromium.org
Change-Id: I9d58df1d344465fc937fe7eed322424204497187
Reviewed-on: https://chromium-review.googlesource.com/446961
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44240}
2017-03-29 13:41:45 +00:00
|
|
|
B(SuspendGenerator), R(7), U8(0),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(6),
|
2016-06-10 13:28:34 +00:00
|
|
|
/* 25 S> */ B(Return),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(-2),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(Star), R(1),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(7), U8(1),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(Star), R(8),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(7), U8(1),
|
|
|
|
B(Star), R(9),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaZero),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(9),
|
2017-05-09 16:49:04 +00:00
|
|
|
B(JumpIfTrue), U8(29),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(2),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(9),
|
2017-05-09 16:49:04 +00:00
|
|
|
B(JumpIfTrue), U8(20),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaTrue),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(11),
|
|
|
|
B(Mov), R(8), R(10),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(10), U8(2),
|
|
|
|
B(Star), R(4),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(1),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(3),
|
2017-01-11 11:34:02 +00:00
|
|
|
B(Jump), U8(35),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(8),
|
2016-06-10 13:28:34 +00:00
|
|
|
/* 16 E> */ B(Throw),
|
2016-11-10 10:41:48 +00:00
|
|
|
B(LdaUndefined),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(Star), R(6),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(LdaTrue),
|
|
|
|
B(Star), R(7),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(6), U8(2),
|
|
|
|
B(Star), R(4),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(2),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(3),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(Jump), U8(14),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(-1),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(Star), R(3),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Jump), U8(8),
|
|
|
|
B(Star), R(4),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(3),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(3),
|
2016-11-16 10:46:23 +00:00
|
|
|
B(LdaTheHole),
|
|
|
|
B(SetPendingMessage),
|
2016-11-10 10:41:48 +00:00
|
|
|
B(Star), R(5),
|
2017-02-07 20:42:03 +00:00
|
|
|
B(LdaImmutableCurrentContextSlot), U8(5),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(6),
|
|
|
|
B(CallRuntime), U16(Runtime::k_GeneratorClose), R(6), U8(1),
|
|
|
|
B(Ldar), R(5),
|
2016-11-16 10:46:23 +00:00
|
|
|
B(SetPendingMessage),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaZero),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(3),
|
|
|
|
B(JumpIfTrue), U8(22),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(1),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(3),
|
|
|
|
B(JumpIfTrue), U8(19),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(2),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(3),
|
|
|
|
B(JumpIfTrue), U8(16),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(3),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(3),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(JumpIfTrue), U8(13),
|
|
|
|
B(Jump), U8(14),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(4),
|
2016-05-11 12:21:56 +00:00
|
|
|
/* 25 S> */ B(Return),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(4),
|
2016-05-11 12:21:56 +00:00
|
|
|
/* 25 S> */ B(Return),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(4),
|
2016-05-11 12:21:56 +00:00
|
|
|
/* 25 S> */ B(Return),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(4),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(ReThrow),
|
|
|
|
B(LdaUndefined),
|
|
|
|
/* 25 S> */ B(Return),
|
2016-04-18 14:13:04 +00:00
|
|
|
]
|
|
|
|
constant pool: [
|
|
|
|
]
|
|
|
|
handlers: [
|
2017-05-09 16:49:04 +00:00
|
|
|
[51, 219, 225],
|
2016-04-18 14:13:04 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
---
|
|
|
|
snippet: "
|
|
|
|
function* f() { for (let x of [42]) yield x }
|
2016-05-24 12:51:18 +00:00
|
|
|
f();
|
2016-04-18 14:13:04 +00:00
|
|
|
"
|
2017-01-17 13:44:10 +00:00
|
|
|
frame size: 18
|
2016-04-18 14:13:04 +00:00
|
|
|
parameter count: 1
|
2017-05-09 16:49:04 +00:00
|
|
|
bytecode array length: 746
|
2016-04-18 14:13:04 +00:00
|
|
|
bytecodes: [
|
2016-05-11 12:21:56 +00:00
|
|
|
B(Ldar), R(new_target),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(JumpIfUndefined), U8(33),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(CallRuntime), U16(Runtime::k_GeneratorGetContext), R(new_target), U8(1),
|
|
|
|
B(PushContext), R(4),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(ResumeGenerator), R(new_target),
|
2016-11-24 09:47:57 +00:00
|
|
|
B(Star), R(3),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaZero),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(3),
|
2017-05-05 18:33:00 +00:00
|
|
|
B(JumpIfTrue), U8(59),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(1),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(3),
|
2017-05-09 16:49:04 +00:00
|
|
|
B(JumpIfTrue), U8(149),
|
2017-04-11 09:33:11 +00:00
|
|
|
B(LdaSmi), I8(79),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(5),
|
|
|
|
B(CallRuntime), U16(Runtime::kAbort), R(5), U8(1),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(-2),
|
2016-11-24 09:47:57 +00:00
|
|
|
B(Star), R(3),
|
2016-08-03 14:41:47 +00:00
|
|
|
B(CreateFunctionContext), U8(9),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(PushContext), R(0),
|
|
|
|
B(Ldar), R(this),
|
2016-10-28 10:10:32 +00:00
|
|
|
B(StaCurrentContextSlot), U8(4),
|
2016-05-11 12:21:56 +00:00
|
|
|
/* 11 E> */ B(StackCheck),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Mov), R(context), R(7),
|
2017-02-07 20:42:03 +00:00
|
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(9),
|
|
|
|
B(Mov), R(closure), R(8),
|
2017-05-05 18:33:00 +00:00
|
|
|
/* 11 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(8), U8(2),
|
2016-11-24 09:47:57 +00:00
|
|
|
B(StaCurrentContextSlot), U8(5),
|
|
|
|
B(Star), R(8),
|
2017-02-07 20:42:03 +00:00
|
|
|
B(LdaImmutableCurrentContextSlot), U8(5),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(9),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaZero),
|
[async-iteration] implement AsyncGenerator
- Introduce new struct AsyncGeneratorRequest, which holds
information pertinent to resuming execution of an
AsyncGenerator, such as the Promise associated with the async
generator request. It is intended to be used as a singly
linked list, and holds a pointer to the next item in te queue.
- Introduce JSAsyncGeneratorObject (subclass of
JSGeneratorObject), which includes several new internal fields
(`queue` which contains a singly linked list of
AsyncGeneratorRequest objects, and `await_input` which
contains the sent value from an Await expression (This is
necessary to prevent function.sent (used by yield*) from
having the sent value observably overwritten during
execution).
- Modify SuspendGenerator to accept a set of Flags, which
indicate whether the suspend is for a Yield or Await, and
whether it takes place on an async generator or ES6
generator.
- Introduce interpreter intrinsics and TF intrinsic lowering for
accessing the await input of an async generator
- Modify the JSGeneratorStore operator to understand whether or
not it's suspending for a normal yield, or an AsyncGenerator
Await. This ensures appropriate registers are stored.
- Add versions of ResumeGeneratorTrampoline which store the
input value in a different field depending on wether it's an
AsyncGenerator Await resume, or an ordinary resume. Also modifies
whether debug code will assert that the generator object is a
JSGeneratorObject or a JSAsyncGeneratorObject depending on the
resume type.
BUG=v8:5855
R=bmeurer@chromium.org, rmcilroy@chromium.org, jgruber@chromium.org,
littledan@chromium.org, neis@chromium.org
TBR=marja@chromium.org
Change-Id: I9d58df1d344465fc937fe7eed322424204497187
Reviewed-on: https://chromium-review.googlesource.com/446961
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44240}
2017-03-29 13:41:45 +00:00
|
|
|
B(SuspendGenerator), R(9), U8(0),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(8),
|
2016-06-10 13:28:34 +00:00
|
|
|
/* 44 S> */ B(Return),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(-2),
|
2016-11-24 09:47:57 +00:00
|
|
|
B(Star), R(3),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(9), U8(1),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(Star), R(10),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(9), U8(1),
|
|
|
|
B(Star), R(11),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaZero),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(11),
|
2017-05-09 16:49:04 +00:00
|
|
|
B(JumpIfTrue), U8(28),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(2),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(11),
|
2017-05-09 16:49:04 +00:00
|
|
|
B(JumpIfTrue), U8(19),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaTrue),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(13),
|
|
|
|
B(Mov), R(10), R(12),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(12), U8(2),
|
|
|
|
B(Star), R(6),
|
2016-11-24 09:47:57 +00:00
|
|
|
B(LdaZero),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(5),
|
2017-03-15 11:29:12 +00:00
|
|
|
B(JumpConstant), U8(12),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(10),
|
2016-06-10 13:28:34 +00:00
|
|
|
/* 11 E> */ B(Throw),
|
2016-08-16 11:07:21 +00:00
|
|
|
B(Ldar), R(closure),
|
|
|
|
B(CreateBlockContext), U8(0),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(PushContext), R(1),
|
|
|
|
B(LdaTheHole),
|
2016-10-28 10:10:32 +00:00
|
|
|
B(StaCurrentContextSlot), U8(4),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaZero),
|
2016-09-13 11:09:00 +00:00
|
|
|
B(StaContextSlot), R(1), U8(9), U8(0),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(Mov), R(context), R(10),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Mov), R(context), R(11),
|
2017-05-09 21:45:33 +00:00
|
|
|
/* 30 S> */ B(CreateArrayLiteral), U8(1), U8(3), U8(17),
|
[ignition] desugar GetIterator() via bytecode rather than via AST
Introduces:
- a new AST node representing the GetIterator() algorithm in the specification, to be used by ForOfStatement, YieldExpression (in the case of delegating yield*), and the future `for-await-of` loop proposed in http://tc39.github.io/proposal-async-iteration/#sec-async-iterator-value-unwrap-functions.
- a new opcode (JumpIfJSReceiver), which is useful for `if Type(object) is not Object` checks which are common throughout the specification. This node is easily eliminated by TurboFan.
The AST node is desugared specially in bytecode, rather than manually when building the AST. The benefit of this is that desugaring in the BytecodeGenerator is much simpler and easier to understand than desugaring the AST.
This also reduces parse time very slightly, and allows us to use LoadIC rather than KeyedLoadIC, which seems to have better baseline performance. This results in a ~20% improvement in test/js-perf-test/Iterators micro-benchmarks, which I believe owes to the use of the slightly faster LoadIC as opposed to the KeyedLoadIC in the baseline case. Both produce identical optimized code via TurboFan when the type check can be eliminated, and the load can be replaced with a constant value.
BUG=v8:4280
R=bmeurer@chromium.org, rmcilroy@chromium.org, adamk@chromium.org, neis@chromium.org, jarin@chromium.org
TBR=rossberg@chromium.org
Review-Url: https://codereview.chromium.org/2557593004
Cr-Commit-Position: refs/heads/master@{#41555}
2016-12-07 15:19:52 +00:00
|
|
|
B(Star), R(12),
|
2017-05-09 21:45:33 +00:00
|
|
|
B(LdaNamedProperty), R(12), U8(2), U8(4),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(13),
|
2017-05-09 21:45:33 +00:00
|
|
|
B(CallProperty0), R(13), R(12), U8(6),
|
[ignition] desugar GetIterator() via bytecode rather than via AST
Introduces:
- a new AST node representing the GetIterator() algorithm in the specification, to be used by ForOfStatement, YieldExpression (in the case of delegating yield*), and the future `for-await-of` loop proposed in http://tc39.github.io/proposal-async-iteration/#sec-async-iterator-value-unwrap-functions.
- a new opcode (JumpIfJSReceiver), which is useful for `if Type(object) is not Object` checks which are common throughout the specification. This node is easily eliminated by TurboFan.
The AST node is desugared specially in bytecode, rather than manually when building the AST. The benefit of this is that desugaring in the BytecodeGenerator is much simpler and easier to understand than desugaring the AST.
This also reduces parse time very slightly, and allows us to use LoadIC rather than KeyedLoadIC, which seems to have better baseline performance. This results in a ~20% improvement in test/js-perf-test/Iterators micro-benchmarks, which I believe owes to the use of the slightly faster LoadIC as opposed to the KeyedLoadIC in the baseline case. Both produce identical optimized code via TurboFan when the type check can be eliminated, and the load can be replaced with a constant value.
BUG=v8:4280
R=bmeurer@chromium.org, rmcilroy@chromium.org, adamk@chromium.org, neis@chromium.org, jarin@chromium.org
TBR=rossberg@chromium.org
Review-Url: https://codereview.chromium.org/2557593004
Cr-Commit-Position: refs/heads/master@{#41555}
2016-12-07 15:19:52 +00:00
|
|
|
B(JumpIfJSReceiver), U8(7),
|
|
|
|
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
|
2016-09-13 11:09:00 +00:00
|
|
|
/* 30 E> */ B(StaContextSlot), R(1), U8(7), U8(0),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(-2),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(3),
|
|
|
|
B(JumpIfTrue), U8(17),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(1),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(3),
|
[async-iteration] implement AsyncGenerator
- Introduce new struct AsyncGeneratorRequest, which holds
information pertinent to resuming execution of an
AsyncGenerator, such as the Promise associated with the async
generator request. It is intended to be used as a singly
linked list, and holds a pointer to the next item in te queue.
- Introduce JSAsyncGeneratorObject (subclass of
JSGeneratorObject), which includes several new internal fields
(`queue` which contains a singly linked list of
AsyncGeneratorRequest objects, and `await_input` which
contains the sent value from an Await expression (This is
necessary to prevent function.sent (used by yield*) from
having the sent value observably overwritten during
execution).
- Modify SuspendGenerator to accept a set of Flags, which
indicate whether the suspend is for a Yield or Await, and
whether it takes place on an async generator or ES6
generator.
- Introduce interpreter intrinsics and TF intrinsic lowering for
accessing the await input of an async generator
- Modify the JSGeneratorStore operator to understand whether or
not it's suspending for a normal yield, or an AsyncGenerator
Await. This ensures appropriate registers are stored.
- Add versions of ResumeGeneratorTrampoline which store the
input value in a different field depending on wether it's an
AsyncGenerator Await resume, or an ordinary resume. Also modifies
whether debug code will assert that the generator object is a
JSGeneratorObject or a JSAsyncGeneratorObject depending on the
resume type.
BUG=v8:5855
R=bmeurer@chromium.org, rmcilroy@chromium.org, jgruber@chromium.org,
littledan@chromium.org, neis@chromium.org
TBR=marja@chromium.org
Change-Id: I9d58df1d344465fc937fe7eed322424204497187
Reviewed-on: https://chromium-review.googlesource.com/446961
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44240}
2017-03-29 13:41:45 +00:00
|
|
|
B(JumpIfTrue), U8(134),
|
2017-04-11 09:33:11 +00:00
|
|
|
B(LdaSmi), I8(79),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(12),
|
|
|
|
B(CallRuntime), U16(Runtime::kAbort), R(12), U8(1),
|
2016-11-10 10:41:48 +00:00
|
|
|
/* 27 S> */ B(LdaContextSlot), R(1), U8(7), U8(0),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(13),
|
2017-05-09 21:45:33 +00:00
|
|
|
B(LdaNamedProperty), R(13), U8(3), U8(10),
|
2016-11-23 15:23:00 +00:00
|
|
|
B(Star), R(12),
|
2017-05-09 21:45:33 +00:00
|
|
|
/* 27 E> */ B(CallProperty0), R(12), R(13), U8(8),
|
2016-11-24 09:47:57 +00:00
|
|
|
/* 27 E> */ B(StaContextSlot), R(1), U8(8), U8(0),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(12),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(12), U8(1),
|
2016-05-17 20:39:45 +00:00
|
|
|
B(ToBooleanLogicalNot),
|
2016-11-10 10:41:48 +00:00
|
|
|
B(JumpIfFalse), U8(13),
|
|
|
|
B(LdaContextSlot), R(1), U8(8), U8(0),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(12),
|
|
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(12), U8(1),
|
2016-11-10 10:41:48 +00:00
|
|
|
B(LdaContextSlot), R(1), U8(8), U8(0),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(12),
|
2017-05-09 21:45:33 +00:00
|
|
|
B(LdaNamedProperty), R(12), U8(4), U8(12),
|
2017-05-09 16:49:04 +00:00
|
|
|
B(JumpIfToBooleanTrue), U8(144),
|
2016-11-10 10:41:48 +00:00
|
|
|
B(LdaContextSlot), R(1), U8(8), U8(0),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(12),
|
2017-05-09 21:45:33 +00:00
|
|
|
B(LdaNamedProperty), R(12), U8(5), U8(14),
|
2016-09-13 11:09:00 +00:00
|
|
|
B(StaContextSlot), R(1), U8(10), U8(0),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(2),
|
2016-09-13 11:09:00 +00:00
|
|
|
B(StaContextSlot), R(1), U8(9), U8(0),
|
|
|
|
B(LdaContextSlot), R(1), U8(10), U8(0),
|
|
|
|
B(StaContextSlot), R(1), U8(6), U8(0),
|
2016-05-11 12:21:56 +00:00
|
|
|
/* 16 E> */ B(StackCheck),
|
2016-08-16 11:07:21 +00:00
|
|
|
B(Ldar), R(closure),
|
2017-01-24 22:09:02 +00:00
|
|
|
B(CreateBlockContext), U8(6),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(PushContext), R(2),
|
|
|
|
B(LdaTheHole),
|
2016-10-28 10:10:32 +00:00
|
|
|
B(StaCurrentContextSlot), U8(4),
|
2016-09-13 11:09:00 +00:00
|
|
|
B(LdaContextSlot), R(1), U8(6), U8(0),
|
2016-10-28 10:10:32 +00:00
|
|
|
B(StaCurrentContextSlot), U8(4),
|
2017-02-07 20:42:03 +00:00
|
|
|
/* 36 S> */ B(LdaImmutableCurrentContextSlot), U8(4),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(12),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaFalse),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(13),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(12), U8(2),
|
2016-09-30 09:02:59 +00:00
|
|
|
B(Star), R(12),
|
2017-02-07 20:42:03 +00:00
|
|
|
B(LdaImmutableContextSlot), R(1), U8(5), U8(0),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(13),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(1),
|
[async-iteration] implement AsyncGenerator
- Introduce new struct AsyncGeneratorRequest, which holds
information pertinent to resuming execution of an
AsyncGenerator, such as the Promise associated with the async
generator request. It is intended to be used as a singly
linked list, and holds a pointer to the next item in te queue.
- Introduce JSAsyncGeneratorObject (subclass of
JSGeneratorObject), which includes several new internal fields
(`queue` which contains a singly linked list of
AsyncGeneratorRequest objects, and `await_input` which
contains the sent value from an Await expression (This is
necessary to prevent function.sent (used by yield*) from
having the sent value observably overwritten during
execution).
- Modify SuspendGenerator to accept a set of Flags, which
indicate whether the suspend is for a Yield or Await, and
whether it takes place on an async generator or ES6
generator.
- Introduce interpreter intrinsics and TF intrinsic lowering for
accessing the await input of an async generator
- Modify the JSGeneratorStore operator to understand whether or
not it's suspending for a normal yield, or an AsyncGenerator
Await. This ensures appropriate registers are stored.
- Add versions of ResumeGeneratorTrampoline which store the
input value in a different field depending on wether it's an
AsyncGenerator Await resume, or an ordinary resume. Also modifies
whether debug code will assert that the generator object is a
JSGeneratorObject or a JSAsyncGeneratorObject depending on the
resume type.
BUG=v8:5855
R=bmeurer@chromium.org, rmcilroy@chromium.org, jgruber@chromium.org,
littledan@chromium.org, neis@chromium.org
TBR=marja@chromium.org
Change-Id: I9d58df1d344465fc937fe7eed322424204497187
Reviewed-on: https://chromium-review.googlesource.com/446961
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44240}
2017-03-29 13:41:45 +00:00
|
|
|
B(SuspendGenerator), R(13), U8(0),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(12),
|
2016-06-10 13:28:34 +00:00
|
|
|
/* 44 S> */ B(Return),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(-2),
|
2016-11-24 09:47:57 +00:00
|
|
|
B(Star), R(3),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(13), U8(1),
|
2016-09-30 09:02:59 +00:00
|
|
|
B(Star), R(14),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(13), U8(1),
|
|
|
|
B(Star), R(15),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaZero),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(15),
|
2017-05-09 16:49:04 +00:00
|
|
|
B(JumpIfTrue), U8(40),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(2),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(15),
|
2017-05-09 16:49:04 +00:00
|
|
|
B(JumpIfTrue), U8(31),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaTrue),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(17),
|
|
|
|
B(Mov), R(14), R(16),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(16), U8(2),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(PopContext), R(2),
|
|
|
|
B(PopContext), R(2),
|
|
|
|
B(PopContext), R(2),
|
|
|
|
B(PopContext), R(2),
|
|
|
|
B(PopContext), R(2),
|
|
|
|
B(PopContext), R(2),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(9),
|
2016-11-24 09:47:57 +00:00
|
|
|
B(LdaZero),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(8),
|
2017-01-24 22:09:02 +00:00
|
|
|
B(Jump), U8(71),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(14),
|
2016-06-10 13:28:34 +00:00
|
|
|
/* 36 E> */ B(Throw),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(PopContext), R(2),
|
|
|
|
B(LdaZero),
|
2016-09-13 11:09:00 +00:00
|
|
|
B(StaContextSlot), R(1), U8(9), U8(0),
|
2017-05-09 16:49:04 +00:00
|
|
|
B(JumpLoop), U8(212), I8(0),
|
2016-11-10 10:41:48 +00:00
|
|
|
B(Jump), U8(44),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(12),
|
2016-11-24 09:47:57 +00:00
|
|
|
B(Ldar), R(closure),
|
2017-01-24 22:09:02 +00:00
|
|
|
B(CreateCatchContext), R(12), U8(7), U8(8),
|
2016-11-23 15:23:00 +00:00
|
|
|
B(PushContext), R(2),
|
2017-05-02 19:03:03 +00:00
|
|
|
B(Star), R(11),
|
2016-11-24 09:47:57 +00:00
|
|
|
B(LdaContextSlot), R(1), U8(9), U8(0),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(12),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(2),
|
2017-05-09 21:45:33 +00:00
|
|
|
B(TestEqualStrict), R(12), U8(16),
|
2016-09-13 11:09:00 +00:00
|
|
|
B(JumpIfFalse), U8(8),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(1),
|
2016-11-24 09:47:57 +00:00
|
|
|
B(StaContextSlot), R(1), U8(9), U8(0),
|
2017-02-07 20:42:03 +00:00
|
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(12),
|
|
|
|
B(CallRuntime), U16(Runtime::kReThrow), R(12), U8(1),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(PopContext), R(2),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(-1),
|
2016-11-23 15:23:00 +00:00
|
|
|
B(Star), R(8),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Jump), U8(8),
|
|
|
|
B(Star), R(9),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(1),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(8),
|
2016-11-16 10:46:23 +00:00
|
|
|
B(LdaTheHole),
|
|
|
|
B(SetPendingMessage),
|
2016-11-24 09:47:57 +00:00
|
|
|
B(Star), R(10),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(LdaContextSlot), R(1), U8(9), U8(0),
|
|
|
|
B(Star), R(11),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaZero),
|
2017-05-09 21:45:33 +00:00
|
|
|
B(TestEqualStrict), R(11), U8(17),
|
2017-04-03 14:17:16 +00:00
|
|
|
B(JumpIfTrue), U8(150),
|
2016-11-10 10:41:48 +00:00
|
|
|
B(LdaContextSlot), R(1), U8(7), U8(0),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(11),
|
2017-05-09 21:45:33 +00:00
|
|
|
B(LdaNamedProperty), R(11), U8(9), U8(18),
|
2016-09-13 11:09:00 +00:00
|
|
|
B(StaContextSlot), R(1), U8(11), U8(0),
|
2016-11-10 10:41:48 +00:00
|
|
|
B(LdaContextSlot), R(1), U8(11), U8(0),
|
2017-04-03 14:17:16 +00:00
|
|
|
B(TestUndetectable),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(JumpIfFalse), U8(4),
|
2017-03-15 11:29:12 +00:00
|
|
|
B(Jump), U8(127),
|
2016-11-10 10:41:48 +00:00
|
|
|
B(LdaContextSlot), R(1), U8(9), U8(0),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(11),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(1),
|
2017-05-09 21:45:33 +00:00
|
|
|
B(TestEqualStrict), R(11), U8(21),
|
2017-03-15 11:29:12 +00:00
|
|
|
B(JumpIfFalse), U8(69),
|
2016-09-13 11:09:00 +00:00
|
|
|
B(LdaContextSlot), R(1), U8(11), U8(0),
|
2017-03-15 11:29:12 +00:00
|
|
|
B(TestTypeOf), U8(5),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(JumpIfFalse), U8(4),
|
|
|
|
B(Jump), U8(18),
|
2017-04-21 08:35:12 +00:00
|
|
|
B(Wide), B(LdaSmi), I16(130),
|
2016-11-24 09:47:57 +00:00
|
|
|
B(Star), R(11),
|
2017-03-15 11:29:12 +00:00
|
|
|
B(LdaConstant), U8(10),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(12),
|
|
|
|
B(CallRuntime), U16(Runtime::kNewTypeError), R(11), U8(2),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(Throw),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Mov), R(context), R(11),
|
2016-11-10 10:41:48 +00:00
|
|
|
B(LdaContextSlot), R(1), U8(11), U8(0),
|
2016-11-23 15:23:00 +00:00
|
|
|
B(Star), R(12),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(LdaContextSlot), R(1), U8(7), U8(0),
|
|
|
|
B(Star), R(13),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_Call), R(12), U8(2),
|
2016-11-24 09:47:57 +00:00
|
|
|
B(Jump), U8(20),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(12),
|
2016-11-24 09:47:57 +00:00
|
|
|
B(Ldar), R(closure),
|
2017-03-15 11:29:12 +00:00
|
|
|
B(CreateCatchContext), R(12), U8(7), U8(11),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(11),
|
2016-11-16 10:46:23 +00:00
|
|
|
B(LdaTheHole),
|
|
|
|
B(SetPendingMessage),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(11),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(PushContext), R(2),
|
|
|
|
B(PopContext), R(2),
|
2016-11-10 10:41:48 +00:00
|
|
|
B(Jump), U8(47),
|
|
|
|
B(LdaContextSlot), R(1), U8(11), U8(0),
|
2016-11-24 09:47:57 +00:00
|
|
|
B(Star), R(11),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(LdaContextSlot), R(1), U8(7), U8(0),
|
|
|
|
B(Star), R(12),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_Call), R(11), U8(2),
|
2016-09-13 11:09:00 +00:00
|
|
|
B(StaContextSlot), R(1), U8(12), U8(0),
|
2016-11-10 10:41:48 +00:00
|
|
|
B(LdaContextSlot), R(1), U8(12), U8(0),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(11),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(11), U8(1),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(JumpIfToBooleanFalse), U8(4),
|
2016-11-10 10:41:48 +00:00
|
|
|
B(Jump), U8(13),
|
|
|
|
B(LdaContextSlot), R(1), U8(12), U8(0),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(11),
|
|
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
|
|
|
|
B(Ldar), R(10),
|
2016-11-16 10:46:23 +00:00
|
|
|
B(SetPendingMessage),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaZero),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(8),
|
|
|
|
B(JumpIfTrue), U8(10),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(1),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(8),
|
2016-05-27 15:57:35 +00:00
|
|
|
B(JumpIfTrue), U8(17),
|
|
|
|
B(Jump), U8(28),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(PopContext), R(1),
|
|
|
|
B(PopContext), R(1),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(1),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(5),
|
|
|
|
B(Mov), R(9), R(6),
|
2017-01-11 11:34:02 +00:00
|
|
|
B(Jump), U8(47),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(PopContext), R(1),
|
|
|
|
B(PopContext), R(1),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(2),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(5),
|
|
|
|
B(Mov), R(9), R(6),
|
2017-01-11 11:34:02 +00:00
|
|
|
B(Jump), U8(34),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(PopContext), R(1),
|
2016-11-10 10:41:48 +00:00
|
|
|
B(LdaUndefined),
|
2016-11-24 09:47:57 +00:00
|
|
|
B(Star), R(8),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(LdaTrue),
|
|
|
|
B(Star), R(9),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(8), U8(2),
|
|
|
|
B(Star), R(6),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(3),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(5),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(Jump), U8(14),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(-1),
|
2016-11-23 15:23:00 +00:00
|
|
|
B(Star), R(5),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Jump), U8(8),
|
|
|
|
B(Star), R(6),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(4),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(5),
|
2016-11-16 10:46:23 +00:00
|
|
|
B(LdaTheHole),
|
|
|
|
B(SetPendingMessage),
|
2016-11-24 09:47:57 +00:00
|
|
|
B(Star), R(7),
|
2017-02-07 20:42:03 +00:00
|
|
|
B(LdaImmutableCurrentContextSlot), U8(5),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Star), R(8),
|
|
|
|
B(CallRuntime), U16(Runtime::k_GeneratorClose), R(8), U8(1),
|
|
|
|
B(Ldar), R(7),
|
2016-11-16 10:46:23 +00:00
|
|
|
B(SetPendingMessage),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaZero),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(5),
|
2016-08-30 10:21:02 +00:00
|
|
|
B(JumpIfTrue), U8(28),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(LdaSmi), I8(1),
|
|
|
|
B(TestEqualStrictNoFeedback), R(5),
|
|
|
|
B(JumpIfTrue), U8(25),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(2),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(5),
|
|
|
|
B(JumpIfTrue), U8(22),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(3),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(5),
|
|
|
|
B(JumpIfTrue), U8(19),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(4),
|
2017-03-22 11:08:18 +00:00
|
|
|
B(TestEqualStrictNoFeedback), R(5),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(JumpIfTrue), U8(16),
|
|
|
|
B(Jump), U8(17),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(6),
|
2016-05-11 12:21:56 +00:00
|
|
|
/* 44 S> */ B(Return),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(6),
|
2016-05-11 12:21:56 +00:00
|
|
|
/* 44 S> */ B(Return),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(6),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(ReThrow),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(6),
|
2016-05-11 12:21:56 +00:00
|
|
|
/* 44 S> */ B(Return),
|
2017-01-17 13:44:10 +00:00
|
|
|
B(Ldar), R(6),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(ReThrow),
|
|
|
|
B(LdaUndefined),
|
|
|
|
/* 44 S> */ B(Return),
|
2016-04-18 14:13:04 +00:00
|
|
|
]
|
|
|
|
constant pool: [
|
2016-09-06 16:10:19 +00:00
|
|
|
FIXED_ARRAY_TYPE,
|
2017-04-18 12:46:39 +00:00
|
|
|
TUPLE2_TYPE,
|
2016-09-06 16:10:19 +00:00
|
|
|
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 [""],
|
|
|
|
FIXED_ARRAY_TYPE,
|
2017-05-09 16:49:04 +00:00
|
|
|
Smi [561],
|
2016-04-18 14:13:04 +00:00
|
|
|
]
|
|
|
|
handlers: [
|
2017-05-09 16:49:04 +00:00
|
|
|
[51, 670, 676],
|
|
|
|
[143, 432, 438],
|
|
|
|
[146, 388, 390],
|
|
|
|
[525, 541, 543],
|
2016-04-18 14:13:04 +00:00
|
|
|
]
|
|
|
|
|