|
Add support for fields to the new dart backend.
Field initializers are represented similarly to a function with no
parameters.
When they are emitted in backend_ast_emitter.dart `ensureExpression`
wraps the code in an immediately invoked closure if it is not on the
simple form `return e;`.
Ideally this should never happen, but currently happens for cases like eg.
class A {
static var b = 1;
var a = b++;
}
main() {
var a = new A();
print(a.a);
}
Gets converted to:
class A {
static var b = 1;
var a = (() /* new backend */
{
var v0;
v0 = A.b;
A.b = v0 + 1;
return v0;
}
)();
}
main() /* new backend */
{
print(new A().a);
}
R=kmillikin@google.com
Committed: https://code.google.com/p/dart/source/detail?r=42024
Total comments: 16
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+466 lines, -177 lines) |
Patch |
 |
M |
pkg/analyzer2dart/lib/src/cps_generator.dart
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/cps_ir/constant_propagation.dart
|
View
|
1
2
3
|
6 chunks |
+19 lines, -8 lines |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
|
View
|
|
3 chunks |
+13 lines, -5 lines |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart
|
View
|
1
2
|
8 chunks |
+67 lines, -27 lines |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
|
View
|
1
2
3
|
7 chunks |
+35 lines, -3 lines |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
|
View
|
1
2
3
|
1 chunk |
+8 lines, -0 lines |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
|
View
|
1
2
3
|
3 chunks |
+23 lines, -7 lines |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/cps_ir/optimizers.dart
|
View
|
1
2
|
1 chunk |
+7 lines, -1 line |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/cps_ir/redundant_phi.dart
|
View
|
1
2
3
|
1 chunk |
+11 lines, -1 line |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
|
View
|
1
2
3
|
4 chunks |
+18 lines, -6 lines |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/dart_backend/backend.dart
|
View
|
|
3 chunks |
+29 lines, -28 lines |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/dart_backend/backend_ast_emitter.dart
|
View
|
|
10 chunks |
+65 lines, -18 lines |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/dart_backend/backend_ast_nodes.dart
|
View
|
|
2 chunks |
+11 lines, -1 line |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart
|
View
|
|
4 chunks |
+39 lines, -8 lines |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/dart_backend/renamer.dart
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/js_backend/codegen/codegen.dart
|
View
|
1
2
3
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/js_backend/codegen/task.dart
|
View
|
1
2
3
|
2 chunks |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/tracer.dart
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/tree_ir/optimization/copy_propagator.dart
|
View
|
|
4 chunks |
+10 lines, -13 lines |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/tree_ir/optimization/logical_rewriter.dart
|
View
|
|
1 chunk |
+3 lines, -5 lines |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart
|
View
|
|
1 chunk |
+3 lines, -5 lines |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/tree_ir/optimization/optimization.dart
|
View
|
1
2
|
1 chunk |
+16 lines, -1 line |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
|
View
|
1
2
|
2 chunks |
+14 lines, -1 line |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart
|
View
|
1
2
3
|
6 chunks |
+42 lines, -26 lines |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
|
View
|
1
2
|
4 chunks |
+20 lines, -2 lines |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart
|
View
|
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
pkg/compiler/lib/src/use_unused_api.dart
|
View
|
1
2
3
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
Total messages: 5 (1 generated)
|