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
|
|
|
"
|
2018-01-23 13:51:38 +00:00
|
|
|
frame size: 3
|
2016-04-18 14:13:04 +00:00
|
|
|
parameter count: 1
|
2018-01-24 11:19:51 +00:00
|
|
|
bytecode array length: 44
|
2016-04-18 14:13:04 +00:00
|
|
|
bytecodes: [
|
2018-01-23 13:51:38 +00:00
|
|
|
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
|
|
|
|
B(Mov), R(closure), R(1),
|
|
|
|
B(Mov), R(this), R(2),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2),
|
2017-05-24 13:54:57 +00:00
|
|
|
B(Star), R(0),
|
2016-05-11 12:21:56 +00:00
|
|
|
/* 11 E> */ B(StackCheck),
|
2018-01-23 13:51:38 +00:00
|
|
|
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(1), U8(0),
|
|
|
|
B(ResumeGenerator), R(0), R(0), U8(1),
|
|
|
|
B(Star), R(1),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
|
2017-06-05 13:23:20 +00:00
|
|
|
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(1),
|
2017-06-05 13:23:20 +00:00
|
|
|
/* 11 E> */ B(Throw),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(1),
|
2016-05-11 12:21:56 +00:00
|
|
|
/* 16 S> */ B(Return),
|
|
|
|
B(LdaUndefined),
|
|
|
|
/* 16 S> */ B(Return),
|
2016-04-18 14:13:04 +00:00
|
|
|
]
|
|
|
|
constant pool: [
|
2018-01-23 13:51:38 +00:00
|
|
|
Smi [22],
|
2017-06-13 13:49:45 +00:00
|
|
|
Smi [10],
|
2017-06-05 13:23:20 +00:00
|
|
|
Smi [7],
|
2016-04-18 14:13:04 +00:00
|
|
|
]
|
|
|
|
handlers: [
|
|
|
|
]
|
|
|
|
|
|
|
|
---
|
|
|
|
snippet: "
|
|
|
|
function* f() { yield 42 }
|
2016-05-24 12:51:18 +00:00
|
|
|
f();
|
2016-04-18 14:13:04 +00:00
|
|
|
"
|
2018-01-23 13:51:38 +00:00
|
|
|
frame size: 3
|
2016-04-18 14:13:04 +00:00
|
|
|
parameter count: 1
|
2018-01-24 11:19:51 +00:00
|
|
|
bytecode array length: 80
|
2016-04-18 14:13:04 +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-05-24 13:54:57 +00:00
|
|
|
B(Star), R(0),
|
2016-05-11 12:21:56 +00:00
|
|
|
/* 11 E> */ B(StackCheck),
|
2018-01-23 13:51:38 +00:00
|
|
|
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(1), U8(0),
|
|
|
|
B(ResumeGenerator), R(0), R(0), U8(1),
|
|
|
|
B(Star), R(1),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
|
2017-06-05 13:23:20 +00:00
|
|
|
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(1),
|
2017-06-05 13:23:20 +00:00
|
|
|
/* 11 E> */ B(Throw),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(1),
|
2017-06-05 19:54:14 +00:00
|
|
|
/* 25 S> */ B(Return),
|
2017-05-24 13:54:57 +00:00
|
|
|
/* 16 S> */ B(LdaSmi), I8(42),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(1),
|
2017-07-20 12:35:28 +00:00
|
|
|
B(LdaFalse),
|
2017-06-02 11:55:48 +00:00
|
|
|
B(Star), R(2),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(1), U8(2),
|
|
|
|
/* 16 E> */ B(SuspendGenerator), R(0), R(0), U8(1), U8(1),
|
|
|
|
B(ResumeGenerator), R(0), R(0), U8(1),
|
|
|
|
B(Star), R(1),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
|
2017-06-05 13:23:20 +00:00
|
|
|
B(SwitchOnSmiNoFeedback), U8(4), U8(2), I8(0),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(1),
|
2017-06-05 13:23:20 +00:00
|
|
|
/* 16 E> */ B(Throw),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(1),
|
2016-05-11 12:21:56 +00:00
|
|
|
/* 25 S> */ B(Return),
|
|
|
|
B(LdaUndefined),
|
|
|
|
/* 25 S> */ B(Return),
|
2016-04-18 14:13:04 +00:00
|
|
|
]
|
|
|
|
constant pool: [
|
2018-01-23 13:51:38 +00:00
|
|
|
Smi [22],
|
|
|
|
Smi [58],
|
2017-06-13 13:49:45 +00:00
|
|
|
Smi [10],
|
2017-06-05 13:23:20 +00:00
|
|
|
Smi [7],
|
2017-06-13 13:49:45 +00:00
|
|
|
Smi [10],
|
2017-06-05 13:23:20 +00:00
|
|
|
Smi [7],
|
2016-04-18 14:13:04 +00:00
|
|
|
]
|
|
|
|
handlers: [
|
|
|
|
]
|
|
|
|
|
|
|
|
---
|
|
|
|
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
|
|
|
"
|
2019-01-14 14:15:52 +00:00
|
|
|
frame size: 16
|
2016-04-18 14:13:04 +00:00
|
|
|
parameter count: 1
|
2019-01-14 14:15:52 +00:00
|
|
|
bytecode array length: 261
|
2016-04-18 14:13:04 +00:00
|
|
|
bytecodes: [
|
2019-01-31 15:36:58 +00:00
|
|
|
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(Mov), R(closure), R(4),
|
|
|
|
B(Mov), R(this), R(5),
|
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
|
2019-01-31 15:36:58 +00:00
|
|
|
B(Star), R(0),
|
2016-05-11 12:21:56 +00:00
|
|
|
/* 11 E> */ B(StackCheck),
|
2019-01-31 15:36:58 +00:00
|
|
|
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
|
|
|
|
B(ResumeGenerator), R(0), R(0), U8(4),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(Star), R(4),
|
2019-01-31 15:36:58 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
|
2017-06-05 13:23:20 +00:00
|
|
|
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(Ldar), R(4),
|
2017-06-05 13:23:20 +00:00
|
|
|
/* 11 E> */ B(Throw),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(Ldar), R(4),
|
2017-06-05 19:54:14 +00:00
|
|
|
/* 44 S> */ B(Return),
|
2017-07-27 12:45:00 +00:00
|
|
|
/* 30 S> */ B(CreateArrayLiteral), U8(4), U8(0), U8(37),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(Star), R(6),
|
|
|
|
B(LdaNamedProperty), R(6), U8(5), U8(1),
|
|
|
|
B(Star), R(7),
|
|
|
|
B(CallProperty0), R(7), R(6), U8(3),
|
[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),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(Star), R(5),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(LdaNamedProperty), R(5), U8(6), U8(5),
|
|
|
|
B(Star), R(4),
|
|
|
|
B(LdaFalse),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(Star), R(8),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(Mov), R(context), R(11),
|
|
|
|
B(LdaTrue),
|
|
|
|
B(Star), R(8),
|
|
|
|
/* 25 S> */ B(CallProperty0), R(4), R(5), U8(7),
|
|
|
|
B(Star), R(12),
|
|
|
|
B(JumpIfJSReceiver), U8(7),
|
|
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(12), U8(1),
|
|
|
|
B(LdaNamedProperty), R(12), U8(7), U8(9),
|
|
|
|
B(JumpIfToBooleanTrue), U8(64),
|
|
|
|
B(LdaNamedProperty), R(12), U8(8), U8(11),
|
|
|
|
B(Star), R(12),
|
|
|
|
B(LdaFalse),
|
|
|
|
B(Star), R(8),
|
2019-01-31 15:36:58 +00:00
|
|
|
B(Mov), R(12), R(1),
|
2016-05-11 12:21:56 +00:00
|
|
|
/* 16 E> */ B(StackCheck),
|
2019-01-31 15:36:58 +00:00
|
|
|
/* 25 S> */ B(Mov), R(1), R(3),
|
2017-07-20 12:35:28 +00:00
|
|
|
/* 36 S> */ B(LdaFalse),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(Star), R(14),
|
2019-01-31 15:36:58 +00:00
|
|
|
B(Mov), R(3), R(13),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(13), U8(2),
|
2019-01-31 15:36:58 +00:00
|
|
|
/* 36 E> */ B(SuspendGenerator), R(0), R(0), U8(13), U8(1),
|
|
|
|
B(ResumeGenerator), R(0), R(0), U8(13),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(Star), R(13),
|
2019-01-31 15:36:58 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(SwitchOnSmiNoFeedback), U8(9), U8(2), I8(0),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(Ldar), R(13),
|
2017-06-05 13:23:20 +00:00
|
|
|
/* 36 E> */ B(Throw),
|
2019-01-02 16:12:54 +00:00
|
|
|
B(LdaSmi), I8(1),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(Star), R(9),
|
|
|
|
B(Mov), R(13), R(10),
|
|
|
|
B(Jump), U8(20),
|
|
|
|
B(Ldar), R(13),
|
|
|
|
B(JumpLoop), U8(81), I8(0),
|
2017-01-25 17:39:24 +00:00
|
|
|
B(LdaSmi), I8(-1),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(Star), R(10),
|
|
|
|
B(Star), R(9),
|
2019-01-02 16:12:54 +00:00
|
|
|
B(Jump), U8(7),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(Star), R(10),
|
2019-01-02 16:12:54 +00:00
|
|
|
B(LdaZero),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(Star), R(9),
|
2016-11-16 10:46:23 +00:00
|
|
|
B(LdaTheHole),
|
|
|
|
B(SetPendingMessage),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(Star), R(11),
|
|
|
|
B(Ldar), R(8),
|
|
|
|
B(JumpIfToBooleanTrue), U8(60),
|
|
|
|
B(LdaNamedProperty), R(5), U8(11), U8(13),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(13),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(JumpIfUndefined), U8(52),
|
|
|
|
B(JumpIfNull), U8(50),
|
2017-11-07 09:26:56 +00:00
|
|
|
B(TestTypeOf), U8(6),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(JumpIfTrue), U8(18),
|
2019-01-28 18:53:22 +00:00
|
|
|
B(Wide), B(LdaSmi), I16(155),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(14),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(LdaConstant), U8(12),
|
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(15),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(CallRuntime), U16(Runtime::kNewTypeError), R(14), U8(2),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(Throw),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Mov), R(context), R(14),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(CallProperty0), R(13), R(5), U8(15),
|
|
|
|
B(JumpIfJSReceiver), U8(21),
|
|
|
|
B(Star), R(15),
|
|
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(15), U8(1),
|
|
|
|
B(Jump), U8(12),
|
|
|
|
B(Star), R(14),
|
|
|
|
B(LdaZero),
|
|
|
|
B(TestReferenceEqual), R(9),
|
|
|
|
B(JumpIfTrue), U8(5),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(14),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(ReThrow),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(11),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(SetPendingMessage),
|
|
|
|
B(Ldar), R(9),
|
|
|
|
B(SwitchOnSmiNoFeedback), U8(13), U8(2), I8(0),
|
2017-06-13 13:49:45 +00:00
|
|
|
B(Jump), U8(8),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(Ldar), R(10),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(ReThrow),
|
2019-01-14 14:15:52 +00:00
|
|
|
B(Ldar), R(10),
|
2019-01-02 16:12:54 +00:00
|
|
|
/* 44 S> */ B(Return),
|
2016-05-11 12:21:56 +00:00
|
|
|
B(LdaUndefined),
|
|
|
|
/* 44 S> */ B(Return),
|
2016-04-18 14:13:04 +00:00
|
|
|
]
|
|
|
|
constant pool: [
|
2018-01-23 13:51:38 +00:00
|
|
|
Smi [22],
|
2019-01-14 14:15:52 +00:00
|
|
|
Smi [132],
|
2017-06-13 13:49:45 +00:00
|
|
|
Smi [10],
|
2017-06-05 13:23:20 +00:00
|
|
|
Smi [7],
|
2018-07-05 18:34:09 +00:00
|
|
|
ARRAY_BOILERPLATE_DESCRIPTION_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"],
|
2019-01-02 16:12:54 +00:00
|
|
|
Smi [16],
|
2017-06-05 13:23:20 +00:00
|
|
|
Smi [7],
|
2016-09-06 16:10:19 +00:00
|
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],
|
[turbofan] Significantly improve ConsString creation performance.
This change significantly improves the performance of string
concatenation in optimized code for the case where the resulting string
is represented as a ConsString. On the relevant test cases we go from
serializeNaive: 10762 ms.
serializeClever: 7813 ms.
serializeConcat: 10271 ms.
to
serializeNaive: 10278 ms.
serializeClever: 5533 ms.
serializeConcat: 10310 ms.
which represents a 30% improvement on the "clever" benchmark, which
tests specifically the ConsString creation performance.
This was accomplished via a couple of different steps, which are briefly
outlined here:
1. The empty_string gets its own map, so that we can easily recognize
and handle it appropriately in the TurboFan type system. This
allows us to express (and assert) that the inputs to NewConsString
are non-empty strings, making sure that TurboFan no longer creates
"crippled ConsStrings" with empty left or right hand sides.
2. Further split the existing String types in TurboFan to be able to
distinguish between OneByte and TwoByte strings on the type system
level. This allows us to avoid having to dynamically lookup the
resulting ConsString map in case of ConsString creation (i.e. when
we know that both input strings are OneByte strings or at least
one of the input strings is TwoByte).
3. We also introduced more finegrained feedback for the Add bytecode
in the interpreter, having it collect feedback about ConsStrings,
specifically ConsOneByteString and ConsTwoByteString. This feedback
can be used by TurboFan to only inline the relevant code for what
was seen so far. This allows us to remove the Octane/Splay specific
magic in JSTypedLowering to detect ConsString creation, and instead
purely rely on the feedback of what was seen so far (also making it
possible to change the semantics of NewConsString to be a low-level
operator, which is only introduced in SimplifiedLowering by looking
at the input types of StringConcat).
4. On top of the before mentioned type and interpreter changes we added
new operators CheckNonEmptyString, CheckNonEmptyOneByteString, and
CheckNonEmptyTwoByteString, which perform the appropriate (dynamic)
checks.
There are several more improvements that are possible based on this, but
since the change was already quite big, we decided not to put everything
into the first change, but do some follow up tweaks to the type system,
and builtin optimizations later.
Tbr: mstarzinger@chromium.org
Bug: v8:8834, v8:8931, v8:8939, v8:8951
Change-Id: Ia24e17c6048bf2b04df966d3cd441f0edda05c93
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Doc: https://bit.ly/fast-string-concatenation-in-javascript
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1499497
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60318}
2019-03-18 19:33:46 +00:00
|
|
|
EMPTY_STRING_TYPE [""],
|
2017-05-16 11:36:04 +00:00
|
|
|
Smi [6],
|
2017-06-13 13:49:45 +00:00
|
|
|
Smi [9],
|
2016-04-18 14:13:04 +00:00
|
|
|
]
|
|
|
|
handlers: [
|
2019-01-14 14:15:52 +00:00
|
|
|
[79, 163, 171],
|
|
|
|
[217, 230, 232],
|
2016-04-18 14:13:04 +00:00
|
|
|
]
|
|
|
|
|
2017-05-22 14:52:07 +00:00
|
|
|
---
|
|
|
|
snippet: "
|
|
|
|
function* g() { yield 42 }
|
|
|
|
function* f() { yield* g() }
|
|
|
|
f();
|
|
|
|
"
|
2018-01-23 13:51:38 +00:00
|
|
|
frame size: 9
|
2017-05-22 14:52:07 +00:00
|
|
|
parameter count: 1
|
2018-01-24 11:19:51 +00:00
|
|
|
bytecode array length: 217
|
2017-05-22 14:52:07 +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-05-24 13:54:57 +00:00
|
|
|
B(Star), R(0),
|
2017-05-22 14:52:07 +00:00
|
|
|
/* 38 E> */ B(StackCheck),
|
2018-01-23 13:51:38 +00:00
|
|
|
/* 38 E> */ B(SuspendGenerator), R(0), R(0), U8(1), U8(0),
|
|
|
|
B(ResumeGenerator), R(0), R(0), U8(1),
|
|
|
|
B(Star), R(1),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
|
2017-06-05 13:23:20 +00:00
|
|
|
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(1),
|
2017-06-05 13:23:20 +00:00
|
|
|
/* 38 E> */ B(Throw),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(1),
|
2017-06-05 19:54:14 +00:00
|
|
|
/* 54 S> */ B(Return),
|
2017-10-19 15:12:42 +00:00
|
|
|
/* 43 S> */ B(LdaGlobal), U8(4), U8(0),
|
2019-01-02 16:12:54 +00:00
|
|
|
B(Star), R(5),
|
|
|
|
/* 50 E> */ B(CallUndefinedReceiver0), R(5), U8(2),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(6),
|
|
|
|
B(LdaNamedProperty), R(6), U8(5), U8(4),
|
|
|
|
B(Star), R(7),
|
|
|
|
B(CallProperty0), R(7), R(6), U8(6),
|
2017-05-22 14:52:07 +00:00
|
|
|
B(JumpIfJSReceiver), U8(7),
|
|
|
|
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(3),
|
|
|
|
B(LdaNamedProperty), R(3), U8(6), U8(8),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(Star), R(5),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(LdaUndefined),
|
|
|
|
B(Star), R(4),
|
2017-06-22 16:31:00 +00:00
|
|
|
B(LdaZero),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(2),
|
|
|
|
B(Ldar), R(2),
|
|
|
|
B(SwitchOnSmiNoFeedback), U8(7), U8(2), I8(1),
|
|
|
|
B(CallProperty1), R(5), R(3), R(4), U8(10),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(Jump), U8(69),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(LdaNamedProperty), R(3), U8(9), U8(12),
|
2017-06-22 16:31:00 +00:00
|
|
|
B(JumpIfUndefined), U8(13),
|
|
|
|
B(JumpIfNull), U8(11),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(8),
|
|
|
|
B(CallProperty1), R(8), R(3), R(4), U8(14),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(Jump), U8(52),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(4),
|
2017-06-05 19:54:14 +00:00
|
|
|
/* 54 S> */ B(Return),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(LdaNamedProperty), R(3), U8(10), U8(16),
|
2017-06-22 16:31:00 +00:00
|
|
|
B(JumpIfUndefined), U8(13),
|
|
|
|
B(JumpIfNull), U8(11),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(8),
|
|
|
|
B(CallProperty1), R(8), R(3), R(4), U8(18),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(Jump), U8(32),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(LdaNamedProperty), R(3), U8(9), U8(20),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(JumpIfUndefined), U8(21),
|
|
|
|
B(JumpIfNull), U8(19),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(8),
|
|
|
|
B(CallProperty0), R(8), R(3), U8(22),
|
2018-01-11 17:24:11 +00:00
|
|
|
B(Jump), U8(2),
|
|
|
|
B(JumpIfJSReceiver), U8(9),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(8),
|
|
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(8), U8(1),
|
2017-06-22 16:31:00 +00:00
|
|
|
B(CallRuntime), U16(Runtime::kThrowThrowMethodMissing), R(0), U8(0),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Star), R(1),
|
2017-06-22 16:31:00 +00:00
|
|
|
B(JumpIfJSReceiver), U8(7),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(1), U8(1),
|
|
|
|
B(LdaNamedProperty), R(1), U8(11), U8(24),
|
|
|
|
B(JumpIfToBooleanTrue), U8(24),
|
|
|
|
B(Ldar), R(1),
|
|
|
|
/* 43 E> */ B(SuspendGenerator), R(0), R(0), U8(8), U8(1),
|
|
|
|
B(ResumeGenerator), R(0), R(0), U8(8),
|
|
|
|
B(Star), R(4),
|
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(2),
|
|
|
|
B(JumpLoop), U8(114), I8(0),
|
|
|
|
B(LdaNamedProperty), R(1), U8(12), U8(26),
|
2017-08-11 15:16:31 +00:00
|
|
|
B(Star), R(3),
|
2017-05-22 14:52:07 +00:00
|
|
|
B(LdaSmi), I8(1),
|
2018-04-18 00:04:34 +00:00
|
|
|
B(TestReferenceEqual), R(2),
|
2017-06-22 16:31:00 +00:00
|
|
|
B(JumpIfFalse), U8(5),
|
2018-01-23 13:51:38 +00:00
|
|
|
B(Ldar), R(3),
|
2017-06-05 19:54:14 +00:00
|
|
|
/* 54 S> */ B(Return),
|
2017-05-22 14:52:07 +00:00
|
|
|
B(LdaUndefined),
|
|
|
|
/* 54 S> */ B(Return),
|
|
|
|
]
|
|
|
|
constant pool: [
|
2018-01-23 13:51:38 +00:00
|
|
|
Smi [22],
|
|
|
|
Smi [185],
|
2017-06-13 13:49:45 +00:00
|
|
|
Smi [10],
|
2017-06-05 13:23:20 +00:00
|
|
|
Smi [7],
|
2017-05-22 14:52:07 +00:00
|
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["g"],
|
|
|
|
SYMBOL_TYPE,
|
|
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
|
2018-01-11 17:24:11 +00:00
|
|
|
Smi [11],
|
|
|
|
Smi [31],
|
2017-05-22 14:52:07 +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"],
|
|
|
|
]
|
|
|
|
handlers: [
|
|
|
|
]
|
|
|
|
|