2017-07-02 20:59:29 +00:00
|
|
|
#
|
|
|
|
# Autogenerated by generate-bytecode-expectations.
|
|
|
|
#
|
|
|
|
|
|
|
|
---
|
|
|
|
wrap: no
|
|
|
|
test function name: f
|
|
|
|
async iteration: yes
|
|
|
|
|
|
|
|
---
|
|
|
|
snippet: "
|
|
|
|
async function* f() { }
|
|
|
|
f();
|
|
|
|
"
|
2018-01-23 13:51:38 +00:00
|
|
|
frame size: 8
|
2017-07-02 20:59:29 +00:00
|
|
|
parameter count: 1
|
2018-05-02 13:57:26 +00:00
|
|
|
bytecode array length: 190
|
2017-07-02 20:59:29 +00:00
|
|
|
bytecodes: [
|
2018-01-23 13:51:38 +00:00
|
|
|
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
|
|
|
|
B(Mov), R(closure), R(1),
|
|
|
|
B(Mov), R(this), R(2),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(Star), R(0),
|
|
|
|
/* 17 E> */ B(StackCheck),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Mov), R(context), R(3),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(Mov), R(context), R(4),
|
2017-07-25 18:37:36 +00:00
|
|
|
B(Ldar), R(0),
|
2018-01-23 13:51:38 +00:00
|
|
|
/* 17 E> */ B(SuspendGenerator), R(0), R(0), U8(5), U8(0),
|
|
|
|
B(ResumeGenerator), R(0), R(0), U8(5),
|
|
|
|
B(Star), R(5),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
|
2017-08-09 13:43:29 +00:00
|
|
|
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(5),
|
2017-07-02 20:59:29 +00:00
|
|
|
/* 17 E> */ B(Throw),
|
|
|
|
B(LdaZero),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(1),
|
|
|
|
B(Mov), R(5), R(2),
|
2018-05-02 13:57:26 +00:00
|
|
|
B(Jump), U8(96),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaUndefined),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(Star), R(6),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Mov), R(0), R(5),
|
2018-02-19 11:34:06 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorAwaitUncaught), R(5), U8(2),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(SuspendGenerator), R(0), R(0), U8(5), U8(1),
|
|
|
|
B(ResumeGenerator), R(0), R(0), U8(5),
|
|
|
|
B(Star), R(5),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(6),
|
Reland "[async-iteration] implement spec-change to `yield` in async generators"
Per https://github.com/tc39/proposal-async-iteration/pull/102/files:
AsyncGeneratorResolve no longer unwraps a value component. Instead, the value is
unwrapped before the builtin call via Await, allowing Promise rejections to
affect the generator control flow.
Thus, all `yield <expr>` implicitly become `yield await <expr>`.
Additionally, `return <expr>` becomes `return await <expr>`. Finally, when the
generator is resumed with `.return()`, the parameter passed to .return() is
awaited before generator execution properly continues).
BUG=v8:6187, v8:5855
R=littledan@chromium.org, neis@chromium.org, adamk@chromium.org
TBR=rmcilroy@chromium.org, neis@chromium.org
Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: Id7718028fd555481f9f4ca0dbecfa788e3057c48
Reviewed-on: https://chromium-review.googlesource.com/594500
Reviewed-by: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#47058}
2017-08-01 14:45:03 +00:00
|
|
|
B(LdaZero),
|
2018-04-18 00:04:34 +00:00
|
|
|
B(TestReferenceEqual), R(6),
|
Reland "[async-iteration] implement spec-change to `yield` in async generators"
Per https://github.com/tc39/proposal-async-iteration/pull/102/files:
AsyncGeneratorResolve no longer unwraps a value component. Instead, the value is
unwrapped before the builtin call via Await, allowing Promise rejections to
affect the generator control flow.
Thus, all `yield <expr>` implicitly become `yield await <expr>`.
Additionally, `return <expr>` becomes `return await <expr>`. Finally, when the
generator is resumed with `.return()`, the parameter passed to .return() is
awaited before generator execution properly continues).
BUG=v8:6187, v8:5855
R=littledan@chromium.org, neis@chromium.org, adamk@chromium.org
TBR=rmcilroy@chromium.org, neis@chromium.org
Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: Id7718028fd555481f9f4ca0dbecfa788e3057c48
Reviewed-on: https://chromium-review.googlesource.com/594500
Reviewed-by: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#47058}
2017-08-01 14:45:03 +00:00
|
|
|
B(JumpIfTrue), U8(5),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(5),
|
Reland "[async-iteration] implement spec-change to `yield` in async generators"
Per https://github.com/tc39/proposal-async-iteration/pull/102/files:
AsyncGeneratorResolve no longer unwraps a value component. Instead, the value is
unwrapped before the builtin call via Await, allowing Promise rejections to
affect the generator control flow.
Thus, all `yield <expr>` implicitly become `yield await <expr>`.
Additionally, `return <expr>` becomes `return await <expr>`. Finally, when the
generator is resumed with `.return()`, the parameter passed to .return() is
awaited before generator execution properly continues).
BUG=v8:6187, v8:5855
R=littledan@chromium.org, neis@chromium.org, adamk@chromium.org
TBR=rmcilroy@chromium.org, neis@chromium.org
Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: Id7718028fd555481f9f4ca0dbecfa788e3057c48
Reviewed-on: https://chromium-review.googlesource.com/594500
Reviewed-by: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#47058}
2017-08-01 14:45:03 +00:00
|
|
|
B(ReThrow),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaZero),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(1),
|
|
|
|
B(Mov), R(5), R(2),
|
2018-05-02 13:57:26 +00:00
|
|
|
B(Jump), U8(53),
|
|
|
|
B(Jump), U8(37),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(Star), R(5),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(CreateCatchContext), R(5), U8(4), U8(5),
|
|
|
|
B(Star), R(4),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaTheHole),
|
|
|
|
B(SetPendingMessage),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(4),
|
|
|
|
B(PushContext), R(5),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(7),
|
|
|
|
B(Mov), R(0), R(6),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorReject), R(6), U8(2),
|
|
|
|
B(PopContext), R(5),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(Star), R(2),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(LdaSmi), I8(1),
|
|
|
|
B(Star), R(1),
|
[ignition] Always write the deferred command result register
For deferred commands (such as in try-finally), some deferred commands
save and restore the accumulator using a result register (e.g. return,
throw, rethrow), while others don't (e.g. break, continue,
fall-through).
However, conditionally reading this result register that may not ever be
written caused it to be considered live from the start of the function,
as far as the liveness analysis could statically tell.
Now, we write the result register for all deferred commands, including
the fall-through. As a micro-optimization, we re-use the Smi command
tokeen to clobber the result, rather than emitting an LdaUndefined.
Bug: chromium:758472
Change-Id: I2ea65e2249b40ee6403216e654a8bb88d50bec3b
Reviewed-on: https://chromium-review.googlesource.com/635592
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47612}
2017-08-25 16:04:42 +00:00
|
|
|
B(Jump), U8(16),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaSmi), I8(-1),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(Star), R(2),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(1),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(Jump), U8(8),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(Star), R(2),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(LdaSmi), I8(2),
|
|
|
|
B(Star), R(1),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaTheHole),
|
|
|
|
B(SetPendingMessage),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(3),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(0), U8(1),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(3),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(SetPendingMessage),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(1),
|
2017-08-09 13:43:29 +00:00
|
|
|
B(SwitchOnSmiNoFeedback), U8(6), U8(3), I8(0),
|
|
|
|
B(Jump), U8(22),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaTrue),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(6),
|
|
|
|
B(Mov), R(0), R(4),
|
|
|
|
B(Mov), R(2), R(5),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorResolve), R(4), U8(3),
|
2017-07-02 20:59:29 +00:00
|
|
|
/* 22 S> */ B(Return),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(2),
|
2017-07-02 20:59:29 +00:00
|
|
|
/* 22 S> */ B(Return),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(2),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(ReThrow),
|
|
|
|
B(LdaUndefined),
|
|
|
|
/* 22 S> */ B(Return),
|
|
|
|
]
|
|
|
|
constant pool: [
|
2018-01-23 13:51:38 +00:00
|
|
|
Smi [30],
|
|
|
|
Smi [70],
|
2017-08-09 13:43:29 +00:00
|
|
|
Smi [15],
|
2017-07-02 20:59:29 +00:00
|
|
|
Smi [7],
|
|
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"],
|
2018-02-16 12:36:47 +00:00
|
|
|
SCOPE_INFO_TYPE,
|
2017-07-02 20:59:29 +00:00
|
|
|
Smi [6],
|
2017-08-09 13:43:29 +00:00
|
|
|
Smi [20],
|
|
|
|
Smi [23],
|
2017-07-02 20:59:29 +00:00
|
|
|
]
|
|
|
|
handlers: [
|
2018-05-02 13:57:26 +00:00
|
|
|
[20, 135, 143],
|
2018-01-24 11:19:51 +00:00
|
|
|
[23, 98, 100],
|
2017-07-02 20:59:29 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
---
|
|
|
|
snippet: "
|
|
|
|
async function* f() { yield 42 }
|
|
|
|
f();
|
|
|
|
"
|
2018-01-23 13:51:38 +00:00
|
|
|
frame size: 8
|
2017-07-02 20:59:29 +00:00
|
|
|
parameter count: 1
|
2018-05-02 13:57:26 +00:00
|
|
|
bytecode array length: 234
|
2017-07-02 20:59:29 +00:00
|
|
|
bytecodes: [
|
2018-01-23 13:51:38 +00:00
|
|
|
B(SwitchOnGeneratorState), R(0), U8(0), U8(3),
|
|
|
|
B(Mov), R(closure), R(1),
|
|
|
|
B(Mov), R(this), R(2),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(Star), R(0),
|
|
|
|
/* 17 E> */ B(StackCheck),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Mov), R(context), R(3),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(Mov), R(context), R(4),
|
2017-07-25 18:37:36 +00:00
|
|
|
B(Ldar), R(0),
|
2018-01-23 13:51:38 +00:00
|
|
|
/* 17 E> */ B(SuspendGenerator), R(0), R(0), U8(5), U8(0),
|
|
|
|
B(ResumeGenerator), R(0), R(0), U8(5),
|
|
|
|
B(Star), R(5),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
|
2017-08-09 13:43:29 +00:00
|
|
|
B(SwitchOnSmiNoFeedback), U8(3), U8(2), I8(0),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(5),
|
2017-07-02 20:59:29 +00:00
|
|
|
/* 17 E> */ B(Throw),
|
|
|
|
B(LdaZero),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(1),
|
|
|
|
B(Mov), R(5), R(2),
|
2018-05-02 13:57:26 +00:00
|
|
|
B(Jump), U8(140),
|
2017-07-02 20:59:29 +00:00
|
|
|
/* 22 S> */ B(LdaSmi), I8(42),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(Star), R(6),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(LdaFalse),
|
|
|
|
B(Star), R(7),
|
|
|
|
B(Mov), R(0), R(5),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorYield), R(5), U8(3),
|
|
|
|
/* 22 E> */ B(SuspendGenerator), R(0), R(0), U8(5), U8(1),
|
|
|
|
B(ResumeGenerator), R(0), R(0), U8(5),
|
|
|
|
B(Star), R(5),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
|
2017-08-09 13:43:29 +00:00
|
|
|
B(SwitchOnSmiNoFeedback), U8(5), U8(2), I8(0),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(5),
|
2017-07-02 20:59:29 +00:00
|
|
|
/* 22 E> */ B(Throw),
|
|
|
|
B(LdaZero),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(1),
|
|
|
|
B(Mov), R(5), R(2),
|
2018-05-02 13:57:26 +00:00
|
|
|
B(Jump), U8(96),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaUndefined),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(Star), R(6),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Mov), R(0), R(5),
|
2018-02-19 11:34:06 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorAwaitUncaught), R(5), U8(2),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(SuspendGenerator), R(0), R(0), U8(5), U8(2),
|
|
|
|
B(ResumeGenerator), R(0), R(0), U8(5),
|
|
|
|
B(Star), R(5),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(6),
|
Reland "[async-iteration] implement spec-change to `yield` in async generators"
Per https://github.com/tc39/proposal-async-iteration/pull/102/files:
AsyncGeneratorResolve no longer unwraps a value component. Instead, the value is
unwrapped before the builtin call via Await, allowing Promise rejections to
affect the generator control flow.
Thus, all `yield <expr>` implicitly become `yield await <expr>`.
Additionally, `return <expr>` becomes `return await <expr>`. Finally, when the
generator is resumed with `.return()`, the parameter passed to .return() is
awaited before generator execution properly continues).
BUG=v8:6187, v8:5855
R=littledan@chromium.org, neis@chromium.org, adamk@chromium.org
TBR=rmcilroy@chromium.org, neis@chromium.org
Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: Id7718028fd555481f9f4ca0dbecfa788e3057c48
Reviewed-on: https://chromium-review.googlesource.com/594500
Reviewed-by: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#47058}
2017-08-01 14:45:03 +00:00
|
|
|
B(LdaZero),
|
2018-04-18 00:04:34 +00:00
|
|
|
B(TestReferenceEqual), R(6),
|
Reland "[async-iteration] implement spec-change to `yield` in async generators"
Per https://github.com/tc39/proposal-async-iteration/pull/102/files:
AsyncGeneratorResolve no longer unwraps a value component. Instead, the value is
unwrapped before the builtin call via Await, allowing Promise rejections to
affect the generator control flow.
Thus, all `yield <expr>` implicitly become `yield await <expr>`.
Additionally, `return <expr>` becomes `return await <expr>`. Finally, when the
generator is resumed with `.return()`, the parameter passed to .return() is
awaited before generator execution properly continues).
BUG=v8:6187, v8:5855
R=littledan@chromium.org, neis@chromium.org, adamk@chromium.org
TBR=rmcilroy@chromium.org, neis@chromium.org
Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: Id7718028fd555481f9f4ca0dbecfa788e3057c48
Reviewed-on: https://chromium-review.googlesource.com/594500
Reviewed-by: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#47058}
2017-08-01 14:45:03 +00:00
|
|
|
B(JumpIfTrue), U8(5),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(5),
|
Reland "[async-iteration] implement spec-change to `yield` in async generators"
Per https://github.com/tc39/proposal-async-iteration/pull/102/files:
AsyncGeneratorResolve no longer unwraps a value component. Instead, the value is
unwrapped before the builtin call via Await, allowing Promise rejections to
affect the generator control flow.
Thus, all `yield <expr>` implicitly become `yield await <expr>`.
Additionally, `return <expr>` becomes `return await <expr>`. Finally, when the
generator is resumed with `.return()`, the parameter passed to .return() is
awaited before generator execution properly continues).
BUG=v8:6187, v8:5855
R=littledan@chromium.org, neis@chromium.org, adamk@chromium.org
TBR=rmcilroy@chromium.org, neis@chromium.org
Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: Id7718028fd555481f9f4ca0dbecfa788e3057c48
Reviewed-on: https://chromium-review.googlesource.com/594500
Reviewed-by: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#47058}
2017-08-01 14:45:03 +00:00
|
|
|
B(ReThrow),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaZero),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(1),
|
|
|
|
B(Mov), R(5), R(2),
|
2018-05-02 13:57:26 +00:00
|
|
|
B(Jump), U8(53),
|
|
|
|
B(Jump), U8(37),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(Star), R(5),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(CreateCatchContext), R(5), U8(7), U8(8),
|
|
|
|
B(Star), R(4),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaTheHole),
|
|
|
|
B(SetPendingMessage),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(4),
|
|
|
|
B(PushContext), R(5),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(7),
|
|
|
|
B(Mov), R(0), R(6),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorReject), R(6), U8(2),
|
|
|
|
B(PopContext), R(5),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(Star), R(2),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(LdaSmi), I8(1),
|
|
|
|
B(Star), R(1),
|
[ignition] Always write the deferred command result register
For deferred commands (such as in try-finally), some deferred commands
save and restore the accumulator using a result register (e.g. return,
throw, rethrow), while others don't (e.g. break, continue,
fall-through).
However, conditionally reading this result register that may not ever be
written caused it to be considered live from the start of the function,
as far as the liveness analysis could statically tell.
Now, we write the result register for all deferred commands, including
the fall-through. As a micro-optimization, we re-use the Smi command
tokeen to clobber the result, rather than emitting an LdaUndefined.
Bug: chromium:758472
Change-Id: I2ea65e2249b40ee6403216e654a8bb88d50bec3b
Reviewed-on: https://chromium-review.googlesource.com/635592
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47612}
2017-08-25 16:04:42 +00:00
|
|
|
B(Jump), U8(16),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaSmi), I8(-1),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(Star), R(2),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(1),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(Jump), U8(8),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(Star), R(2),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(LdaSmi), I8(2),
|
|
|
|
B(Star), R(1),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaTheHole),
|
|
|
|
B(SetPendingMessage),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(3),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(0), U8(1),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(3),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(SetPendingMessage),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(1),
|
2017-08-09 13:43:29 +00:00
|
|
|
B(SwitchOnSmiNoFeedback), U8(9), U8(3), I8(0),
|
|
|
|
B(Jump), U8(22),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaTrue),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(6),
|
|
|
|
B(Mov), R(0), R(4),
|
|
|
|
B(Mov), R(2), R(5),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorResolve), R(4), U8(3),
|
2017-07-02 20:59:29 +00:00
|
|
|
/* 31 S> */ B(Return),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(2),
|
2017-07-02 20:59:29 +00:00
|
|
|
/* 31 S> */ B(Return),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(2),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(ReThrow),
|
|
|
|
B(LdaUndefined),
|
|
|
|
/* 31 S> */ B(Return),
|
|
|
|
]
|
|
|
|
constant pool: [
|
2018-01-23 13:51:38 +00:00
|
|
|
Smi [30],
|
|
|
|
Smi [74],
|
|
|
|
Smi [114],
|
2017-08-09 13:43:29 +00:00
|
|
|
Smi [15],
|
2017-07-02 20:59:29 +00:00
|
|
|
Smi [7],
|
2017-08-09 13:43:29 +00:00
|
|
|
Smi [15],
|
2017-07-02 20:59:29 +00:00
|
|
|
Smi [7],
|
|
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"],
|
2018-02-16 12:36:47 +00:00
|
|
|
SCOPE_INFO_TYPE,
|
2017-07-02 20:59:29 +00:00
|
|
|
Smi [6],
|
2017-08-09 13:43:29 +00:00
|
|
|
Smi [20],
|
|
|
|
Smi [23],
|
2017-07-02 20:59:29 +00:00
|
|
|
]
|
|
|
|
handlers: [
|
2018-05-02 13:57:26 +00:00
|
|
|
[20, 179, 187],
|
2018-01-24 11:19:51 +00:00
|
|
|
[23, 142, 144],
|
2017-07-02 20:59:29 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
---
|
|
|
|
snippet: "
|
|
|
|
async function* f() { for (let x of [42]) yield x }
|
|
|
|
f();
|
|
|
|
"
|
2018-01-23 13:51:38 +00:00
|
|
|
frame size: 22
|
2017-07-02 20:59:29 +00:00
|
|
|
parameter count: 1
|
2018-05-02 13:57:26 +00:00
|
|
|
bytecode array length: 492
|
2017-07-02 20:59:29 +00:00
|
|
|
bytecodes: [
|
2018-01-23 13:51:38 +00:00
|
|
|
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_CreateJSGeneratorObject), R(11), U8(2),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(Star), R(2),
|
|
|
|
/* 17 E> */ B(StackCheck),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Mov), R(context), R(13),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(Mov), R(context), R(14),
|
2017-07-25 18:37:36 +00:00
|
|
|
B(Ldar), R(2),
|
2018-01-23 13:51:38 +00:00
|
|
|
/* 17 E> */ B(SuspendGenerator), R(2), R(0), U8(15), U8(0),
|
|
|
|
B(ResumeGenerator), R(2), R(0), U8(15),
|
|
|
|
B(Star), R(15),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
|
2017-08-09 13:43:29 +00:00
|
|
|
B(SwitchOnSmiNoFeedback), U8(3), U8(2), I8(0),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(15),
|
2017-07-02 20:59:29 +00:00
|
|
|
/* 17 E> */ B(Throw),
|
|
|
|
B(LdaZero),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(11),
|
|
|
|
B(Mov), R(15), R(12),
|
|
|
|
B(JumpConstant), U8(19),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaZero),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(Star), R(7),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Mov), R(context), R(17),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(Mov), R(context), R(18),
|
2017-08-09 13:43:29 +00:00
|
|
|
/* 36 S> */ B(CreateArrayLiteral), U8(5), U8(0), U8(37),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(19),
|
2018-03-05 10:22:47 +00:00
|
|
|
B(LdaNamedProperty), R(19), U8(6), U8(1),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(Star), R(20),
|
2018-03-05 10:22:47 +00:00
|
|
|
B(CallProperty0), R(20), R(19), U8(3),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(JumpIfJSReceiver), U8(7),
|
|
|
|
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
|
|
|
|
B(Star), R(4),
|
2018-03-05 10:22:47 +00:00
|
|
|
/* 36 E> */ B(LdaNamedProperty), R(4), U8(7), U8(5),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(Star), R(5),
|
2018-03-05 10:22:47 +00:00
|
|
|
/* 31 S> */ B(CallProperty0), R(5), R(4), U8(7),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(Star), R(6),
|
|
|
|
/* 31 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(6), U8(1),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(ToBooleanLogicalNot),
|
|
|
|
B(JumpIfFalse), U8(7),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
|
2018-03-05 10:22:47 +00:00
|
|
|
B(LdaNamedProperty), R(6), U8(8), U8(9),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(JumpIfToBooleanTrue), U8(68),
|
2018-03-05 10:22:47 +00:00
|
|
|
B(LdaNamedProperty), R(6), U8(9), U8(11),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(Star), R(8),
|
Revert "[esnext] load `iterator.next` only once at beginning of iteration"
This reverts commit bf4cc9ee154f15942594016777f77d3208230f5f.
Reason for revert: Breaks windows with msvc and linux with gcc
https://build.chromium.org/p/client.v8/builders/V8%20Win64%20-%20msvc/builds/841
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20gcc%204.8/builds/17265
Original change's description:
> [esnext] load `iterator.next` only once at beginning of iteration
>
> https://github.com/tc39/ecma262/pull/988 gained concensus during the
> september 2017 TC39 meetings. This moves the load of the "next" method
> to the very beginning of the iteration protocol, rather than during
> each iteration step.
>
> This impacts:
>
> - yield*
> - for-of loops
> - spread arguments
> - array spreads
>
> In the v8 implementation, this also affects async iteration versions of
> these things (the sole exception being the Async-From-Sync iterator,
> which requires a few more changes to work with this, likely done in a
> followup patch).
>
> This change introduces a new AST node, ResolvedProperty, which can be used
> as a callee by Call nodes to produce the same bytecode as Property calls,
> without observably re-loading the property. This is used in several
> AST-desugarings involving the iteration protocol.
>
> BUG=v8:6861, v8:5699
> R=rmcilroy@chromium.org, neis@chromium.org, adamk@chromium.org
>
> Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
> Change-Id: Ib81106a0182687fc5efea0bc32302ad06376773b
> Reviewed-on: https://chromium-review.googlesource.com/687997
> Commit-Queue: Caitlin Potter <caitp@igalia.com>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Reviewed-by: Adam Klein <adamk@chromium.org>
> Reviewed-by: Georg Neis <neis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50452}
TBR=rmcilroy@chromium.org,adamk@chromium.org,neis@chromium.org,caitp@igalia.com,caitp@chromium.org
Change-Id: I1797c0d596dfd6850d6f0f505f591a7a990dd1f1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6861, v8:5699
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/857616
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50454}
2018-01-09 16:50:16 +00:00
|
|
|
B(LdaSmi), I8(2),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(Star), R(7),
|
|
|
|
B(Mov), R(8), R(3),
|
2017-07-02 20:59:29 +00:00
|
|
|
/* 22 E> */ B(StackCheck),
|
|
|
|
B(Mov), R(3), R(0),
|
2017-08-07 14:13:18 +00:00
|
|
|
/* 42 S> */ B(LdaFalse),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(21),
|
|
|
|
B(Mov), R(2), R(19),
|
|
|
|
B(Mov), R(0), R(20),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorYield), R(19), U8(3),
|
|
|
|
/* 42 E> */ B(SuspendGenerator), R(2), R(0), U8(19), U8(1),
|
|
|
|
B(ResumeGenerator), R(2), R(0), U8(19),
|
|
|
|
B(Star), R(19),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(SwitchOnSmiNoFeedback), U8(10), U8(2), I8(0),
|
|
|
|
B(Ldar), R(19),
|
2017-07-02 20:59:29 +00:00
|
|
|
/* 42 E> */ B(Throw),
|
|
|
|
B(LdaZero),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(15),
|
|
|
|
B(Mov), R(19), R(16),
|
2018-05-02 13:57:26 +00:00
|
|
|
B(Jump), U8(60),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaZero),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(Star), R(7),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(JumpLoop), U8(87), I8(0),
|
2018-05-02 13:57:26 +00:00
|
|
|
B(Jump), U8(38),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(Star), R(19),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(CreateCatchContext), R(19), U8(12), U8(13),
|
|
|
|
B(Star), R(18),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaTheHole),
|
|
|
|
B(SetPendingMessage),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(18),
|
|
|
|
B(PushContext), R(19),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaSmi), I8(2),
|
2018-03-05 10:22:47 +00:00
|
|
|
B(TestEqualStrict), R(7), U8(13),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(JumpIfFalse), U8(6),
|
|
|
|
B(LdaSmi), I8(1),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(Star), R(7),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(20),
|
|
|
|
B(CallRuntime), U16(Runtime::kReThrow), R(20), U8(1),
|
|
|
|
B(PopContext), R(19),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaSmi), I8(-1),
|
[ignition] Always write the deferred command result register
For deferred commands (such as in try-finally), some deferred commands
save and restore the accumulator using a result register (e.g. return,
throw, rethrow), while others don't (e.g. break, continue,
fall-through).
However, conditionally reading this result register that may not ever be
written caused it to be considered live from the start of the function,
as far as the liveness analysis could statically tell.
Now, we write the result register for all deferred commands, including
the fall-through. As a micro-optimization, we re-use the Smi command
tokeen to clobber the result, rather than emitting an LdaUndefined.
Bug: chromium:758472
Change-Id: I2ea65e2249b40ee6403216e654a8bb88d50bec3b
Reviewed-on: https://chromium-review.googlesource.com/635592
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47612}
2017-08-25 16:04:42 +00:00
|
|
|
B(Star), R(16),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(15),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(Jump), U8(8),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(Star), R(16),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(LdaSmi), I8(1),
|
|
|
|
B(Star), R(15),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaTheHole),
|
|
|
|
B(SetPendingMessage),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(17),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaZero),
|
2018-03-05 10:22:47 +00:00
|
|
|
B(TestEqualStrict), R(7), U8(14),
|
2018-01-04 19:15:04 +00:00
|
|
|
B(JumpIfTrue), U8(90),
|
2018-03-05 10:22:47 +00:00
|
|
|
B(LdaNamedProperty), R(4), U8(14), U8(15),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(Star), R(9),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(TestUndetectable),
|
|
|
|
B(JumpIfFalse), U8(4),
|
2018-01-04 19:15:04 +00:00
|
|
|
B(Jump), U8(79),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaSmi), I8(1),
|
2018-03-05 10:22:47 +00:00
|
|
|
B(TestEqualStrict), R(7), U8(17),
|
2018-01-04 19:15:04 +00:00
|
|
|
B(JumpIfFalse), U8(47),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(Ldar), R(9),
|
2017-11-07 09:26:56 +00:00
|
|
|
B(TestTypeOf), U8(6),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(JumpIfFalse), U8(4),
|
|
|
|
B(Jump), U8(18),
|
2018-04-23 08:13:39 +00:00
|
|
|
B(Wide), B(LdaSmi), I16(145),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(18),
|
|
|
|
B(LdaConstant), U8(15),
|
Revert "[esnext] load `iterator.next` only once at beginning of iteration"
This reverts commit bf4cc9ee154f15942594016777f77d3208230f5f.
Reason for revert: Breaks windows with msvc and linux with gcc
https://build.chromium.org/p/client.v8/builders/V8%20Win64%20-%20msvc/builds/841
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20gcc%204.8/builds/17265
Original change's description:
> [esnext] load `iterator.next` only once at beginning of iteration
>
> https://github.com/tc39/ecma262/pull/988 gained concensus during the
> september 2017 TC39 meetings. This moves the load of the "next" method
> to the very beginning of the iteration protocol, rather than during
> each iteration step.
>
> This impacts:
>
> - yield*
> - for-of loops
> - spread arguments
> - array spreads
>
> In the v8 implementation, this also affects async iteration versions of
> these things (the sole exception being the Async-From-Sync iterator,
> which requires a few more changes to work with this, likely done in a
> followup patch).
>
> This change introduces a new AST node, ResolvedProperty, which can be used
> as a callee by Call nodes to produce the same bytecode as Property calls,
> without observably re-loading the property. This is used in several
> AST-desugarings involving the iteration protocol.
>
> BUG=v8:6861, v8:5699
> R=rmcilroy@chromium.org, neis@chromium.org, adamk@chromium.org
>
> Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
> Change-Id: Ib81106a0182687fc5efea0bc32302ad06376773b
> Reviewed-on: https://chromium-review.googlesource.com/687997
> Commit-Queue: Caitlin Potter <caitp@igalia.com>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Reviewed-by: Adam Klein <adamk@chromium.org>
> Reviewed-by: Georg Neis <neis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50452}
TBR=rmcilroy@chromium.org,adamk@chromium.org,neis@chromium.org,caitp@igalia.com,caitp@chromium.org
Change-Id: I1797c0d596dfd6850d6f0f505f591a7a990dd1f1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6861, v8:5699
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/857616
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50454}
2018-01-09 16:50:16 +00:00
|
|
|
B(Star), R(19),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(CallRuntime), U16(Runtime::kNewTypeError), R(18), U8(2),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(Throw),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Mov), R(context), R(18),
|
|
|
|
B(Mov), R(9), R(19),
|
|
|
|
B(Mov), R(4), R(20),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_Call), R(19), U8(2),
|
2018-01-04 19:15:04 +00:00
|
|
|
B(Jump), U8(6),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaTheHole),
|
|
|
|
B(SetPendingMessage),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(18),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(Jump), U8(27),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Mov), R(9), R(18),
|
|
|
|
B(Mov), R(4), R(19),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_Call), R(18), U8(2),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(Star), R(10),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(10), U8(1),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(JumpIfToBooleanFalse), U8(4),
|
|
|
|
B(Jump), U8(7),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(17),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(SetPendingMessage),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(15),
|
|
|
|
B(SwitchOnSmiNoFeedback), U8(16), U8(2), I8(0),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(Jump), U8(13),
|
|
|
|
B(LdaZero),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(11),
|
|
|
|
B(Mov), R(16), R(12),
|
2018-05-02 13:57:26 +00:00
|
|
|
B(Jump), U8(99),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(16),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(ReThrow),
|
|
|
|
B(LdaUndefined),
|
Revert "[esnext] load `iterator.next` only once at beginning of iteration"
This reverts commit bf4cc9ee154f15942594016777f77d3208230f5f.
Reason for revert: Breaks windows with msvc and linux with gcc
https://build.chromium.org/p/client.v8/builders/V8%20Win64%20-%20msvc/builds/841
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20gcc%204.8/builds/17265
Original change's description:
> [esnext] load `iterator.next` only once at beginning of iteration
>
> https://github.com/tc39/ecma262/pull/988 gained concensus during the
> september 2017 TC39 meetings. This moves the load of the "next" method
> to the very beginning of the iteration protocol, rather than during
> each iteration step.
>
> This impacts:
>
> - yield*
> - for-of loops
> - spread arguments
> - array spreads
>
> In the v8 implementation, this also affects async iteration versions of
> these things (the sole exception being the Async-From-Sync iterator,
> which requires a few more changes to work with this, likely done in a
> followup patch).
>
> This change introduces a new AST node, ResolvedProperty, which can be used
> as a callee by Call nodes to produce the same bytecode as Property calls,
> without observably re-loading the property. This is used in several
> AST-desugarings involving the iteration protocol.
>
> BUG=v8:6861, v8:5699
> R=rmcilroy@chromium.org, neis@chromium.org, adamk@chromium.org
>
> Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
> Change-Id: Ib81106a0182687fc5efea0bc32302ad06376773b
> Reviewed-on: https://chromium-review.googlesource.com/687997
> Commit-Queue: Caitlin Potter <caitp@igalia.com>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Reviewed-by: Adam Klein <adamk@chromium.org>
> Reviewed-by: Georg Neis <neis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50452}
TBR=rmcilroy@chromium.org,adamk@chromium.org,neis@chromium.org,caitp@igalia.com,caitp@chromium.org
Change-Id: I1797c0d596dfd6850d6f0f505f591a7a990dd1f1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6861, v8:5699
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/857616
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50454}
2018-01-09 16:50:16 +00:00
|
|
|
B(Star), R(16),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Mov), R(2), R(15),
|
2018-02-19 11:34:06 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorAwaitUncaught), R(15), U8(2),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(SuspendGenerator), R(2), R(0), U8(15), U8(2),
|
|
|
|
B(ResumeGenerator), R(2), R(0), U8(15),
|
|
|
|
B(Star), R(15),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(16),
|
Reland "[async-iteration] implement spec-change to `yield` in async generators"
Per https://github.com/tc39/proposal-async-iteration/pull/102/files:
AsyncGeneratorResolve no longer unwraps a value component. Instead, the value is
unwrapped before the builtin call via Await, allowing Promise rejections to
affect the generator control flow.
Thus, all `yield <expr>` implicitly become `yield await <expr>`.
Additionally, `return <expr>` becomes `return await <expr>`. Finally, when the
generator is resumed with `.return()`, the parameter passed to .return() is
awaited before generator execution properly continues).
BUG=v8:6187, v8:5855
R=littledan@chromium.org, neis@chromium.org, adamk@chromium.org
TBR=rmcilroy@chromium.org, neis@chromium.org
Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: Id7718028fd555481f9f4ca0dbecfa788e3057c48
Reviewed-on: https://chromium-review.googlesource.com/594500
Reviewed-by: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#47058}
2017-08-01 14:45:03 +00:00
|
|
|
B(LdaZero),
|
2018-04-18 00:04:34 +00:00
|
|
|
B(TestReferenceEqual), R(16),
|
Reland "[async-iteration] implement spec-change to `yield` in async generators"
Per https://github.com/tc39/proposal-async-iteration/pull/102/files:
AsyncGeneratorResolve no longer unwraps a value component. Instead, the value is
unwrapped before the builtin call via Await, allowing Promise rejections to
affect the generator control flow.
Thus, all `yield <expr>` implicitly become `yield await <expr>`.
Additionally, `return <expr>` becomes `return await <expr>`. Finally, when the
generator is resumed with `.return()`, the parameter passed to .return() is
awaited before generator execution properly continues).
BUG=v8:6187, v8:5855
R=littledan@chromium.org, neis@chromium.org, adamk@chromium.org
TBR=rmcilroy@chromium.org, neis@chromium.org
Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: Id7718028fd555481f9f4ca0dbecfa788e3057c48
Reviewed-on: https://chromium-review.googlesource.com/594500
Reviewed-by: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#47058}
2017-08-01 14:45:03 +00:00
|
|
|
B(JumpIfTrue), U8(5),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(15),
|
Reland "[async-iteration] implement spec-change to `yield` in async generators"
Per https://github.com/tc39/proposal-async-iteration/pull/102/files:
AsyncGeneratorResolve no longer unwraps a value component. Instead, the value is
unwrapped before the builtin call via Await, allowing Promise rejections to
affect the generator control flow.
Thus, all `yield <expr>` implicitly become `yield await <expr>`.
Additionally, `return <expr>` becomes `return await <expr>`. Finally, when the
generator is resumed with `.return()`, the parameter passed to .return() is
awaited before generator execution properly continues).
BUG=v8:6187, v8:5855
R=littledan@chromium.org, neis@chromium.org, adamk@chromium.org
TBR=rmcilroy@chromium.org, neis@chromium.org
Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: Id7718028fd555481f9f4ca0dbecfa788e3057c48
Reviewed-on: https://chromium-review.googlesource.com/594500
Reviewed-by: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#47058}
2017-08-01 14:45:03 +00:00
|
|
|
B(ReThrow),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaZero),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(11),
|
|
|
|
B(Mov), R(15), R(12),
|
2018-05-02 13:57:26 +00:00
|
|
|
B(Jump), U8(53),
|
|
|
|
B(Jump), U8(37),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(Star), R(15),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(CreateCatchContext), R(15), U8(12), U8(18),
|
|
|
|
B(Star), R(14),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaTheHole),
|
|
|
|
B(SetPendingMessage),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(14),
|
|
|
|
B(PushContext), R(15),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(17),
|
|
|
|
B(Mov), R(2), R(16),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorReject), R(16), U8(2),
|
|
|
|
B(PopContext), R(15),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(Star), R(12),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(LdaSmi), I8(1),
|
|
|
|
B(Star), R(11),
|
[ignition] Always write the deferred command result register
For deferred commands (such as in try-finally), some deferred commands
save and restore the accumulator using a result register (e.g. return,
throw, rethrow), while others don't (e.g. break, continue,
fall-through).
However, conditionally reading this result register that may not ever be
written caused it to be considered live from the start of the function,
as far as the liveness analysis could statically tell.
Now, we write the result register for all deferred commands, including
the fall-through. As a micro-optimization, we re-use the Smi command
tokeen to clobber the result, rather than emitting an LdaUndefined.
Bug: chromium:758472
Change-Id: I2ea65e2249b40ee6403216e654a8bb88d50bec3b
Reviewed-on: https://chromium-review.googlesource.com/635592
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47612}
2017-08-25 16:04:42 +00:00
|
|
|
B(Jump), U8(16),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaSmi), I8(-1),
|
[ignition] Always write the deferred command result register
For deferred commands (such as in try-finally), some deferred commands
save and restore the accumulator using a result register (e.g. return,
throw, rethrow), while others don't (e.g. break, continue,
fall-through).
However, conditionally reading this result register that may not ever be
written caused it to be considered live from the start of the function,
as far as the liveness analysis could statically tell.
Now, we write the result register for all deferred commands, including
the fall-through. As a micro-optimization, we re-use the Smi command
tokeen to clobber the result, rather than emitting an LdaUndefined.
Bug: chromium:758472
Change-Id: I2ea65e2249b40ee6403216e654a8bb88d50bec3b
Reviewed-on: https://chromium-review.googlesource.com/635592
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47612}
2017-08-25 16:04:42 +00:00
|
|
|
B(Star), R(12),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(11),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(Jump), U8(8),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(Star), R(12),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(LdaSmi), I8(2),
|
|
|
|
B(Star), R(11),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaTheHole),
|
|
|
|
B(SetPendingMessage),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(13),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(2), U8(1),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(13),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(SetPendingMessage),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(11),
|
|
|
|
B(SwitchOnSmiNoFeedback), U8(20), U8(3), I8(0),
|
2017-08-09 13:43:29 +00:00
|
|
|
B(Jump), U8(22),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaTrue),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(16),
|
|
|
|
B(Mov), R(2), R(14),
|
|
|
|
B(Mov), R(12), R(15),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorResolve), R(14), U8(3),
|
2017-07-02 20:59:29 +00:00
|
|
|
/* 50 S> */ B(Return),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(12),
|
2017-07-02 20:59:29 +00:00
|
|
|
/* 50 S> */ B(Return),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(12),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(ReThrow),
|
|
|
|
B(LdaUndefined),
|
|
|
|
/* 50 S> */ B(Return),
|
|
|
|
]
|
|
|
|
constant pool: [
|
2018-01-23 13:51:38 +00:00
|
|
|
Smi [30],
|
|
|
|
Smi [154],
|
2018-05-02 13:57:26 +00:00
|
|
|
Smi [372],
|
2017-08-09 13:43:29 +00:00
|
|
|
Smi [15],
|
2017-07-02 20:59:29 +00:00
|
|
|
Smi [7],
|
|
|
|
TUPLE2_TYPE,
|
|
|
|
SYMBOL_TYPE,
|
|
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
|
|
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
|
|
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
|
2017-08-09 13:43:29 +00:00
|
|
|
Smi [15],
|
2017-07-02 20:59:29 +00:00
|
|
|
Smi [7],
|
|
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"],
|
2018-02-16 12:36:47 +00:00
|
|
|
SCOPE_INFO_TYPE,
|
2017-07-02 20:59:29 +00:00
|
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],
|
|
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
|
|
|
|
Smi [6],
|
|
|
|
Smi [14],
|
2018-02-16 12:36:47 +00:00
|
|
|
SCOPE_INFO_TYPE,
|
2018-05-02 13:57:26 +00:00
|
|
|
Smi [398],
|
2017-07-02 20:59:29 +00:00
|
|
|
Smi [6],
|
2017-08-09 13:43:29 +00:00
|
|
|
Smi [20],
|
|
|
|
Smi [23],
|
2017-07-02 20:59:29 +00:00
|
|
|
]
|
|
|
|
handlers: [
|
2018-05-02 13:57:26 +00:00
|
|
|
[20, 437, 445],
|
|
|
|
[23, 400, 402],
|
|
|
|
[61, 223, 231],
|
2018-01-24 11:19:51 +00:00
|
|
|
[64, 185, 187],
|
2018-05-02 13:57:26 +00:00
|
|
|
[292, 302, 304],
|
2017-07-02 20:59:29 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
---
|
|
|
|
snippet: "
|
|
|
|
function* g() { yield 42 }
|
|
|
|
async function* f() { yield* g() }
|
|
|
|
f();
|
|
|
|
"
|
2018-01-23 13:51:38 +00:00
|
|
|
frame size: 17
|
2017-07-02 20:59:29 +00:00
|
|
|
parameter count: 1
|
2018-05-02 13:57:26 +00:00
|
|
|
bytecode array length: 480
|
2017-07-02 20:59:29 +00:00
|
|
|
bytecodes: [
|
2018-01-23 13:51:38 +00:00
|
|
|
B(SwitchOnGeneratorState), R(0), U8(0), U8(5),
|
|
|
|
B(Mov), R(closure), R(1),
|
|
|
|
B(Mov), R(this), R(2),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(Star), R(0),
|
|
|
|
/* 44 E> */ B(StackCheck),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Mov), R(context), R(3),
|
2017-08-16 16:43:28 +00:00
|
|
|
B(Mov), R(context), R(4),
|
2017-07-25 18:37:36 +00:00
|
|
|
B(Ldar), R(0),
|
2018-01-23 13:51:38 +00:00
|
|
|
/* 44 E> */ B(SuspendGenerator), R(0), R(0), U8(5), U8(0),
|
|
|
|
B(ResumeGenerator), R(0), R(0), U8(5),
|
|
|
|
B(Star), R(5),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
|
2017-08-16 16:43:28 +00:00
|
|
|
B(SwitchOnSmiNoFeedback), U8(5), U8(2), I8(0),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(5),
|
2017-07-02 20:59:29 +00:00
|
|
|
/* 44 E> */ B(Throw),
|
|
|
|
B(LdaZero),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(1),
|
|
|
|
B(Mov), R(5), R(2),
|
|
|
|
B(JumpConstant), U8(19),
|
2017-10-19 15:12:42 +00:00
|
|
|
/* 49 S> */ B(LdaGlobal), U8(7), U8(0),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(12),
|
|
|
|
/* 56 E> */ B(CallUndefinedReceiver0), R(12), U8(2),
|
|
|
|
B(Star), R(10),
|
|
|
|
B(LdaNamedProperty), R(10), U8(8), U8(4),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(JumpIfUndefined), U8(17),
|
|
|
|
B(JumpIfNull), U8(15),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(11),
|
|
|
|
B(CallProperty0), R(11), R(10), U8(6),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(JumpIfJSReceiver), U8(23),
|
|
|
|
B(CallRuntime), U16(Runtime::kThrowSymbolAsyncIteratorInvalid), R(0), U8(0),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(LdaNamedProperty), R(10), U8(9), U8(8),
|
|
|
|
B(Star), R(11),
|
|
|
|
B(CallProperty0), R(11), R(10), U8(10),
|
|
|
|
B(Star), R(11),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(11), U8(1),
|
|
|
|
B(Star), R(7),
|
|
|
|
B(LdaNamedProperty), R(7), U8(10), U8(12),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(Star), R(9),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(LdaUndefined),
|
|
|
|
B(Star), R(8),
|
2017-07-13 13:53:13 +00:00
|
|
|
B(LdaZero),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(6),
|
|
|
|
B(Ldar), R(6),
|
|
|
|
B(SwitchOnSmiNoFeedback), U8(11), U8(2), I8(1),
|
|
|
|
B(CallProperty1), R(9), R(7), R(8), U8(14),
|
|
|
|
B(Jump), U8(110),
|
|
|
|
B(LdaNamedProperty), R(7), U8(13), U8(16),
|
2017-08-16 16:43:28 +00:00
|
|
|
B(JumpIfUndefined), U8(13),
|
|
|
|
B(JumpIfNull), U8(11),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(12),
|
|
|
|
B(CallProperty1), R(12), R(7), R(8), U8(18),
|
|
|
|
B(Jump), U8(93),
|
2017-07-13 13:53:13 +00:00
|
|
|
B(LdaZero),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(1),
|
|
|
|
B(Mov), R(8), R(2),
|
|
|
|
B(JumpConstant), U8(20),
|
|
|
|
B(LdaNamedProperty), R(7), U8(14), U8(20),
|
2017-08-16 16:43:28 +00:00
|
|
|
B(JumpIfUndefined), U8(13),
|
|
|
|
B(JumpIfNull), U8(11),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(12),
|
|
|
|
B(CallProperty1), R(12), R(7), R(8), U8(22),
|
|
|
|
B(Jump), U8(68),
|
|
|
|
B(LdaNamedProperty), R(7), U8(13), U8(24),
|
|
|
|
B(JumpIfUndefined), U8(57),
|
|
|
|
B(JumpIfNull), U8(55),
|
|
|
|
B(Star), R(12),
|
|
|
|
B(CallProperty0), R(12), R(7), U8(26),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(Jump), U8(2),
|
2017-08-16 16:43:28 +00:00
|
|
|
B(Star), R(13),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Mov), R(0), R(12),
|
2018-02-19 11:34:06 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorAwaitUncaught), R(12), U8(2),
|
2018-01-24 11:16:52 +00:00
|
|
|
/* 49 E> */ B(SuspendGenerator), R(0), R(0), U8(12), U8(1),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(ResumeGenerator), R(0), R(0), U8(12),
|
|
|
|
B(Star), R(12),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(13),
|
2017-07-13 13:53:13 +00:00
|
|
|
B(LdaZero),
|
2018-04-18 00:04:34 +00:00
|
|
|
B(TestReferenceEqual), R(13),
|
2017-07-13 13:53:13 +00:00
|
|
|
B(JumpIfTrue), U8(5),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(12),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(ReThrow),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(12),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(JumpIfJSReceiver), U8(9),
|
|
|
|
B(Star), R(14),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(14), U8(1),
|
|
|
|
B(CallRuntime), U16(Runtime::kThrowThrowMethodMissing), R(0), U8(0),
|
Revert "[esnext] load `iterator.next` only once at beginning of iteration"
This reverts commit bf4cc9ee154f15942594016777f77d3208230f5f.
Reason for revert: Breaks windows with msvc and linux with gcc
https://build.chromium.org/p/client.v8/builders/V8%20Win64%20-%20msvc/builds/841
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20gcc%204.8/builds/17265
Original change's description:
> [esnext] load `iterator.next` only once at beginning of iteration
>
> https://github.com/tc39/ecma262/pull/988 gained concensus during the
> september 2017 TC39 meetings. This moves the load of the "next" method
> to the very beginning of the iteration protocol, rather than during
> each iteration step.
>
> This impacts:
>
> - yield*
> - for-of loops
> - spread arguments
> - array spreads
>
> In the v8 implementation, this also affects async iteration versions of
> these things (the sole exception being the Async-From-Sync iterator,
> which requires a few more changes to work with this, likely done in a
> followup patch).
>
> This change introduces a new AST node, ResolvedProperty, which can be used
> as a callee by Call nodes to produce the same bytecode as Property calls,
> without observably re-loading the property. This is used in several
> AST-desugarings involving the iteration protocol.
>
> BUG=v8:6861, v8:5699
> R=rmcilroy@chromium.org, neis@chromium.org, adamk@chromium.org
>
> Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
> Change-Id: Ib81106a0182687fc5efea0bc32302ad06376773b
> Reviewed-on: https://chromium-review.googlesource.com/687997
> Commit-Queue: Caitlin Potter <caitp@igalia.com>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Reviewed-by: Adam Klein <adamk@chromium.org>
> Reviewed-by: Georg Neis <neis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50452}
TBR=rmcilroy@chromium.org,adamk@chromium.org,neis@chromium.org,caitp@igalia.com,caitp@chromium.org
Change-Id: I1797c0d596dfd6850d6f0f505f591a7a990dd1f1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6861, v8:5699
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/857616
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50454}
2018-01-09 16:50:16 +00:00
|
|
|
B(Star), R(13),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Mov), R(0), R(12),
|
2018-02-19 11:34:06 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorAwaitUncaught), R(12), U8(2),
|
2018-01-24 11:16:52 +00:00
|
|
|
/* 49 E> */ B(SuspendGenerator), R(0), R(0), U8(12), U8(2),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(ResumeGenerator), R(0), R(0), U8(12),
|
|
|
|
B(Star), R(12),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(13),
|
2017-07-13 13:53:13 +00:00
|
|
|
B(LdaZero),
|
2018-04-18 00:04:34 +00:00
|
|
|
B(TestReferenceEqual), R(13),
|
2017-07-13 13:53:13 +00:00
|
|
|
B(JumpIfTrue), U8(5),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(12),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(ReThrow),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(12),
|
|
|
|
B(Mov), R(12), R(5),
|
2017-08-16 16:43:28 +00:00
|
|
|
B(JumpIfJSReceiver), U8(7),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(5), U8(1),
|
|
|
|
B(LdaNamedProperty), R(5), U8(15), U8(28),
|
|
|
|
B(JumpIfToBooleanTrue), U8(38),
|
|
|
|
B(LdaNamedProperty), R(5), U8(16), U8(30),
|
|
|
|
B(Star), R(15),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(LdaFalse),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(16),
|
|
|
|
B(Mov), R(0), R(14),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorYield), R(14), U8(3),
|
2018-01-24 11:16:52 +00:00
|
|
|
/* 49 E> */ B(SuspendGenerator), R(0), R(0), U8(14), U8(3),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(ResumeGenerator), R(0), R(0), U8(14),
|
|
|
|
B(Star), R(8),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(6),
|
|
|
|
B(JumpLoop), U8(206), I8(0),
|
|
|
|
B(LdaNamedProperty), R(5), U8(16), U8(32),
|
2017-08-16 16:43:28 +00:00
|
|
|
B(Star), R(7),
|
|
|
|
B(LdaSmi), I8(1),
|
2018-04-18 00:04:34 +00:00
|
|
|
B(TestReferenceEqual), R(6),
|
2017-08-16 16:43:28 +00:00
|
|
|
B(JumpIfFalse), U8(10),
|
|
|
|
B(LdaZero),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(1),
|
|
|
|
B(Mov), R(7), R(2),
|
2018-05-02 13:57:26 +00:00
|
|
|
B(Jump), U8(96),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaUndefined),
|
2017-08-16 16:43:28 +00:00
|
|
|
B(Star), R(6),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Mov), R(0), R(5),
|
2018-02-19 11:34:06 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorAwaitUncaught), R(5), U8(2),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(SuspendGenerator), R(0), R(0), U8(5), U8(4),
|
|
|
|
B(ResumeGenerator), R(0), R(0), U8(5),
|
|
|
|
B(Star), R(5),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(6),
|
Reland "[async-iteration] implement spec-change to `yield` in async generators"
Per https://github.com/tc39/proposal-async-iteration/pull/102/files:
AsyncGeneratorResolve no longer unwraps a value component. Instead, the value is
unwrapped before the builtin call via Await, allowing Promise rejections to
affect the generator control flow.
Thus, all `yield <expr>` implicitly become `yield await <expr>`.
Additionally, `return <expr>` becomes `return await <expr>`. Finally, when the
generator is resumed with `.return()`, the parameter passed to .return() is
awaited before generator execution properly continues).
BUG=v8:6187, v8:5855
R=littledan@chromium.org, neis@chromium.org, adamk@chromium.org
TBR=rmcilroy@chromium.org, neis@chromium.org
Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: Id7718028fd555481f9f4ca0dbecfa788e3057c48
Reviewed-on: https://chromium-review.googlesource.com/594500
Reviewed-by: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#47058}
2017-08-01 14:45:03 +00:00
|
|
|
B(LdaZero),
|
2018-04-18 00:04:34 +00:00
|
|
|
B(TestReferenceEqual), R(6),
|
Reland "[async-iteration] implement spec-change to `yield` in async generators"
Per https://github.com/tc39/proposal-async-iteration/pull/102/files:
AsyncGeneratorResolve no longer unwraps a value component. Instead, the value is
unwrapped before the builtin call via Await, allowing Promise rejections to
affect the generator control flow.
Thus, all `yield <expr>` implicitly become `yield await <expr>`.
Additionally, `return <expr>` becomes `return await <expr>`. Finally, when the
generator is resumed with `.return()`, the parameter passed to .return() is
awaited before generator execution properly continues).
BUG=v8:6187, v8:5855
R=littledan@chromium.org, neis@chromium.org, adamk@chromium.org
TBR=rmcilroy@chromium.org, neis@chromium.org
Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: Id7718028fd555481f9f4ca0dbecfa788e3057c48
Reviewed-on: https://chromium-review.googlesource.com/594500
Reviewed-by: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#47058}
2017-08-01 14:45:03 +00:00
|
|
|
B(JumpIfTrue), U8(5),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(5),
|
Reland "[async-iteration] implement spec-change to `yield` in async generators"
Per https://github.com/tc39/proposal-async-iteration/pull/102/files:
AsyncGeneratorResolve no longer unwraps a value component. Instead, the value is
unwrapped before the builtin call via Await, allowing Promise rejections to
affect the generator control flow.
Thus, all `yield <expr>` implicitly become `yield await <expr>`.
Additionally, `return <expr>` becomes `return await <expr>`. Finally, when the
generator is resumed with `.return()`, the parameter passed to .return() is
awaited before generator execution properly continues).
BUG=v8:6187, v8:5855
R=littledan@chromium.org, neis@chromium.org, adamk@chromium.org
TBR=rmcilroy@chromium.org, neis@chromium.org
Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: Id7718028fd555481f9f4ca0dbecfa788e3057c48
Reviewed-on: https://chromium-review.googlesource.com/594500
Reviewed-by: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#47058}
2017-08-01 14:45:03 +00:00
|
|
|
B(ReThrow),
|
2017-07-13 13:53:13 +00:00
|
|
|
B(LdaZero),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(1),
|
|
|
|
B(Mov), R(5), R(2),
|
2018-05-02 13:57:26 +00:00
|
|
|
B(Jump), U8(53),
|
|
|
|
B(Jump), U8(37),
|
2017-08-16 16:43:28 +00:00
|
|
|
B(Star), R(5),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(CreateCatchContext), R(5), U8(17), U8(18),
|
|
|
|
B(Star), R(4),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaTheHole),
|
|
|
|
B(SetPendingMessage),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(4),
|
|
|
|
B(PushContext), R(5),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaImmutableCurrentContextSlot), U8(4),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(7),
|
|
|
|
B(Mov), R(0), R(6),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorReject), R(6), U8(2),
|
|
|
|
B(PopContext), R(5),
|
2017-08-16 16:43:28 +00:00
|
|
|
B(Star), R(2),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(LdaSmi), I8(1),
|
|
|
|
B(Star), R(1),
|
[ignition] Always write the deferred command result register
For deferred commands (such as in try-finally), some deferred commands
save and restore the accumulator using a result register (e.g. return,
throw, rethrow), while others don't (e.g. break, continue,
fall-through).
However, conditionally reading this result register that may not ever be
written caused it to be considered live from the start of the function,
as far as the liveness analysis could statically tell.
Now, we write the result register for all deferred commands, including
the fall-through. As a micro-optimization, we re-use the Smi command
tokeen to clobber the result, rather than emitting an LdaUndefined.
Bug: chromium:758472
Change-Id: I2ea65e2249b40ee6403216e654a8bb88d50bec3b
Reviewed-on: https://chromium-review.googlesource.com/635592
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47612}
2017-08-25 16:04:42 +00:00
|
|
|
B(Jump), U8(16),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaSmi), I8(-1),
|
2017-08-16 16:43:28 +00:00
|
|
|
B(Star), R(2),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(1),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(Jump), U8(8),
|
2017-08-16 16:43:28 +00:00
|
|
|
B(Star), R(2),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(LdaSmi), I8(2),
|
|
|
|
B(Star), R(1),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaTheHole),
|
|
|
|
B(SetPendingMessage),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(3),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(0), U8(1),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(3),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(SetPendingMessage),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(1),
|
|
|
|
B(SwitchOnSmiNoFeedback), U8(21), U8(3), I8(0),
|
2017-08-09 13:43:29 +00:00
|
|
|
B(Jump), U8(22),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(LdaTrue),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(6),
|
|
|
|
B(Mov), R(0), R(4),
|
|
|
|
B(Mov), R(2), R(5),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorResolve), R(4), U8(3),
|
2017-07-02 20:59:29 +00:00
|
|
|
/* 60 S> */ B(Return),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(2),
|
2017-07-02 20:59:29 +00:00
|
|
|
/* 60 S> */ B(Return),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(2),
|
2017-07-02 20:59:29 +00:00
|
|
|
B(ReThrow),
|
|
|
|
B(LdaUndefined),
|
|
|
|
/* 60 S> */ B(Return),
|
|
|
|
]
|
|
|
|
constant pool: [
|
2018-01-23 13:51:38 +00:00
|
|
|
Smi [30],
|
|
|
|
Smi [201],
|
|
|
|
Smi [251],
|
2018-01-24 11:16:52 +00:00
|
|
|
Smi [310],
|
2018-01-23 13:51:38 +00:00
|
|
|
Smi [360],
|
2017-08-09 13:43:29 +00:00
|
|
|
Smi [15],
|
2017-07-02 20:59:29 +00:00
|
|
|
Smi [7],
|
|
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["g"],
|
|
|
|
SYMBOL_TYPE,
|
|
|
|
SYMBOL_TYPE,
|
|
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
|
2018-01-11 17:24:11 +00:00
|
|
|
Smi [11],
|
|
|
|
Smi [36],
|
2017-07-02 20:59:29 +00:00
|
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],
|
|
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["throw"],
|
|
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
|
|
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
|
2017-08-16 16:43:28 +00:00
|
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"],
|
2018-02-16 12:36:47 +00:00
|
|
|
SCOPE_INFO_TYPE,
|
2018-05-02 13:57:26 +00:00
|
|
|
Smi [386],
|
|
|
|
Smi [287],
|
2017-07-02 20:59:29 +00:00
|
|
|
Smi [6],
|
2017-08-09 13:43:29 +00:00
|
|
|
Smi [20],
|
|
|
|
Smi [23],
|
2017-07-02 20:59:29 +00:00
|
|
|
]
|
|
|
|
handlers: [
|
2018-05-02 13:57:26 +00:00
|
|
|
[20, 425, 433],
|
2018-01-24 11:19:51 +00:00
|
|
|
[23, 388, 390],
|
2017-07-02 20:59:29 +00:00
|
|
|
]
|
|
|
|
|