| 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 '../closure.dart'; | 5 import '../closure.dart'; |
| 6 import '../common.dart'; | 6 import '../common.dart'; |
| 7 import '../compiler.dart' show Compiler; | 7 import '../compiler.dart' show Compiler; |
| 8 import '../constants/constant_system.dart'; | 8 import '../constants/constant_system.dart'; |
| 9 import '../constants/values.dart'; | 9 import '../constants/values.dart'; |
| 10 import '../dart_types.dart'; | 10 import '../dart_types.dart'; |
| (...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1255 // Keep track of all instructions that we have to deal with later | 1255 // Keep track of all instructions that we have to deal with later |
| 1256 // and count the number of them that are in the current block. | 1256 // and count the number of them that are in the current block. |
| 1257 Setlet<HInstruction> users = new Setlet<HInstruction>(); | 1257 Setlet<HInstruction> users = new Setlet<HInstruction>(); |
| 1258 int usersInCurrentBlock = 0; | 1258 int usersInCurrentBlock = 0; |
| 1259 | 1259 |
| 1260 // Run through all the users and see if they are dominated or | 1260 // Run through all the users and see if they are dominated or |
| 1261 // potentially dominated by [other]. | 1261 // potentially dominated by [other]. |
| 1262 HBasicBlock otherBlock = other.block; | 1262 HBasicBlock otherBlock = other.block; |
| 1263 for (int i = 0, length = usedBy.length; i < length; i++) { | 1263 for (int i = 0, length = usedBy.length; i < length; i++) { |
| 1264 HInstruction current = usedBy[i]; | 1264 HInstruction current = usedBy[i]; |
| 1265 HBasicBlock currentBlock = current.block; | 1265 if (otherBlock.dominates(current.block)) { |
| 1266 if (otherBlock.dominates(currentBlock)) { | 1266 if (identical(current.block, otherBlock)) usersInCurrentBlock++; |
| 1267 if (identical(currentBlock, otherBlock)) usersInCurrentBlock++; | |
| 1268 users.add(current); | 1267 users.add(current); |
| 1269 } | 1268 } |
| 1270 } | 1269 } |
| 1271 | 1270 |
| 1272 // Run through all the phis in the same block as [other] and remove them | 1271 // Run through all the phis in the same block as [other] and remove them |
| 1273 // from the users set. | 1272 // from the users set. |
| 1274 if (usersInCurrentBlock > 0) { | 1273 if (usersInCurrentBlock > 0) { |
| 1275 for (HPhi phi = otherBlock.phis.first; phi != null; phi = phi.next) { | 1274 for (HPhi phi = otherBlock.phis.first; phi != null; phi = phi.next) { |
| 1276 if (users.contains(phi)) { | 1275 if (users.contains(phi)) { |
| 1277 users.remove(phi); | 1276 users.remove(phi); |
| (...skipping 2143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3421 class HDynamicType extends HRuntimeType { | 3420 class HDynamicType extends HRuntimeType { |
| 3422 HDynamicType(DynamicType dartType, TypeMask instructionType) | 3421 HDynamicType(DynamicType dartType, TypeMask instructionType) |
| 3423 : super(const <HInstruction>[], dartType, instructionType); | 3422 : super(const <HInstruction>[], dartType, instructionType); |
| 3424 | 3423 |
| 3425 accept(HVisitor visitor) => visitor.visitDynamicType(this); | 3424 accept(HVisitor visitor) => visitor.visitDynamicType(this); |
| 3426 | 3425 |
| 3427 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; | 3426 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; |
| 3428 | 3427 |
| 3429 bool typeEquals(HInstruction other) => other is HDynamicType; | 3428 bool typeEquals(HInstruction other) => other is HDynamicType; |
| 3430 } | 3429 } |
| OLD | NEW |