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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart

Issue 14416014: After a dynamic call, refine the receiver type by looking at the potential targets of that call. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (revision 22031)
+++ sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (working copy)
@@ -667,8 +667,16 @@
}
HInstruction receiver = node.getDartReceiver(compiler);
Element field = findConcreteFieldForDynamicAccess(receiver, node.selector);
- if (field == null) return node;
- return directFieldGet(receiver, field);
+ if (field != null) return directFieldGet(receiver, field);
+ Selector selector = node.selector;
+ if (node.dependsOnSomething()
+ && compiler.resolverWorld.onlyReachesFinalFields(selector, compiler)) {
+ // If we know all potential targets are final fields, or fields
+ // that are never assigned twice, we know this getter does not
+ // depend on anything.
+ node.clearAllDependencies();
+ }
+ return node;
}
HInstruction directFieldGet(HInstruction receiver, Element field) {
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/nodes.dart ('k') | sdk/lib/_internal/compiler/implementation/ssa/tracer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698