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

Unified Diff: pkg/compiler/lib/src/resolution/constructors.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/resolution/access_semantics.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/constructors.dart
diff --git a/pkg/compiler/lib/src/resolution/constructors.dart b/pkg/compiler/lib/src/resolution/constructors.dart
index 16c2e27fdd51c5c3b91e6abce7bbfea52db9435d..975832fb47902653cd942a897220087e03979ad1 100644
--- a/pkg/compiler/lib/src/resolution/constructors.dart
+++ b/pkg/compiler/lib/src/resolution/constructors.dart
@@ -28,6 +28,8 @@ import '../universe/call_structure.dart' show
CallStructure;
import '../universe/selector.dart' show
Selector;
+import '../universe/use.dart' show
+ StaticUse;
import 'members.dart' show
lookupInScope,
@@ -125,7 +127,9 @@ class InitializerResolver {
}
if (target != null) {
registry.useElement(init, target);
- registry.registerStaticUse(target);
+ if (!target.isMalformed) {
+ registry.registerStaticUse(new StaticUse.fieldInit(target));
+ }
checkForDuplicateInitializers(target, init);
}
// Resolve initializing value.
@@ -183,7 +187,9 @@ class InitializerResolver {
constructorSelector);
if (calledConstructor != null) {
registry.useElement(call, calledConstructor);
- registry.registerStaticUse(calledConstructor);
+ registry.registerStaticUse(
+ new StaticUse.superConstructorInvoke(
+ calledConstructor, argumentsResult.callStructure));
}
if (isConst) {
if (isValidAsConstant &&
@@ -232,7 +238,9 @@ class InitializerResolver {
className,
constructorSelector);
if (calledConstructor != null) {
- registry.registerImplicitSuperCall(calledConstructor);
+ registry.registerStaticUse(
+ new StaticUse.constructorInvoke(
+ calledConstructor, constructorSelector.callStructure));
}
if (isConst && isValidAsConstant) {
« no previous file with comments | « pkg/compiler/lib/src/resolution/access_semantics.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698