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

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

Issue 11052011: Fix some warnings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 abstract class OptimizationPhase { 5 abstract class 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 Constant folded = operation.fold(receiver.constant); 196 Constant folded = operation.fold(receiver.constant);
197 if (folded !== null) return graph.addConstant(folded); 197 if (folded !== null) return graph.addConstant(folded);
198 } 198 }
199 return node; 199 return node;
200 } 200 }
201 201
202 HInstruction visitInvokeInterceptor(HInvokeInterceptor node) { 202 HInstruction visitInvokeInterceptor(HInvokeInterceptor node) {
203 // Try to recognize the length interceptor with input [:new List(int):]. 203 // Try to recognize the length interceptor with input [:new List(int):].
204 if (node.isLengthGetter() && node.inputs[1] is HInvokeStatic) { 204 if (node.isLengthGetter() && node.inputs[1] is HInvokeStatic) {
205 HInvokeStatic call = node.inputs[1]; 205 HInvokeStatic call = node.inputs[1];
206 Element element = call.inputs[0].element; 206 Element element = call.target.element;
207 if (element.isConstructor() && 207 if (element.isConstructor() &&
208 element.enclosingElement == compiler.listClass.defaultClass.element) { 208 element.enclosingElement == compiler.listClass.defaultClass.element) {
209 if (call.inputs.length == 2 && call.inputs[1].isInteger(types)) { 209 if (call.inputs.length == 2 && call.inputs[1].isInteger(types)) {
210 return call.inputs[1]; 210 return call.inputs[1];
211 } 211 }
212 } 212 }
213 } 213 }
214 HInstruction input = node.inputs[1]; 214 HInstruction input = node.inputs[1];
215 if (node.isLengthGetter()) { 215 if (node.isLengthGetter()) {
216 if (input.isConstantString()) { 216 if (input.isConstantString()) {
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 } 1322 }
1323 1323
1324 // For other fields having setters in the generative constructor body, set 1324 // For other fields having setters in the generative constructor body, set
1325 // the type to UNKNOWN to avoid relying on the type set in the initializer 1325 // the type to UNKNOWN to avoid relying on the type set in the initializer
1326 // list. 1326 // list.
1327 allSetters.forEach((Element element) { 1327 allSetters.forEach((Element element) {
1328 backend.registerFieldConstructor(element, HType.UNKNOWN); 1328 backend.registerFieldConstructor(element, HType.UNKNOWN);
1329 }); 1329 });
1330 } 1330 }
1331 } 1331 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698