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

Side by Side Diff: pkg/kernel/lib/transformations/erasure.dart

Issue 2919003003: Reapply "Use backend targets to run Kernel transformations in Fasta" (Closed)
Patch Set: Follow dartanalyzer suggestions Created 3 years, 6 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 kernel.transformations.erasure; 4 library kernel.transformations.erasure;
5 5
6 import '../ast.dart'; 6 import '../ast.dart';
7 import '../type_algebra.dart'; 7 import '../type_algebra.dart';
8 import '../core_types.dart';
9
10 Program transformProgram(CoreTypes coreTypes, Program program) {
11 program.accept(new Erasure());
12 }
13
14 void transformLibraries(CoreTypes coreTypes, List<Library> libraries) {
15 Erasure erasure = new Erasure();
16 for (Library library in libraries) {
17 library.accept(erasure);
18 }
19 }
8 20
9 /// This pass is a temporary measure to run strong mode code in the VM, which 21 /// This pass is a temporary measure to run strong mode code in the VM, which
10 /// does not yet have the necessary runtime support. 22 /// does not yet have the necessary runtime support.
11 /// 23 ///
12 /// Function type parameter lists are cleared and all uses of a function type 24 /// Function type parameter lists are cleared and all uses of a function type
13 /// parameter are replaced by its upper bound. 25 /// parameter are replaced by its upper bound.
14 /// 26 ///
15 /// All uses of type parameters in constants are replaced by 'dynamic'. 27 /// All uses of type parameters in constants are replaced by 'dynamic'.
16 /// 28 ///
17 /// This does not preserve dynamic type safety. 29 /// This does not preserve dynamic type safety.
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 } 150 }
139 151
140 @override 152 @override
141 visitMapLiteral(MapLiteral node) { 153 visitMapLiteral(MapLiteral node) {
142 if (node.isConst) pushConstantContext(); 154 if (node.isConst) pushConstantContext();
143 node.transformChildren(this); 155 node.transformChildren(this);
144 if (node.isConst) popConstantContext(); 156 if (node.isConst) popConstantContext();
145 return node; 157 return node;
146 } 158 }
147 } 159 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698