|
|
Optimize functions containing try-catch.
This is a first step towards fully optimizing try-catch-finally.
At a catch entry, all local variables and parameters are
expected at a fixed stack location. There is a list of
initial definitions at the catch entry block, similar to
the initial definitions at graph entry.
Inside every try-block there is a special prologue code before each
call (instruction that may throw) inside the try-block. This prologue
is similar to a parallel move instruction: It moves all locals+parameters
to the locations expected by the catch-entry block. The stack frame
is extended with the corresponding number of fixed slots right below
the normal spill slots.
Every function containing try-catch has additional compiler-
generated local variables to pass the context, the exception and
the stack trace.
Variable liveness analysis is adapted to treat locals inside try{} blocks
specially: Every call has an implicit LoadLocal of every local variable.
This CL uses a safe approximiation of liveness which can be optimized further.
Current restrictions which are planned for future CLs:
* No inlining inside try-blocks.
* No inlining of functions containing try-catch.
* No try-finally yet.
R=kmillikin@google.com
Committed: https://code.google.com/p/dart/source/detail?r=22615
Total comments: 7
Total comments: 64
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+1057 lines, -82 lines) |
Patch |
 |
M |
runtime/vm/assembler_ia32.h
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+8 lines, -0 lines |
0 comments
|
Download
|
 |
M |
runtime/vm/assembler_x64.h
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+9 lines, -0 lines |
0 comments
|
Download
|
 |
M |
runtime/vm/compiler.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
M |
runtime/vm/flow_graph.cc
|
View
|
1
2
3
4
5
6
7
|
6 chunks |
+56 lines, -6 lines |
0 comments
|
Download
|
 |
M |
runtime/vm/flow_graph_allocator.h
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+5 lines, -1 line |
0 comments
|
Download
|
 |
M |
runtime/vm/flow_graph_allocator.cc
|
View
|
1
2
3
4
5
6
7
|
8 chunks |
+97 lines, -45 lines |
0 comments
|
Download
|
 |
M |
runtime/vm/flow_graph_builder.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+5 lines, -2 lines |
0 comments
|
Download
|
 |
M |
runtime/vm/flow_graph_compiler.h
|
View
|
1
2
3
4
5
6
7
|
3 chunks |
+7 lines, -0 lines |
0 comments
|
Download
|
 |
M |
runtime/vm/flow_graph_compiler.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
runtime/vm/flow_graph_compiler_ia32.cc
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+76 lines, -1 line |
0 comments
|
Download
|
 |
M |
runtime/vm/flow_graph_compiler_x64.cc
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+75 lines, -1 line |
0 comments
|
Download
|
 |
M |
runtime/vm/flow_graph_inliner.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
 |
M |
runtime/vm/flow_graph_optimizer.h
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+10 lines, -0 lines |
0 comments
|
Download
|
 |
M |
runtime/vm/flow_graph_optimizer.cc
|
View
|
1
2
3
4
5
6
7
|
8 chunks |
+118 lines, -14 lines |
0 comments
|
Download
|
 |
M |
runtime/vm/flow_graph_type_propagator.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+6 lines, -2 lines |
0 comments
|
Download
|
 |
M |
runtime/vm/il_printer.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+11 lines, -0 lines |
0 comments
|
Download
|
 |
M |
runtime/vm/intermediate_language.h
|
View
|
1
2
3
4
5
6
7
|
101 chunks |
+231 lines, -2 lines |
0 comments
|
Download
|
 |
M |
runtime/vm/intermediate_language.cc
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+12 lines, -1 line |
0 comments
|
Download
|
 |
M |
tests/language/try_catch2_test.dart
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
tests/language/try_catch3_test.dart
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
tests/language/try_catch4_test.dart
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+7 lines, -1 line |
0 comments
|
Download
|
 |
M |
tests/language/try_catch5_test.dart
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+4 lines, -2 lines |
0 comments
|
Download
|
 |
A |
tests/language/try_catch_optimized1_test.dart
|
View
|
1
2
3
|
1 chunk |
+299 lines, -0 lines |
0 comments
|
Download
|
 |
M |
tests/language/try_catch_test.dart
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
Total messages: 7 (0 generated)
|