| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library cps_ir.optimization.insert_refinements; | 5 library cps_ir.optimization.insert_refinements; |
| 6 | 6 |
| 7 import 'dart:math' show min; | 7 import 'dart:math' show min; |
| 8 import 'optimizers.dart' show Pass; | 8 import 'optimizers.dart' show Pass; |
| 9 import 'cps_ir_nodes.dart'; | 9 import 'cps_ir_nodes.dart'; |
| 10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 121 |
| 122 // Skip arguments that provide no refinement. | 122 // Skip arguments that provide no refinement. |
| 123 if (argSuccessType == types.dynamicType) continue; | 123 if (argSuccessType == types.dynamicType) continue; |
| 124 | 124 |
| 125 applyRefinement(node.parent, | 125 applyRefinement(node.parent, |
| 126 new Refinement(node.dartArgument(i), argSuccessType)); | 126 new Refinement(node.dartArgument(i), argSuccessType)); |
| 127 } | 127 } |
| 128 } | 128 } |
| 129 | 129 |
| 130 void visitInvokeStatic(InvokeStatic node) { | 130 void visitInvokeStatic(InvokeStatic node) { |
| 131 node.arguments.forEach(processReference); |
| 131 _refineArguments(node, | 132 _refineArguments(node, |
| 132 _getSuccessTypesForStaticMethod(types, node.target)); | 133 _getSuccessTypesForStaticMethod(types, node.target)); |
| 133 } | 134 } |
| 134 | 135 |
| 135 void visitInvokeMethod(InvokeMethod node) { | 136 void visitInvokeMethod(InvokeMethod node) { |
| 136 // Update references to their current refined values. | 137 // Update references to their current refined values. |
| 137 processReference(node.receiver); | 138 processReference(node.receiver); |
| 138 node.arguments.forEach(processReference); | 139 node.arguments.forEach(processReference); |
| 139 | 140 |
| 140 // If the call is intercepted, we want to refine the actual receiver, | 141 // If the call is intercepted, we want to refine the actual receiver, |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 case 'exp': | 426 case 'exp': |
| 426 case 'log': | 427 case 'log': |
| 427 return [types.numType]; | 428 return [types.numType]; |
| 428 case 'pow': | 429 case 'pow': |
| 429 return [types.numType, types.numType]; | 430 return [types.numType, types.numType]; |
| 430 } | 431 } |
| 431 } | 432 } |
| 432 | 433 |
| 433 return null; | 434 return null; |
| 434 } | 435 } |
| OLD | NEW |