Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3774)

Unified Diff: lib/compiler/implementation/ssa/types.dart

Issue 10827180: Move types out of the HInstructions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Simplifications. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/ssa/types.dart
diff --git a/lib/compiler/implementation/ssa/types.dart b/lib/compiler/implementation/ssa/types.dart
index 84c857203375d1c7f53a2f23cb2c780fe80f62b8..d56aab7ed9a736d4b8a1bcd980ad1d40fbcd2786 100644
--- a/lib/compiler/implementation/ssa/types.dart
+++ b/lib/compiler/implementation/ssa/types.dart
@@ -762,3 +762,19 @@ class HBoundedPotentialPrimitiveString extends HBoundedPotentialPrimitiveType {
return super.intersection(other);
}
}
+
+class HTypeMap {
+ Map<HInstruction, HType> _map;
+
+ HTypeMap() : _map = new Map<HInstruction, HType>();
+
+ operator [](HInstruction instruction) {
+ HType result = _map[instruction];
+ if (result == null) return instruction.guaranteedType;
+ return result;
+ }
+
+ operator []=(HInstruction instruction, HType value) {
+ _map[instruction] = value;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698