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

Unified Diff: pkg/compiler/lib/src/js_backend/enqueuer.dart

Issue 2423953002: Change TypeInference to handle super calls as direct invocations. (Closed)
Patch Set: Register instance methods from direct invocation. 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/js_backend/enqueuer.dart
diff --git a/pkg/compiler/lib/src/js_backend/enqueuer.dart b/pkg/compiler/lib/src/js_backend/enqueuer.dart
index 12872d80622124507de99af4142a4b51700c66b0..a9736b81f1ceb5facc4a84c74f67b4725e68f36b 100644
--- a/pkg/compiler/lib/src/js_backend/enqueuer.dart
+++ b/pkg/compiler/lib/src/js_backend/enqueuer.dart
@@ -25,6 +25,7 @@ import '../elements/elements.dart'
LibraryElement,
Member,
MemberElement,
+ MethodElement,
Name,
TypedElement,
TypedefElement;
@@ -210,11 +211,7 @@ class CodegenEnqueuer implements Enqueuer {
addToWorkList(function);
return;
}
- // Store the member in [instanceFunctionsByName] to catch
- // getters on the function.
- instanceFunctionsByName
- .putIfAbsent(memberName, () => new Set<Element>())
- .add(member);
+ _registerInstanceMethod(function);
if (_universe.hasInvocation(function, _world)) {
addToWorkList(function);
return;
@@ -246,6 +243,14 @@ class CodegenEnqueuer implements Enqueuer {
.add(member);
}
+ // Store the member in [instanceFunctionsByName] to catch
+ // getters on the function.
+ void _registerInstanceMethod(MethodElement element) {
+ instanceFunctionsByName
+ .putIfAbsent(element.name, () => new Set<Element>())
+ .add(element);
+ }
+
void enableIsolateSupport() {}
void processInstantiatedClass(ClassElement cls) {
@@ -535,6 +540,9 @@ class CodegenEnqueuer implements Enqueuer {
case StaticUseKind.CONST_CONSTRUCTOR_INVOKE:
registerTypeUse(new TypeUse.instantiation(staticUse.type));
break;
+ case StaticUseKind.DIRECT_INVOKE:
+ _registerInstanceMethod(staticUse.element);
+ break;
}
if (addElement) {
addToWorkList(element);

Powered by Google App Engine
This is Rietveld 408576698