|
|
JS templates
This CL mostly removes the 'fluent' API and replaces it with templates.
The JS code is parsed and converted (compiled) into an instantiation function.
The instantation function can be reused to stamp out similar copies.
This has made the large helper functions more readable since they are now mostly real JavaScript code.
Notes:
'if (#) stmt' adds a conditional statement if the argument is a Dart
bool. It constructs the tree if the argument is a JS Expression.
Fixed the statement template arguments so that '#;' is required.
There is a template manager that reuses templates with the same source.
This is persistent between compilation since the strings should be all 'constant'.
I am currently hunting down the strings parsed by 'js(string)'.
I have reduced it from 18k to O(500) for vampire.
The blocker is the runtime type parameters system - it generates an AST, prints it, and reparses it, giving an unbounded number of small templates, mostly with no parameters. So these templates are not cached and pay the price of repeated compilation.
R=floitsch@google.com
Committed: https://code.google.com/p/dart/source/detail?r=35296
Total comments: 3
Total comments: 95
Total comments: 4
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+1949 lines, -1138 lines) |
Patch |
 |
M |
sdk/lib/_internal/compiler/implementation/js/builder.dart
|
View
|
1
2
3
4
|
17 chunks |
+351 lines, -305 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/compiler/implementation/js/js.dart
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/compiler/implementation/js/nodes.dart
|
View
|
1
2
3
4
|
4 chunks |
+49 lines, -95 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/compiler/implementation/js/printer.dart
|
View
|
1
2
3
4
|
2 chunks |
+20 lines, -7 lines |
0 comments
|
Download
|
 |
A |
sdk/lib/_internal/compiler/implementation/js/template.dart
|
View
|
1
2
3
4
|
1 chunk |
+676 lines, -0 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
|
View
|
1
2
3
4
|
5 chunks |
+14 lines, -18 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
|
View
|
1
2
3
4
|
4 chunks |
+8 lines, -11 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart
|
View
|
1
2
3
4
|
7 chunks |
+48 lines, -30 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart
|
View
|
1
2
3
4
|
13 chunks |
+309 lines, -338 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/compiler/implementation/js_emitter/container_builder.dart
|
View
|
1
2
3
4
|
13 chunks |
+35 lines, -31 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/compiler/implementation/js_emitter/interceptor_emitter.dart
|
View
|
|
11 chunks |
+80 lines, -120 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/compiler/implementation/js_emitter/metadata_emitter.dart
|
View
|
|
3 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/compiler/implementation/js_emitter/nsm_emitter.dart
|
View
|
1
2
3
4
|
4 chunks |
+117 lines, -102 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/compiler/implementation/js_emitter/reflection_data_parser.dart
|
View
|
|
3 chunks |
+2 lines, -9 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/compiler/implementation/js_emitter/type_test_emitter.dart
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/compiler/implementation/native_handler.dart
|
View
|
1
2
3
|
4 chunks |
+14 lines, -7 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/compiler/implementation/ssa/builder.dart
|
View
|
1
|
14 chunks |
+29 lines, -17 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
|
View
|
1
2
3
4
|
5 chunks |
+26 lines, -28 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
|
View
|
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/compiler/implementation/ssa/ssa_tracer.dart
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/lib/isolate_helper.dart
|
View
|
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/lib/js_helper.dart
|
View
|
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/lib/js_mirrors.dart
|
View
|
1
2
3
4
|
1 chunk |
+7 lines, -2 lines |
0 comments
|
Download
|
 |
A |
tests/compiler/dart2js/js_parser_statements_test.dart
|
View
|
1
2
3
|
1 chunk |
+145 lines, -0 lines |
0 comments
|
Download
|
Total messages: 9 (0 generated)
|