Chromium Code Reviews| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 120 TypeMask argSuccessType = argumentSuccessTypes[i]; | 120 TypeMask argSuccessType = argumentSuccessTypes[i]; |
| 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 processInvokeStatic(InvokeStatic node) { |
|
asgerf
2016/01/11 21:35:06
Please do like in visitInvokeMethod and visitTypeT
Siggi Cherem (dart-lang)
2016/01/11 21:51:09
good catch! Done.
Before I sent this I haven't ye
| |
| 131 _refineArguments(node, | 131 _refineArguments(node, |
| 132 _getSuccessTypesForStaticMethod(types, node.target)); | 132 _getSuccessTypesForStaticMethod(types, node.target)); |
| 133 } | 133 } |
| 134 | 134 |
| 135 void visitInvokeMethod(InvokeMethod node) { | 135 void visitInvokeMethod(InvokeMethod node) { |
| 136 // Update references to their current refined values. | 136 // Update references to their current refined values. |
| 137 processReference(node.receiver); | 137 processReference(node.receiver); |
| 138 node.arguments.forEach(processReference); | 138 node.arguments.forEach(processReference); |
| 139 | 139 |
| 140 // If the call is intercepted, we want to refine the actual receiver, | 140 // 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': | 425 case 'exp': |
| 426 case 'log': | 426 case 'log': |
| 427 return [types.numType]; | 427 return [types.numType]; |
| 428 case 'pow': | 428 case 'pow': |
| 429 return [types.numType, types.numType]; | 429 return [types.numType, types.numType]; |
| 430 } | 430 } |
| 431 } | 431 } |
| 432 | 432 |
| 433 return null; | 433 return null; |
| 434 } | 434 } |
| OLD | NEW |