| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 bool get hasTypeGuards => work.guards.length != 0; | 116 bool get hasTypeGuards => work.guards.length != 0; |
| 117 | 117 |
| 118 bool isUsedWithIncompatibleSelector(HInstruction instruction, | 118 bool isUsedWithIncompatibleSelector(HInstruction instruction, |
| 119 HType speculativeType) { | 119 HType speculativeType) { |
| 120 for (HInstruction user in instruction.usedBy) { | 120 for (HInstruction user in instruction.usedBy) { |
| 121 if (user is HCheck | 121 if (user is HCheck |
| 122 && isUsedWithIncompatibleSelector(user, speculativeType)) { | 122 && isUsedWithIncompatibleSelector(user, speculativeType)) { |
| 123 return true; | 123 return true; |
| 124 } else if (user.selector != null | 124 } else if (user.selector != null |
| 125 && user.getDartReceiver(compiler) == instruction | 125 && user.getDartReceiver(compiler) == instruction |
| 126 && !speculativeType.computeMask(compiler).willHit( | 126 && !speculativeType.computeMask(compiler).understands( |
| 127 user.selector, compiler)) { | 127 user.selector, compiler)) { |
| 128 return true; | 128 return true; |
| 129 } | 129 } |
| 130 } | 130 } |
| 131 return false; | 131 return false; |
| 132 } | 132 } |
| 133 | 133 |
| 134 bool typeGuardWouldBeValuable(HInstruction instruction, | 134 bool typeGuardWouldBeValuable(HInstruction instruction, |
| 135 HType speculativeType) { | 135 HType speculativeType) { |
| 136 // If the type itself is not valuable, do not generate a guard for it. | 136 // If the type itself is not valuable, do not generate a guard for it. |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 hasComplexBailoutTargets = true; | 700 hasComplexBailoutTargets = true; |
| 701 } | 701 } |
| 702 } else { | 702 } else { |
| 703 hasComplexBailoutTargets = true; | 703 hasComplexBailoutTargets = true; |
| 704 blocks.forEach((HBasicBlock block) { | 704 blocks.forEach((HBasicBlock block) { |
| 705 block.bailoutTargets.add(target); | 705 block.bailoutTargets.add(target); |
| 706 }); | 706 }); |
| 707 } | 707 } |
| 708 } | 708 } |
| 709 } | 709 } |
| OLD | NEW |