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

Unified Diff: runtime/vm/hash_map.h

Issue 2411823003: VM support for running Kernel binaries. (Closed)
Patch Set: Address comments Created 4 years, 2 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
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/hash_map.h
diff --git a/runtime/vm/hash_map.h b/runtime/vm/hash_map.h
index 64f879081495371a85181a8b112d500a38a17ccd..d703c0ac1fdb7f69753f6b6a3d1590df4a8f0518 100644
--- a/runtime/vm/hash_map.h
+++ b/runtime/vm/hash_map.h
@@ -364,6 +364,27 @@ class NumbersKeyValueTrait {
static inline bool IsKeyEqual(Pair kv, Key key) { return kv.first() == key; }
};
+
+template<typename K, typename V>
+class RawPointerKeyValueTrait {
+ public:
+ typedef K* Key;
+ typedef V Value;
+
+ struct Pair {
+ Key key;
+ Value value;
+ Pair() : key(NULL), value() {}
+ Pair(const Key key, const Value& value) : key(key), value(value) {}
+ Pair(const Pair& other) : key(other.key), value(other.value) {}
+ };
+
+ static Key KeyOf(Pair kv) { return kv.key; }
+ static Value ValueOf(Pair kv) { return kv.value; }
+ static intptr_t Hashcode(Key key) { return reinterpret_cast<intptr_t>(key); }
+ static bool IsKeyEqual(Pair kv, Key key) { return kv.key == key; }
+};
+
} // namespace dart
#endif // VM_HASH_MAP_H_
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698