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

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

Issue 2554323002: Remove ResolutionEnqueuer._applyFirstMemberUse (Closed)
Patch Set: dartfmt Created 4 years 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/enqueue.dart ('k') | pkg/compiler/lib/src/universe/world_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/backend.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index ed987ae132c4938a8d9095ffbff52926ac39fdb2..03bf07d95c128e6b51cbcc08996b06778f8c1c06 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -1391,6 +1391,8 @@ class JavaScriptBackend extends Backend {
return impactTransformer.createImpactFor(impacts.computeSignature);
}
+ /// Called to register that the `runtimeType` property has been accessed. Any
+ /// backend specific [WorldImpact] of this is returned.
WorldImpact registerRuntimeType() {
return impactTransformer.createImpactFor(impacts.runtimeTypeSupport);
}
@@ -1404,7 +1406,8 @@ class JavaScriptBackend extends Backend {
return impactTransformer.createImpactFor(impacts.deferredLoading);
}
- void registerNoSuchMethod(FunctionElement noSuchMethod) {
+ /// Called to register a `noSuchMethod` implementation.
+ void registerNoSuchMethod(MethodElement noSuchMethod) {
noSuchMethodRegistry.registerNoSuchMethod(noSuchMethod);
}
@@ -1850,6 +1853,15 @@ class JavaScriptBackend extends Backend {
forResolution: forResolution);
if (forResolution) {
+ if (element.isFunction && element.isInstanceMember) {
+ MemberElement function = element;
+ ClassElement cls = function.enclosingClass;
+ if (function.name == Identifiers.call && !cls.typeVariables.isEmpty) {
+ worldImpact.addImpact(registerCallMethodWithFreeTypeVariables(
+ function,
+ forResolution: true));
+ }
+ }
// Enable isolate support if we start using something from the isolate
// library, or timers for the async library. We exclude constant fields,
// which are ending here because their initializing expression is
@@ -2321,6 +2333,12 @@ class JavaScriptBackend extends Backend {
if (!enqueuer.queueIsEmpty) return false;
+ for (ClassElement cls in recentClasses) {
+ Element element = cls.lookupLocalMember(Identifiers.noSuchMethod_);
+ if (element != null && element.isInstanceMember && element.isFunction) {
+ registerNoSuchMethod(element);
+ }
+ }
noSuchMethodRegistry.onQueueEmpty();
if (!enabledNoSuchMethod &&
(noSuchMethodRegistry.hasThrowingNoSuchMethod ||
« no previous file with comments | « pkg/compiler/lib/src/enqueue.dart ('k') | pkg/compiler/lib/src/universe/world_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698