Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Side by Side Diff: pkg/compiler/lib/src/cps_ir/use_field_initializers.dart

Issue 1798303002: dart2js: Adds support for custom elements in CPS. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fixed other test Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 library dart2js.cps_ir.use_field_initializers; 4 library dart2js.cps_ir.use_field_initializers;
5 5
6 import 'cps_ir_nodes.dart'; 6 import 'cps_ir_nodes.dart';
7 import 'optimizers.dart'; 7 import 'optimizers.dart';
8 import '../elements/elements.dart'; 8 import '../elements/elements.dart';
9 import '../js_backend/js_backend.dart'; 9 import '../js_backend/js_backend.dart';
10 10
11 /// Eliminates [SetField] instructions when the value can instead be passed into 11 /// Eliminates [SetField] instructions when the value can instead be passed into
12 /// the field initializer of a [CreateInstance] instruction. 12 /// the field initializer of a [CreateInstance] instruction.
13 /// 13 ///
14 /// This compensates for a somewhat common pattern where fields are initialized 14 /// This compensates for a somewhat common pattern where fields are initialized
15 /// in the constructor body instead of using intializers. For example: 15 /// in the constructor body instead of using initializers. For example:
16 /// 16 ///
17 /// class Foo { 17 /// class Foo {
18 /// var x, y; 18 /// var x, y;
19 /// Foo(x, y) { 19 /// Foo(x, y) {
20 /// this.x = x; 20 /// this.x = x;
21 /// this.y = y; 21 /// this.y = y;
22 /// } 22 /// }
23 /// } 23 /// }
24 /// 24 ///
25 /// ==> (IR for Foo constructor) 25 /// ==> (IR for Foo constructor)
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 } 203 }
204 204
205 class EscapeVisitor extends DeepRecursiveVisitor { 205 class EscapeVisitor extends DeepRecursiveVisitor {
206 final UseFieldInitializers main; 206 final UseFieldInitializers main;
207 EscapeVisitor(this.main); 207 EscapeVisitor(this.main);
208 208
209 processReference(Reference ref) { 209 processReference(Reference ref) {
210 main.escape(ref); 210 main.escape(ref);
211 } 211 }
212 } 212 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart ('k') | tests/compiler/dart2js_native/dart2js_native.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698