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

Unified Diff: runtime/vm/kernel_to_il.h

Issue 2658693002: Removed usage of std::map and std::vector from kernel code. Issue #28064. (Closed)
Patch Set: Removed usage of std::map and std::vector from kernel code. Issue #28064. Created 3 years, 11 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/kernel_reader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel_to_il.h
diff --git a/runtime/vm/kernel_to_il.h b/runtime/vm/kernel_to_il.h
index e518cee8e1cec12366a43c316b05a5f9a8804f40..1f374f5aa453e6f085a97a1c150853a70f9c73ca 100644
--- a/runtime/vm/kernel_to_il.h
+++ b/runtime/vm/kernel_to_il.h
@@ -75,8 +75,42 @@ class Map : public DirectChainedHashMap<RawPointerKeyValueTrait<K, V> > {
return pair->value;
}
}
+
+ inline Pair* LookupPair(const Key& key) {
+ return DirectChainedHashMap<RawPointerKeyValueTrait<K, V> >::Lookup(key);
+ }
};
+template <typename K, typename V>
+class MallocMap
+ : public MallocDirectChainedHashMap<RawPointerKeyValueTrait<K, V> > {
+ public:
+ typedef typename RawPointerKeyValueTrait<K, V>::Key Key;
+ typedef typename RawPointerKeyValueTrait<K, V>::Value Value;
+ typedef typename RawPointerKeyValueTrait<K, V>::Pair Pair;
+
+ inline void Insert(const Key& key, const Value& value) {
+ Pair pair(key, value);
+ MallocDirectChainedHashMap<RawPointerKeyValueTrait<K, V> >::Insert(pair);
+ }
+
+ inline V Lookup(const Key& key) {
+ Pair* pair =
+ MallocDirectChainedHashMap<RawPointerKeyValueTrait<K, V> >::Lookup(key);
+ if (pair == NULL) {
+ return V();
+ } else {
+ return pair->value;
+ }
+ }
+
+ inline Pair* LookupPair(const Key& key) {
+ return MallocDirectChainedHashMap<RawPointerKeyValueTrait<K, V> >::Lookup(
+ key);
+ }
+};
+
+
class BreakableBlock;
class CatchBlock;
class FlowGraphBuilder;
« no previous file with comments | « runtime/vm/kernel_reader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698