Index: dart/sdk/lib/_internal/compiler/implementation/ssa/types.dart |
diff --git a/dart/sdk/lib/_internal/compiler/implementation/ssa/types.dart b/dart/sdk/lib/_internal/compiler/implementation/ssa/types.dart |
index 597ccf1e7f012ba13e486ccb48cc64eb3bac1e07..ec561166d979d2047111f1447fe3d87880db0c70 100644 |
--- a/dart/sdk/lib/_internal/compiler/implementation/ssa/types.dart |
+++ b/dart/sdk/lib/_internal/compiler/implementation/ssa/types.dart |
@@ -878,17 +878,19 @@ class HBoundedPotentialPrimitiveString extends HBoundedPotentialPrimitiveType { |
} |
class HTypeMap { |
- Map<HInstruction, HType> _map; |
- |
- HTypeMap() : _map = new Map<HInstruction, HType>(); |
+ List<HType> _list = new List<HType>(); |
operator [](HInstruction instruction) { |
- HType result = _map[instruction]; |
+ HType result; |
+ if (instruction.id < _list.length) result = _list[instruction.id]; |
if (result == null) return instruction.guaranteedType; |
return result; |
} |
operator []=(HInstruction instruction, HType value) { |
- _map[instruction] = value; |
+ if (_list.length <= instruction.id) { |
+ _list.length = instruction.id + 1; |
+ } |
+ _list[instruction.id] = value; |
} |
} |