| 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 class BailoutInfo { | 5 class BailoutInfo { |
| 6 int instructionId; | 6 int instructionId; |
| 7 int bailoutId; | 7 int bailoutId; |
| 8 BailoutInfo(this.instructionId, this.bailoutId); | 8 BailoutInfo(this.instructionId, this.bailoutId); |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 HType propagatedType = instruction.propagatedType; | 279 HType propagatedType = instruction.propagatedType; |
| 280 return propagatedType.isUseful() | 280 return propagatedType.isUseful() |
| 281 && propagatedType != instruction.computeTypeFromInputTypes(); | 281 && propagatedType != instruction.computeTypeFromInputTypes(); |
| 282 } | 282 } |
| 283 | 283 |
| 284 void insertCapturedEnvironments() { | 284 void insertCapturedEnvironments() { |
| 285 work.guards = <HTypeGuard>[]; | 285 work.guards = <HTypeGuard>[]; |
| 286 int state = 1; | 286 int state = 1; |
| 287 capturedEnvironments.forEach((HInstruction instruction, Environment env) { | 287 capturedEnvironments.forEach((HInstruction instruction, Environment env) { |
| 288 List<HInstruction> inputs = env.buildAndSetLast(instruction); | 288 List<HInstruction> inputs = env.buildAndSetLast(instruction); |
| 289 HTypeGuard guard = new HTypeGuard(state++, inputs); | 289 HTypeGuard guard = |
| 290 new HTypeGuard(instruction.propagatedType, state++, inputs); |
| 290 work.guards.add(guard); | 291 work.guards.add(guard); |
| 291 instruction.block.rewrite(instruction, guard); | 292 instruction.block.rewrite(instruction, guard); |
| 292 HInstruction insertionPoint = (instruction is HPhi) | 293 HInstruction insertionPoint = (instruction is HPhi) |
| 293 ? instruction.block.first | 294 ? instruction.block.first |
| 294 : instruction.next; | 295 : instruction.next; |
| 295 insertionPoint.block.addBefore(insertionPoint, guard); | 296 insertionPoint.block.addBefore(insertionPoint, guard); |
| 296 }); | 297 }); |
| 297 } | 298 } |
| 298 } | 299 } |
| 299 | 300 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 compiler.internalError('Control flow instructions already dealt with.', | 362 compiler.internalError('Control flow instructions already dealt with.', |
| 362 instruction: instruction); | 363 instruction: instruction); |
| 363 } | 364 } |
| 364 | 365 |
| 365 visitTypeGuard(HTypeGuard guard) { | 366 visitTypeGuard(HTypeGuard guard) { |
| 366 blocks.forEach((HBasicBlock block) { | 367 blocks.forEach((HBasicBlock block) { |
| 367 block.guards.add(guard); | 368 block.guards.add(guard); |
| 368 }); | 369 }); |
| 369 } | 370 } |
| 370 } | 371 } |
| OLD | NEW |