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 import '../compiler.dart' show Compiler; | 5 import '../compiler.dart' show Compiler; |
6 import '../elements/elements.dart'; | 6 import '../elements/elements.dart'; |
7 import '../js_backend/js_backend.dart'; | 7 import '../js_backend/js_backend.dart'; |
8 import '../types/types.dart'; | 8 import '../types/types.dart'; |
9 import '../universe/selector.dart' show Selector; | 9 import '../universe/selector.dart' show Selector; |
10 import '../world.dart' show ClosedWorld; | 10 import '../world.dart' show ClosedWorld; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 input.replaceAllUsersDominatedBy(instruction.next, instruction); | 226 input.replaceAllUsersDominatedBy(instruction.next, instruction); |
227 } | 227 } |
228 return outputType; | 228 return outputType; |
229 } | 229 } |
230 | 230 |
231 void convertInput( | 231 void convertInput( |
232 HInvokeDynamic instruction, HInstruction input, TypeMask type, int kind) { | 232 HInvokeDynamic instruction, HInstruction input, TypeMask type, int kind) { |
233 Selector selector = (kind == HTypeConversion.RECEIVER_TYPE_CHECK) | 233 Selector selector = (kind == HTypeConversion.RECEIVER_TYPE_CHECK) |
234 ? instruction.selector | 234 ? instruction.selector |
235 : null; | 235 : null; |
236 HTypeConversion converted = | 236 HTypeConversion converted = new HTypeConversion(null, kind, type, input, |
237 new HTypeConversion(null, kind, type, input, selector) | 237 receiverTypeCheckSelector: selector) |
238 ..sourceInformation = instruction.sourceInformation; | 238 ..sourceInformation = instruction.sourceInformation; |
239 instruction.block.addBefore(instruction, converted); | 239 instruction.block.addBefore(instruction, converted); |
240 input.replaceAllUsersDominatedBy(instruction, converted); | 240 input.replaceAllUsersDominatedBy(instruction, converted); |
241 } | 241 } |
242 | 242 |
243 bool isCheckEnoughForNsmOrAe(HInstruction instruction, TypeMask type) { | 243 bool isCheckEnoughForNsmOrAe(HInstruction instruction, TypeMask type) { |
244 // In some cases, we want the receiver to be an integer, | 244 // In some cases, we want the receiver to be an integer, |
245 // but that does not mean we will get a NoSuchMethodError | 245 // but that does not mean we will get a NoSuchMethodError |
246 // if it's not: the receiver could be a double. | 246 // if it's not: the receiver could be a double. |
247 if (type.containsOnlyInt(closedWorld)) { | 247 if (type.containsOnlyInt(closedWorld)) { |
248 // If the instruction's type is integer or null, the codegen | 248 // If the instruction's type is integer or null, the codegen |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 receiver.replaceAllUsersDominatedBy(converted.next, converted); | 402 receiver.replaceAllUsersDominatedBy(converted.next, converted); |
403 addDependentInstructionsToWorkList(converted); | 403 addDependentInstructionsToWorkList(converted); |
404 } | 404 } |
405 } | 405 } |
406 } | 406 } |
407 | 407 |
408 return instruction.specializer | 408 return instruction.specializer |
409 .computeTypeFromInputTypes(instruction, compiler); | 409 .computeTypeFromInputTypes(instruction, compiler); |
410 } | 410 } |
411 } | 411 } |
OLD | NEW |