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

Unified Diff: pkg/compiler/lib/src/inferrer/type_graph_nodes.dart

Issue 1777393003: Type inference cleanup (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/types/types.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
diff --git a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
index 4e0dd845b91a1c0e02820e32b1dbdf10828a61c0..a27ceb495e2d677a98c0543916c055327e427478 100644
--- a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
+++ b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
@@ -966,28 +966,34 @@ class DynamicCallSiteTypeInformation extends CallSiteTypeInformation {
? compiler.world.allFunctions.filter(selector, typeMask)
: targets;
- // Add calls to new targets to the graph.
- targets.where((target) => !oldTargets.contains(target)).forEach((element) {
- MemberTypeInformation callee =
- inferrer.types.getInferredTypeOf(element);
- callee.addCall(caller, call);
- callee.addUser(this);
- inferrer.updateParameterAssignments(
- this, element, arguments, selector, typeMask, remove: false,
- addToQueue: true);
- });
-
- // Walk over the old targets, and remove calls that cannot happen
- // anymore.
- oldTargets.where((target) => !targets.contains(target)).forEach((element) {
- MemberTypeInformation callee =
- inferrer.types.getInferredTypeOf(element);
- callee.removeCall(caller, call);
- callee.removeUser(this);
- inferrer.updateParameterAssignments(
- this, element, arguments, selector, typeMask, remove: true,
- addToQueue: true);
- });
+ // Update the call graph if the targets could have changed.
+ if (!identical(targets, oldTargets)) {
+ // Add calls to new targets to the graph.
+ targets
+ .where((target) => !oldTargets.contains(target))
+ .forEach((element) {
+ MemberTypeInformation callee =
+ inferrer.types.getInferredTypeOf(element);
+ callee.addCall(caller, call);
+ callee.addUser(this);
+ inferrer.updateParameterAssignments(
+ this, element, arguments, selector, typeMask, remove: false,
+ addToQueue: true);
+ });
+
+ // Walk over the old targets, and remove calls that cannot happen anymore.
+ oldTargets
+ .where((target) => !targets.contains(target))
+ .forEach((element) {
+ MemberTypeInformation callee =
+ inferrer.types.getInferredTypeOf(element);
+ callee.removeCall(caller, call);
+ callee.removeUser(this);
+ inferrer.updateParameterAssignments(
+ this, element, arguments, selector, typeMask, remove: true,
+ addToQueue: true);
+ });
+ }
// Walk over the found targets, and compute the joined union type mask
// for all these targets.
« no previous file with comments | « no previous file | pkg/compiler/lib/src/types/types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698