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

Unified Diff: pkg/compiler/lib/src/enqueue.dart

Issue 2506393002: Enhance precision of recorded instantiation info in ResolutionWorldBuilder (Closed)
Patch Set: Updated cf. comments. Created 4 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 | « no previous file | pkg/compiler/lib/src/js_backend/enqueuer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/enqueue.dart
diff --git a/pkg/compiler/lib/src/enqueue.dart b/pkg/compiler/lib/src/enqueue.dart
index bb50941b88f2e5dff2830001d328084df58a9090..6c7de3fbbe2961ada4e97ad40f7847b95f20f24e 100644
--- a/pkg/compiler/lib/src/enqueue.dart
+++ b/pkg/compiler/lib/src/enqueue.dart
@@ -22,6 +22,7 @@ import 'elements/elements.dart'
AnalyzableElement,
AstElement,
ClassElement,
+ ConstructorElement,
Element,
Entity,
FunctionElement,
@@ -158,9 +159,9 @@ class ResolutionEnqueuer extends Enqueuer {
this.globalDependencies,
Backend backend,
CommonElements commonElements,
- CacheStrategy cacheStrategy)
- : this.name = 'resolution enqueuer',
- this.backend = backend,
+ CacheStrategy cacheStrategy,
+ [this.name = 'resolution enqueuer'])
+ : this.backend = backend,
this.commonElements = commonElements,
this.nativeEnqueuer = backend.nativeResolutionEnqueuer(),
processedElements = new Set<AstElement>(),
@@ -204,16 +205,20 @@ class ResolutionEnqueuer extends Enqueuer {
}
void _registerInstantiatedType(InterfaceType type,
- {bool mirrorUsage: false,
+ {ConstructorElement constructor,
+ bool mirrorUsage: false,
bool nativeUsage: false,
- bool globalDependency: false}) {
+ bool globalDependency: false,
+ bool isRedirection: false}) {
task.measure(() {
ClassElement cls = type.element;
cls.ensureResolved(resolution);
bool isNative = backend.isNative(cls);
_universe.registerTypeInstantiation(type,
+ constructor: constructor,
isNative: isNative,
- byMirrors: mirrorUsage, onImplemented: (ClassElement cls) {
+ byMirrors: mirrorUsage,
+ isRedirection: isRedirection, onImplemented: (ClassElement cls) {
backend.registerImplementedClass(cls, this);
});
if (globalDependency && !mirrorUsage) {
@@ -453,7 +458,14 @@ class ResolutionEnqueuer extends Enqueuer {
break;
case StaticUseKind.CONSTRUCTOR_INVOKE:
case StaticUseKind.CONST_CONSTRUCTOR_INVOKE:
- _registerTypeUse(new TypeUse.instantiation(staticUse.type));
+ _registerInstantiatedType(staticUse.type,
+ constructor: staticUse.element, globalDependency: false);
+ break;
+ case StaticUseKind.REDIRECTION:
+ _registerInstantiatedType(staticUse.type,
+ constructor: staticUse.element,
+ globalDependency: false,
+ isRedirection: true);
break;
case StaticUseKind.DIRECT_INVOKE:
invariant(
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/enqueuer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698