Chromium Code Reviews| Index: lib/compiler/implementation/ssa/optimize.dart |
| diff --git a/lib/compiler/implementation/ssa/optimize.dart b/lib/compiler/implementation/ssa/optimize.dart |
| index a1562b535c79efae6f852115688d6281c8b531fc..9057f92d3d9555225197822f44a1e0d380972ee1 100644 |
| --- a/lib/compiler/implementation/ssa/optimize.dart |
| +++ b/lib/compiler/implementation/ssa/optimize.dart |
| @@ -289,7 +289,7 @@ class SsaConstantFolder extends HBaseVisitor implements OptimizationPhase { |
| HInstruction visitTypeGuard(HTypeGuard node) { |
| HInstruction value = node.guarded; |
| - HType combinedType = value.propagatedType.combine(node.guardedType); |
| + HType combinedType = value.propagatedType.intersect(node.guardedType); |
|
ngeoffray
2012/04/23 10:19:21
Please add a simple comment or example on why this
floitsch
2012/04/24 15:25:18
Good thing you made me do this. Should have been u
|
| return (combinedType == value.propagatedType) ? value : node; |
| } |
| @@ -403,7 +403,7 @@ class SsaCheckInserter extends HBaseVisitor implements OptimizationPhase { |
| } |
| void visitIndex(HIndex node) { |
| - if (!node.receiver.isStringOrArray()) return; |
| + if (!node.receiver.isIndexablePrimitive()) return; |
| HInstruction index = node.index; |
| if (index is HBoundsCheck) return; |
| if (!node.index.isInteger()) { |