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

Side by Side Diff: pkg/compiler/lib/src/resolution/constructors.dart

Issue 2392943003: Handle const constructor invocation in kernel_impact. (Closed)
Patch Set: Updated cf. comments. Created 4 years, 2 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 4
5 library dart2js.resolution.constructors; 5 library dart2js.resolution.constructors;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/resolution.dart' show Resolution; 8 import '../common/resolution.dart' show Resolution;
9 import '../constants/constructors.dart' 9 import '../constants/constructors.dart'
10 show 10 show
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 ClassElement lookupTarget = targetType.element; 215 ClassElement lookupTarget = targetType.element;
216 ConstructorElement calledConstructor = 216 ConstructorElement calledConstructor =
217 findConstructor(constructor.library, lookupTarget, ''); 217 findConstructor(constructor.library, lookupTarget, '');
218 218
219 final String className = lookupTarget.name; 219 final String className = lookupTarget.name;
220 CallStructure callStructure = CallStructure.NO_ARGS; 220 CallStructure callStructure = CallStructure.NO_ARGS;
221 ConstructorElement result = verifyThatConstructorMatchesCall( 221 ConstructorElement result = verifyThatConstructorMatchesCall(
222 functionNode, calledConstructor, callStructure, className, 222 functionNode, calledConstructor, callStructure, className,
223 isImplicitSuperCall: true); 223 isImplicitSuperCall: true);
224 if (!result.isError) { 224 if (!result.isError) {
225 registry.registerStaticUse( 225 registry.registerStaticUse(new StaticUse.superConstructorInvoke(
226 new StaticUse.constructorInvoke(calledConstructor, callStructure)); 226 calledConstructor, callStructure));
227 } 227 }
228 228
229 if (isConst && isValidAsConstant) { 229 if (isConst && isValidAsConstant) {
230 return new ConstructedConstantExpression(targetType, result, 230 return new ConstructedConstantExpression(targetType, result,
231 CallStructure.NO_ARGS, const <ConstantExpression>[]); 231 CallStructure.NO_ARGS, const <ConstantExpression>[]);
232 } 232 }
233 } 233 }
234 return null; 234 return null;
235 } 235 }
236 236
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 // constructors. 881 // constructors.
882 return null; 882 return null;
883 } 883 }
884 // TODO(johnniwinther): Use [Name] for lookup. 884 // TODO(johnniwinther): Use [Name] for lookup.
885 ConstructorElement constructor = cls.lookupConstructor(constructorName); 885 ConstructorElement constructor = cls.lookupConstructor(constructorName);
886 if (constructor != null) { 886 if (constructor != null) {
887 constructor = constructor.declaration; 887 constructor = constructor.declaration;
888 } 888 }
889 return constructor; 889 return constructor;
890 } 890 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/kernel_task.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698