|
[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
Committed: https://crrev.com/b5f146a02aeb28b89df6a2494ddf700a98d372ec
Cr-Commit-Position: refs/heads/master@{#41555}
Total comments: 2
Total comments: 19
Total comments: 7
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+275 lines, -126 lines) |
Patch |
|
M |
src/asmjs/asm-wasm-builder.cc
|
View
|
1
2
3
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/ast/ast.h
|
View
|
1
2
3
4
|
3 chunks |
+41 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/ast/ast-expression-rewriter.cc
|
View
|
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/ast/ast-literal-reindexer.cc
|
View
|
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/ast/ast-numbering.cc
|
View
|
1
2
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/ast/ast-traversal-visitor.h
|
View
|
1
2
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/ast/prettyprinter.cc
|
View
|
|
2 chunks |
+9 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/bailout-reason.h
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
src/compiler/ast-graph-builder.cc
|
View
|
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/compiler/ast-loop-assignment-analyzer.cc
|
View
|
2
3
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
src/compiler/bytecode-graph-builder.h
|
View
|
|
2 chunks |
+4 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/compiler/bytecode-graph-builder.cc
|
View
|
1
2
3
4
|
2 chunks |
+12 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/crankshaft/hydrogen.cc
|
View
|
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/crankshaft/typing.cc
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
src/full-codegen/full-codegen.cc
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
src/interpreter/bytecode-array-builder.h
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
src/interpreter/bytecode-array-builder.cc
|
View
|
1
2
3
4
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/interpreter/bytecode-array-writer.cc
|
View
|
1
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/interpreter/bytecode-generator.h
|
View
|
1
2
3
4
|
2 chunks |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/interpreter/bytecode-generator.cc
|
View
|
1
2
3
4
|
2 chunks |
+28 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/interpreter/bytecodes.h
|
View
|
1
2
3
4
|
4 chunks |
+4 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/interpreter/interpreter.cc
|
View
|
1
2
3
4
|
1 chunk |
+43 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/parsing/parser.h
|
View
|
1
2
3
4
|
1 chunk |
+0 lines, -2 lines |
0 comments
|
Download
|
|
M |
src/parsing/parser.cc
|
View
|
1
2
3
4
|
5 chunks |
+7 lines, -41 lines |
0 comments
|
Download
|
|
M |
src/parsing/pattern-rewriter.cc
|
View
|
1
2
3
4
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
src/runtime/runtime.h
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
src/runtime/runtime-internal.cc
|
View
|
1
2
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
|
M |
test/cctest/compiler/test-loop-assignment-analysis.cc
|
View
|
1
2
3
|
1 chunk |
+2 lines, -21 lines |
0 comments
|
Download
|
|
M |
test/cctest/interpreter/bytecode_expectations/ForOf.golden
|
View
|
1
2
|
12 chunks |
+37 lines, -32 lines |
0 comments
|
Download
|
|
M |
test/cctest/interpreter/bytecode_expectations/Generators.golden
|
View
|
1
2
|
8 chunks |
+16 lines, -15 lines |
0 comments
|
Download
|
|
M |
test/cctest/interpreter/bytecode_expectations/Modules.golden
|
View
|
1
2
3
4
|
11 chunks |
+11 lines, -11 lines |
0 comments
|
Download
|
|
M |
test/unittests/interpreter/bytecode-array-builder-unittest.cc
|
View
|
1
2
3
4
|
3 chunks |
+8 lines, -3 lines |
0 comments
|
Download
|
Total messages: 50 (24 generated)
|