| OLD | NEW |
| 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 part of ssa; | 5 part of ssa; |
| 6 | 6 |
| 7 abstract class OptimizationPhase { | 7 abstract class OptimizationPhase { |
| 8 String get name; | 8 String get name; |
| 9 void visitGraph(HGraph graph); | 9 void visitGraph(HGraph graph); |
| 10 } | 10 } |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 // TODO(ngeoffray): Move this logic into a separate class. | 233 // TODO(ngeoffray): Move this logic into a separate class. |
| 234 if (selector.kind == SelectorKind.INDEX | 234 if (selector.kind == SelectorKind.INDEX |
| 235 && input.isIndexablePrimitive(types)) { | 235 && input.isIndexablePrimitive(types)) { |
| 236 if (selector.name == const SourceString('[]')) { | 236 if (selector.name == const SourceString('[]')) { |
| 237 return new HIndex(node.inputs[1], node.inputs[2]); | 237 return new HIndex(node.inputs[1], node.inputs[2]); |
| 238 } else if (input.isMutableArray(types)) { | 238 } else if (input.isMutableArray(types)) { |
| 239 assert(selector.name == const SourceString('[]=')); | 239 assert(selector.name == const SourceString('[]=')); |
| 240 return new HIndexAssign(node.inputs[1], node.inputs[2], node.inputs[3]); | 240 return new HIndexAssign(node.inputs[1], node.inputs[2], node.inputs[3]); |
| 241 } | 241 } |
| 242 } else if (selector.kind == SelectorKind.OPERATOR) { | 242 } else if (selector.kind == SelectorKind.OPERATOR) { |
| 243 if (selector.name == const SourceString('-')) { | 243 if (selector.name == const SourceString('unary-')) { |
| 244 if (input.isNumber(types)) { | 244 if (input.isNumber(types)) { |
| 245 return new HNegate(input); | 245 return new HNegate(input); |
| 246 } | 246 } |
| 247 } else if (selector.name == const SourceString('~')) { | 247 } else if (selector.name == const SourceString('~')) { |
| 248 if (input.isNumber(types)) { | 248 if (input.isNumber(types)) { |
| 249 return new HBitNot(input); | 249 return new HBitNot(input); |
| 250 } | 250 } |
| 251 } | 251 } |
| 252 } | 252 } |
| 253 | 253 |
| (...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1494 HInstruction receiver = interceptor.receiver; | 1494 HInstruction receiver = interceptor.receiver; |
| 1495 for (var user in receiver.usedBy) { | 1495 for (var user in receiver.usedBy) { |
| 1496 if (user is HInterceptor && interceptor.dominates(user)) { | 1496 if (user is HInterceptor && interceptor.dominates(user)) { |
| 1497 user.interceptedClasses = interceptor.interceptedClasses; | 1497 user.interceptedClasses = interceptor.interceptedClasses; |
| 1498 } | 1498 } |
| 1499 } | 1499 } |
| 1500 } | 1500 } |
| 1501 | 1501 |
| 1502 // TODO(ngeoffray): Also implement it for non-intercepted calls. | 1502 // TODO(ngeoffray): Also implement it for non-intercepted calls. |
| 1503 } | 1503 } |
| OLD | NEW |