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

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

Issue 1424923004: Add StaticUse for more precise registration of statically known element use. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 1 month 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/compiler/lib/src/resolution/registry.dart ('k') | pkg/compiler/lib/src/ssa/builder.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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; 5 library dart2js.resolution;
6 6
7 import 'dart:collection' show Queue; 7 import 'dart:collection' show Queue;
8 8
9 import '../common.dart'; 9 import '../common.dart';
10 import '../common/names.dart' show 10 import '../common/names.dart' show
(...skipping 28 matching lines...) Expand all
39 ParameterMetadataAnnotation, 39 ParameterMetadataAnnotation,
40 SetterElementX, 40 SetterElementX,
41 TypedefElementX; 41 TypedefElementX;
42 import '../tokens/token.dart' show 42 import '../tokens/token.dart' show
43 isBinaryOperator, 43 isBinaryOperator,
44 isMinusOperator, 44 isMinusOperator,
45 isTernaryOperator, 45 isTernaryOperator,
46 isUnaryOperator, 46 isUnaryOperator,
47 isUserDefinableOperator; 47 isUserDefinableOperator;
48 import '../tree/tree.dart'; 48 import '../tree/tree.dart';
49 import '../universe/call_structure.dart' show
50 CallStructure;
51 import '../universe/use.dart' show
52 StaticUse;
49 import '../universe/world_impact.dart' show 53 import '../universe/world_impact.dart' show
50 WorldImpact; 54 WorldImpact;
51 import '../util/util.dart' show 55 import '../util/util.dart' show
52 Link, 56 Link,
53 LinkBuilder, 57 LinkBuilder,
54 Setlet; 58 Setlet;
55 59
56 import 'class_hierarchy.dart'; 60 import 'class_hierarchy.dart';
57 import 'class_members.dart' show MembersCreator; 61 import 'class_members.dart' show MembersCreator;
58 import 'constructors.dart'; 62 import 'constructors.dart';
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 if (element.isGenerativeConstructor) { 302 if (element.isGenerativeConstructor) {
299 ResolutionRegistry registry = 303 ResolutionRegistry registry =
300 new ResolutionRegistry(compiler, _ensureTreeElements(element)); 304 new ResolutionRegistry(compiler, _ensureTreeElements(element));
301 ConstructorElement constructor = element.asFunctionElement(); 305 ConstructorElement constructor = element.asFunctionElement();
302 ConstructorElement target = constructor.definingConstructor; 306 ConstructorElement target = constructor.definingConstructor;
303 // Ensure the signature of the synthesized element is 307 // Ensure the signature of the synthesized element is
304 // resolved. This is the only place where the resolver is 308 // resolved. This is the only place where the resolver is
305 // seeing this element. 309 // seeing this element.
306 element.computeType(resolution); 310 element.computeType(resolution);
307 if (!target.isMalformed) { 311 if (!target.isMalformed) {
308 registry.registerImplicitSuperCall(target); 312 registry.registerStaticUse(
313 new StaticUse.superConstructorInvoke(
314 target, CallStructure.NO_ARGS));
309 } 315 }
310 return registry.worldImpact; 316 return registry.worldImpact;
311 } else { 317 } else {
312 assert(element.isDeferredLoaderGetter || element.isMalformed); 318 assert(element.isDeferredLoaderGetter || element.isMalformed);
313 _ensureTreeElements(element); 319 _ensureTreeElements(element);
314 return const ResolutionImpact(); 320 return const ResolutionImpact();
315 } 321 }
316 } else { 322 } else {
317 element.parseNode(resolution.parsing); 323 element.parseNode(resolution.parsing);
318 element.computeType(resolution); 324 element.computeType(resolution);
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 TreeElements get treeElements { 1089 TreeElements get treeElements {
1084 assert(invariant(this, _treeElements !=null, 1090 assert(invariant(this, _treeElements !=null,
1085 message: "TreeElements have not been computed for $this.")); 1091 message: "TreeElements have not been computed for $this."));
1086 return _treeElements; 1092 return _treeElements;
1087 } 1093 }
1088 1094
1089 void reuseElement() { 1095 void reuseElement() {
1090 _treeElements = null; 1096 _treeElements = null;
1091 } 1097 }
1092 } 1098 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/registry.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698