| 176 | } |
| 177 | |
| 178 | Target pickTarget(Context* c, |
| 179 | Value* value, |
| 180 | const SiteMask& mask, |
| 181 | unsigned registerPenalty, |
| 182 | Target best, |
| 183 | CostCalculator* costCalculator) |
| 184 | { |
| 185 | if (mask.typeMask & lir::Operand::RegisterPairMask) { |
| 186 | Target mine |
| 187 | = pickRegisterTarget(c, value, mask.registerMask, costCalculator); |
| 188 | |
| 189 | mine.cost += registerPenalty; |
| 190 | if (mine.cost == Target::MinimumRegisterCost) { |
| 191 | return mine; |
| 192 | } else if (mine.cost < best.cost) { |
| 193 | best = mine; |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | if (mask.typeMask & lir::Operand::MemoryMask) { |
| 198 | if (mask.frameIndex >= 0) { |
| 199 | Target mine(mask.frameIndex, |
| 200 | lir::Operand::Type::Memory, |
| 201 | frameCost(c, value, mask.frameIndex, costCalculator)); |
| 202 | if (mine.cost == Target::MinimumFrameCost) { |
| 203 | return mine; |
| 204 | } else if (mine.cost < best.cost) { |
| 205 | best = mine; |
| 206 | } |
| 207 | } else if (mask.frameIndex == AnyFrameIndex) { |
| 208 | Target mine = pickFrameTarget(c, value, costCalculator); |
| 209 | if (mine.cost == Target::MinimumFrameCost) { |
| 210 | return mine; |
| 211 | } else if (mine.cost < best.cost) { |
| 212 | best = mine; |
| 213 | } |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | return best; |
| 218 | } |
| 219 | |
| 220 | Target pickTarget(Context* c, |
| 221 | Read* read, |
no test coverage detected