|
Detect simple tail calls
This CL contains the first steps towards tail call optimization:
* Structurally detect tail calls during instruction selection,
looking for special return/call combinations.
* Added new architecture-specific instructions for tail calls which
jump instead of call and take care of frame adjustment.
* Moved some code around.
Currently we restrict tail calls to callees which only use registers
for arguments/return value and to call sites which are explicitly
marked as being OK for tail calls. This excludes, among other things,
call sites in sloppy JS functions and our IC machinery (both need in
general to be able to access the caller's frame).
All this is behind a flag --turbo-tail-calls, which is currently off
by default, so it can easily be toggled.
Committed: https://crrev.com/4b122b7504ab458faa4132c338809b40147751bf
Cr-Commit-Position: refs/heads/master@{#28150}
Total comments: 12
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+512 lines, -75 lines) |
Patch |
|
M |
src/compiler.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
src/compiler/arm/code-generator-arm.cc
|
View
|
1
2
3
4
5
|
3 chunks |
+40 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/compiler/arm/instruction-selector-arm.cc
|
View
|
1
2
3
4
5
|
3 chunks |
+9 lines, -6 lines |
0 comments
|
Download
|
|
M |
src/compiler/arm64/code-generator-arm64.cc
|
View
|
1
2
3
4
5
6
|
3 chunks |
+41 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/compiler/arm64/instruction-selector-arm64.cc
|
View
|
1
2
3
4
5
|
3 chunks |
+9 lines, -6 lines |
0 comments
|
Download
|
|
M |
src/compiler/code-generator.h
|
View
|
1
2
3
4
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/compiler/ia32/code-generator-ia32.cc
|
View
|
1
2
3
4
5
6
7
8
|
3 chunks |
+39 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/compiler/ia32/instruction-selector-ia32.cc
|
View
|
1
2
3
4
5
|
3 chunks |
+9 lines, -6 lines |
0 comments
|
Download
|
|
M |
src/compiler/instruction-codes.h
|
View
|
1
2
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/compiler/instruction-selector.h
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
src/compiler/instruction-selector.cc
|
View
|
1
2
3
4
5
6
7
8
|
5 chunks |
+45 lines, -5 lines |
0 comments
|
Download
|
|
M |
src/compiler/js-generic-lowering.cc
|
View
|
1
2
3
4
|
1 chunk |
+4 lines, -2 lines |
0 comments
|
Download
|
|
M |
src/compiler/linkage.h
|
View
|
1
2
3
4
5
6
7
8
|
4 chunks |
+18 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/compiler/linkage.cc
|
View
|
1
2
3
4
5
6
7
8
9
|
2 chunks |
+22 lines, -1 line |
0 comments
|
Download
|
|
M |
src/compiler/linkage-impl.h
|
View
|
1
2
3
|
1 chunk |
+10 lines, -9 lines |
0 comments
|
Download
|
|
M |
src/compiler/mips/code-generator-mips.cc
|
View
|
1
2
3
4
5
|
3 chunks |
+38 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/compiler/mips/instruction-selector-mips.cc
|
View
|
1
2
3
4
5
|
3 chunks |
+9 lines, -6 lines |
0 comments
|
Download
|
|
M |
src/compiler/mips64/code-generator-mips64.cc
|
View
|
1
2
3
4
5
|
3 chunks |
+38 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/compiler/mips64/instruction-selector-mips64.cc
|
View
|
1
2
3
4
5
|
3 chunks |
+10 lines, -6 lines |
0 comments
|
Download
|
|
M |
src/compiler/node-properties.h
|
View
|
1
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
src/compiler/node-properties.cc
|
View
|
1
|
1 chunk |
+9 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/compiler/ppc/code-generator-ppc.cc
|
View
|
1
2
3
4
5
|
4 chunks |
+41 lines, -1 line |
0 comments
|
Download
|
|
M |
src/compiler/ppc/instruction-selector-ppc.cc
|
View
|
1
2
3
4
5
|
3 chunks |
+10 lines, -7 lines |
0 comments
|
Download
|
|
M |
src/compiler/scheduler.cc
|
View
|
1
|
3 chunks |
+2 lines, -9 lines |
0 comments
|
Download
|
|
M |
src/compiler/x64/code-generator-x64.cc
|
View
|
1
2
3
4
5
6
7
8
|
3 chunks |
+40 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/compiler/x64/instruction-selector-x64.cc
|
View
|
1
2
|
3 chunks |
+9 lines, -6 lines |
0 comments
|
Download
|
|
M |
src/flag-definitions.h
|
View
|
1
2
3
4
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/globals.h
|
View
|
1
2
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/hydrogen-instructions.h
|
View
|
1
2
3
4
|
1 chunk |
+0 lines, -3 lines |
0 comments
|
Download
|
|
M |
test/unittests/compiler/instruction-selector-unittest.cc
|
View
|
1
2
3
4
5
6
7
8
|
2 chunks |
+48 lines, -0 lines |
0 comments
|
Download
|
Total messages: 12 (3 generated)
|