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

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

Issue 10363003: Compute function types together with the parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Move computation of function type. 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 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 HInstruction visitInvokeDynamic(HInvokeDynamic node) { 194 HInstruction visitInvokeDynamic(HInvokeDynamic node) {
195 HType receiverType = node.receiver.propagatedType; 195 HType receiverType = node.receiver.propagatedType;
196 if (receiverType.isExact()) { 196 if (receiverType.isExact()) {
197 HExactType type = receiverType; 197 HExactType type = receiverType;
198 Element element = type.lookupMember(node.name); 198 Element element = type.lookupMember(node.name);
199 // TODO(ngeoffray): Also fold if it's a getter or variable. 199 // TODO(ngeoffray): Also fold if it's a getter or variable.
200 if (element != null && element.isFunction()) { 200 if (element != null && element.isFunction()) {
201 if (node.selector.applies(element, compiler)) { 201 if (node.selector.applies(element, compiler)) {
202 FunctionElement method = element; 202 FunctionElement method = element;
203 FunctionParameters parameters = method.computeParameters(compiler); 203 FunctionSignature parameters = method.computeSignature(compiler);
204 if (parameters.optionalParameterCount == 0) { 204 if (parameters.optionalParameterCount == 0) {
205 node.element = element; 205 node.element = element;
206 } 206 }
207 // TODO(ngeoffray): If the method has optional parameters, 207 // TODO(ngeoffray): If the method has optional parameters,
208 // we should pass the default values here. 208 // we should pass the default values here.
209 } 209 }
210 } 210 }
211 } 211 }
212 return node; 212 return node;
213 } 213 }
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 // the if block terminates. So any use of the instruction 1086 // the if block terminates. So any use of the instruction
1087 // after the join block should be changed to the new 1087 // after the join block should be changed to the new
1088 // instruction. 1088 // instruction.
1089 changeUsesDominatedBy(ifUser.joinBlock, input, convertedType); 1089 changeUsesDominatedBy(ifUser.joinBlock, input, convertedType);
1090 } 1090 }
1091 // TODO(ngeoffray): Also change uses for the then block on a HType 1091 // TODO(ngeoffray): Also change uses for the then block on a HType
1092 // that knows it is not of a specific Type. 1092 // that knows it is not of a specific Type.
1093 } 1093 }
1094 } 1094 }
1095 } 1095 }
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