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

Side by Side Diff: lib/compiler/implementation/ssa/optimize.dart

Issue 10180001: Introduce typed selectors to do better tree shaking based on calls on 'this'. Getters and setters w… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/compiler/implementation/ssa/codegen.dart ('k') | lib/compiler/implementation/universe.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 interface OptimizationPhase { 5 interface OptimizationPhase {
6 String get name(); 6 String get name();
7 void visitGraph(HGraph graph); 7 void visitGraph(HGraph graph);
8 } 8 }
9 9
10 class SsaOptimizerTask extends CompilerTask { 10 class SsaOptimizerTask extends CompilerTask {
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 return node; 171 return node;
172 } 172 }
173 173
174 HInstruction visitInvokeDynamic(HInvokeDynamic node) { 174 HInstruction visitInvokeDynamic(HInvokeDynamic node) {
175 HType receiverType = node.receiver.propagatedType; 175 HType receiverType = node.receiver.propagatedType;
176 if (receiverType.isNonPrimitive()) { 176 if (receiverType.isNonPrimitive()) {
177 HNonPrimitiveType type = receiverType; 177 HNonPrimitiveType type = receiverType;
178 Element element = type.lookupMember(node.name); 178 Element element = type.lookupMember(node.name);
179 // TODO(ngeoffray): Also fold if it's a getter or variable. 179 // TODO(ngeoffray): Also fold if it's a getter or variable.
180 if (element != null && element.isFunction()) { 180 if (element != null && element.isFunction()) {
181 FunctionElement method = element; 181 if (node.selector.applies(element, compiler)) {
182 FunctionParameters parameters = method.computeParameters(compiler); 182 FunctionElement method = element;
183 if (node.selector.applies(parameters)) { 183 FunctionParameters parameters = method.computeParameters(compiler);
184 if (parameters.optionalParameterCount == 0) { 184 if (parameters.optionalParameterCount == 0) {
185 node.element = element; 185 node.element = element;
186 } 186 }
187 // TODO(ngeoffray): If the method has optional parameters, 187 // TODO(ngeoffray): If the method has optional parameters,
188 // we should pass the default values here. 188 // we should pass the default values here.
189 } 189 }
190 } 190 }
191 } 191 }
192 return node; 192 return node;
193 } 193 }
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 } 816 }
817 } 817 }
818 if (!canBeMoved) continue; 818 if (!canBeMoved) continue;
819 819
820 // This is safe because we are running after GVN. 820 // This is safe because we are running after GVN.
821 // TODO(ngeoffray): ensure GVN has been run. 821 // TODO(ngeoffray): ensure GVN has been run.
822 set_.add(current); 822 set_.add(current);
823 } 823 }
824 } 824 }
825 } 825 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/codegen.dart ('k') | lib/compiler/implementation/universe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698