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

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

Issue 10383065: Start creating a MemberSet abstraction, and use it to fold getters/setters into field accesses. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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 | « lib/compiler/implementation/ssa/nodes.dart ('k') | lib/compiler/implementation/ssa/tracer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/optimize.dart
===================================================================
--- lib/compiler/implementation/ssa/optimize.dart (revision 7442)
+++ lib/compiler/implementation/ssa/optimize.dart (working copy)
@@ -553,6 +553,24 @@
HType combinedType = value.propagatedType.union(node.propagatedType);
return (combinedType == value.propagatedType) ? value : node;
}
+
+ HInstruction visitInvokeDynamicGetter(HInvokeDynamicGetter node) {
+ HInstruction receiver = node.inputs[0];
+ if (!receiver.propagatedType.isUseful()) return node;
+ Type type = receiver.propagatedType.computeType(compiler);
+ if (type === null) return node;
+ if (!compiler.world.isOnlyFields(type, node.name)) return node;
+ return new HFieldGet(node.name, node.inputs[0]);
+ }
+
+ HInstruction visitInvokeDynamicSetter(HInvokeDynamicSetter node) {
+ HInstruction receiver = node.inputs[0];
+ if (!receiver.propagatedType.isUseful()) return node;
+ Type type = receiver.propagatedType.computeType(compiler);
+ if (type === null) return node;
+ if (!compiler.world.isOnlyFields(type, node.name)) return node;
+ return new HFieldSet(node.name, node.inputs[0], node.inputs[1]);
+ }
}
class SsaCheckInserter extends HBaseVisitor implements OptimizationPhase {
« no previous file with comments | « lib/compiler/implementation/ssa/nodes.dart ('k') | lib/compiler/implementation/ssa/tracer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698