| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 /** | 7 /** |
| 8 * [InvokeDynamicSpecializer] and its subclasses are helpers to | 8 * [InvokeDynamicSpecializer] and its subclasses are helpers to |
| 9 * optimize intercepted dynamic calls. It knows what input types | 9 * optimize intercepted dynamic calls. It knows what input types |
| 10 * would be beneficial for performance, and how to change a invoke | 10 * would be beneficial for performance, and how to change a invoke |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 } | 229 } |
| 230 | 230 |
| 231 HInstruction newBuiltinVariant(HInvokeDynamic instruction, Compiler compiler); | 231 HInstruction newBuiltinVariant(HInvokeDynamic instruction, Compiler compiler); |
| 232 | 232 |
| 233 Selector renameToOptimizedSelector(String name, | 233 Selector renameToOptimizedSelector(String name, |
| 234 Selector selector, | 234 Selector selector, |
| 235 Compiler compiler) { | 235 Compiler compiler) { |
| 236 if (selector.name == name) return selector; | 236 if (selector.name == name) return selector; |
| 237 JavaScriptBackend backend = compiler.backend; | 237 JavaScriptBackend backend = compiler.backend; |
| 238 Selector newSelector = new Selector( | 238 Selector newSelector = new Selector( |
| 239 SelectorKind.CALL, name, backend.interceptorsLibrary, | 239 SelectorKind.CALL, new Name(name, backend.interceptorsLibrary), |
| 240 selector.argumentCount); | 240 new CallStructure(selector.argumentCount)); |
| 241 return selector.mask == null | 241 return selector.mask == null |
| 242 ? newSelector | 242 ? newSelector |
| 243 : new TypedSelector(selector.mask, newSelector, compiler.world); | 243 : new TypedSelector(selector.mask, newSelector, compiler.world); |
| 244 } | 244 } |
| 245 } | 245 } |
| 246 | 246 |
| 247 class AddSpecializer extends BinaryArithmeticSpecializer { | 247 class AddSpecializer extends BinaryArithmeticSpecializer { |
| 248 const AddSpecializer(); | 248 const AddSpecializer(); |
| 249 | 249 |
| 250 TypeMask computeTypeFromInputTypes(HInvokeDynamic instruction, | 250 TypeMask computeTypeFromInputTypes(HInvokeDynamic instruction, |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 return constantSystem.codeUnitAt; | 741 return constantSystem.codeUnitAt; |
| 742 } | 742 } |
| 743 | 743 |
| 744 HInstruction tryConvertToBuiltin(HInvokeDynamic instruction, | 744 HInstruction tryConvertToBuiltin(HInvokeDynamic instruction, |
| 745 Compiler compiler) { | 745 Compiler compiler) { |
| 746 // TODO(sra): Implement a builtin HCodeUnitAt instruction and the same index | 746 // TODO(sra): Implement a builtin HCodeUnitAt instruction and the same index |
| 747 // bounds checking optimizations as for HIndex. | 747 // bounds checking optimizations as for HIndex. |
| 748 return null; | 748 return null; |
| 749 } | 749 } |
| 750 } | 750 } |
| OLD | NEW |