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

Side by Side Diff: pkg/kernel/lib/target/targets.dart

Issue 2927613002: Improve NSM handling. (Closed)
Patch Set: Address review comments. 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
« no previous file with comments | « pkg/kernel/lib/target/flutter.dart ('k') | pkg/kernel/lib/target/vm.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.target.targets; 4 library kernel.target.targets;
5 5
6 import '../ast.dart'; 6 import '../ast.dart';
7 import '../class_hierarchy.dart'; 7 import '../class_hierarchy.dart';
8 import '../core_types.dart'; 8 import '../core_types.dart';
9 import '../transformations/treeshaker.dart' show ProgramRoot; 9 import '../transformations/treeshaker.dart' show ProgramRoot;
10 import 'flutter.dart' show FlutterTarget; 10 import 'flutter.dart' show FlutterTarget;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 /// not to apply these transformations. 107 /// not to apply these transformations.
108 /// 108 ///
109 /// Note that [performGlobalTransformations] doesn't have -OnProgram and 109 /// Note that [performGlobalTransformations] doesn't have -OnProgram and
110 /// -OnLibraries alternatives, because the global knowledge required by the 110 /// -OnLibraries alternatives, because the global knowledge required by the
111 /// transformations is assumed to be retrieved from a [Program] instance. 111 /// transformations is assumed to be retrieved from a [Program] instance.
112 void performGlobalTransformations(CoreTypes coreTypes, Program program, 112 void performGlobalTransformations(CoreTypes coreTypes, Program program,
113 {void logger(String msg)}); 113 {void logger(String msg)});
114 114
115 /// Builds an expression that instantiates an [Invocation] that can be passed 115 /// Builds an expression that instantiates an [Invocation] that can be passed
116 /// to [noSuchMethod]. 116 /// to [noSuchMethod].
117 Expression instantiateInvocation(Member target, Expression receiver, 117 Expression instantiateInvocation(CoreTypes coreTypes, Expression receiver,
118 String name, Arguments arguments, int offset, bool isSuper); 118 String name, Arguments arguments, int offset, bool isSuper);
119 119
120 Expression instantiateNoSuchMethodError(CoreTypes coreTypes,
121 Expression receiver, String name, Arguments arguments, int offset,
122 {bool isMethod: false,
123 bool isGetter: false,
124 bool isSetter: false,
125 bool isField: false,
126 bool isLocalVariable: false,
127 bool isDynamic: false,
128 bool isSuper: false,
129 bool isStatic: false,
130 bool isConstructor: false,
131 bool isTopLevel: false});
132
120 String toString() => 'Target($name)'; 133 String toString() => 'Target($name)';
121 } 134 }
122 135
123 class NoneTarget extends Target { 136 class NoneTarget extends Target {
124 final TargetFlags flags; 137 final TargetFlags flags;
125 138
126 NoneTarget(this.flags); 139 NoneTarget(this.flags);
127 140
128 bool get strongMode => flags.strongMode; 141 bool get strongMode => flags.strongMode;
129 String get name => 'none'; 142 String get name => 'none';
130 List<String> get extraRequiredLibraries => <String>[]; 143 List<String> get extraRequiredLibraries => <String>[];
131 void performModularTransformationsOnLibraries( 144 void performModularTransformationsOnLibraries(
132 CoreTypes coreTypes, ClassHierarchy hierarchy, List<Library> libraries, 145 CoreTypes coreTypes, ClassHierarchy hierarchy, List<Library> libraries,
133 {void logger(String msg)}) {} 146 {void logger(String msg)}) {}
134 void performGlobalTransformations(CoreTypes coreTypes, Program program, 147 void performGlobalTransformations(CoreTypes coreTypes, Program program,
135 {void logger(String msg)}) {} 148 {void logger(String msg)}) {}
136 149
137 @override 150 @override
138 Expression instantiateInvocation(Member target, Expression receiver, 151 Expression instantiateInvocation(CoreTypes coreTypes, Expression receiver,
139 String name, Arguments arguments, int offset, bool isSuper) { 152 String name, Arguments arguments, int offset, bool isSuper) {
140 return new InvalidExpression(); 153 return new InvalidExpression();
141 } 154 }
155
156 @override
157 Expression instantiateNoSuchMethodError(CoreTypes coreTypes,
158 Expression receiver, String name, Arguments arguments, int offset,
159 {bool isMethod: false,
160 bool isGetter: false,
161 bool isSetter: false,
162 bool isField: false,
163 bool isLocalVariable: false,
164 bool isDynamic: false,
165 bool isSuper: false,
166 bool isStatic: false,
167 bool isConstructor: false,
168 bool isTopLevel: false}) {
169 return new InvalidExpression();
170 }
142 } 171 }
OLDNEW
« no previous file with comments | « pkg/kernel/lib/target/flutter.dart ('k') | pkg/kernel/lib/target/vm.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698