| 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 class BailoutInfo { | 7 class BailoutInfo { |
| 8 int instructionId; | 8 int instructionId; |
| 9 int bailoutId; | 9 int bailoutId; |
| 10 BailoutInfo(this.instructionId, this.bailoutId); | 10 BailoutInfo(this.instructionId, this.bailoutId); |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 // will throw [NoSuchMethodError] or [ArgumentError]. | 288 // will throw [NoSuchMethodError] or [ArgumentError]. |
| 289 Selector selector = firstUser.selector; | 289 Selector selector = firstUser.selector; |
| 290 Selector receiverSelectorOnThrow = null; | 290 Selector receiverSelectorOnThrow = null; |
| 291 HInstruction receiver = firstUser.getDartReceiver(compiler); | 291 HInstruction receiver = firstUser.getDartReceiver(compiler); |
| 292 bool willThrow = false; | 292 bool willThrow = false; |
| 293 if (receiver == instruction) { | 293 if (receiver == instruction) { |
| 294 if (willThrowNoSuchMethodErrorIfNot(selector, speculativeType)) { | 294 if (willThrowNoSuchMethodErrorIfNot(selector, speculativeType)) { |
| 295 receiverSelectorOnThrow = selector; | 295 receiverSelectorOnThrow = selector; |
| 296 willThrow = true; | 296 willThrow = true; |
| 297 } | 297 } |
| 298 } else if (willThrowArgumentError(selector, receiver, speculativeType)) { | 298 // We need to call the actual method in checked mode to get |
| 299 // the right type error. |
| 300 } else if (!compiler.enableTypeAssertions |
| 301 && willThrowArgumentError(selector, receiver, speculativeType)) { |
| 299 willThrow = true; | 302 willThrow = true; |
| 300 } | 303 } |
| 301 | 304 |
| 302 if (!willThrow) return false; | 305 if (!willThrow) return false; |
| 303 | 306 |
| 304 HTypeConversion check = new HTypeConversion( | 307 HTypeConversion check = new HTypeConversion( |
| 305 null, | 308 null, |
| 306 receiverSelectorOnThrow == null | 309 receiverSelectorOnThrow == null |
| 307 ? HTypeConversion.ARGUMENT_TYPE_CHECK | 310 ? HTypeConversion.ARGUMENT_TYPE_CHECK |
| 308 : HTypeConversion.RECEIVER_TYPE_CHECK, | 311 : HTypeConversion.RECEIVER_TYPE_CHECK, |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 hasComplexBailoutTargets = true; | 740 hasComplexBailoutTargets = true; |
| 738 } | 741 } |
| 739 } else { | 742 } else { |
| 740 hasComplexBailoutTargets = true; | 743 hasComplexBailoutTargets = true; |
| 741 blocks.forEach((HBasicBlock block) { | 744 blocks.forEach((HBasicBlock block) { |
| 742 block.bailoutTargets.add(target); | 745 block.bailoutTargets.add(target); |
| 743 }); | 746 }); |
| 744 } | 747 } |
| 745 } | 748 } |
| 746 } | 749 } |
| OLD | NEW |