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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/kernel_reader.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef RUNTIME_VM_KERNEL_TO_IL_H_ 5 #ifndef RUNTIME_VM_KERNEL_TO_IL_H_
6 #define RUNTIME_VM_KERNEL_TO_IL_H_ 6 #define RUNTIME_VM_KERNEL_TO_IL_H_
7 7
8 #if !defined(DART_PRECOMPILED_RUNTIME) 8 #if !defined(DART_PRECOMPILED_RUNTIME)
9 9
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 inline V Lookup(const Key& key) { 69 inline V Lookup(const Key& key) {
70 Pair* pair = 70 Pair* pair =
71 DirectChainedHashMap<RawPointerKeyValueTrait<K, V> >::Lookup(key); 71 DirectChainedHashMap<RawPointerKeyValueTrait<K, V> >::Lookup(key);
72 if (pair == NULL) { 72 if (pair == NULL) {
73 return V(); 73 return V();
74 } else { 74 } else {
75 return pair->value; 75 return pair->value;
76 } 76 }
77 } 77 }
78
79 inline Pair* LookupPair(const Key& key) {
80 return DirectChainedHashMap<RawPointerKeyValueTrait<K, V> >::Lookup(key);
81 }
78 }; 82 };
79 83
84 template <typename K, typename V>
85 class MallocMap
86 : public MallocDirectChainedHashMap<RawPointerKeyValueTrait<K, V> > {
87 public:
88 typedef typename RawPointerKeyValueTrait<K, V>::Key Key;
89 typedef typename RawPointerKeyValueTrait<K, V>::Value Value;
90 typedef typename RawPointerKeyValueTrait<K, V>::Pair Pair;
91
92 inline void Insert(const Key& key, const Value& value) {
93 Pair pair(key, value);
94 MallocDirectChainedHashMap<RawPointerKeyValueTrait<K, V> >::Insert(pair);
95 }
96
97 inline V Lookup(const Key& key) {
98 Pair* pair =
99 MallocDirectChainedHashMap<RawPointerKeyValueTrait<K, V> >::Lookup(key);
100 if (pair == NULL) {
101 return V();
102 } else {
103 return pair->value;
104 }
105 }
106
107 inline Pair* LookupPair(const Key& key) {
108 return MallocDirectChainedHashMap<RawPointerKeyValueTrait<K, V> >::Lookup(
109 key);
110 }
111 };
112
113
80 class BreakableBlock; 114 class BreakableBlock;
81 class CatchBlock; 115 class CatchBlock;
82 class FlowGraphBuilder; 116 class FlowGraphBuilder;
83 class SwitchBlock; 117 class SwitchBlock;
84 class TryCatchBlock; 118 class TryCatchBlock;
85 class TryFinallyBlock; 119 class TryFinallyBlock;
86 120
87 class Fragment { 121 class Fragment {
88 public: 122 public:
89 Instruction* entry; 123 Instruction* entry;
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 namespace kernel { 1000 namespace kernel {
967 1001
968 RawObject* EvaluateMetadata(TreeNode* const kernel_node); 1002 RawObject* EvaluateMetadata(TreeNode* const kernel_node);
969 RawObject* BuildParameterDescriptor(TreeNode* const kernel_node); 1003 RawObject* BuildParameterDescriptor(TreeNode* const kernel_node);
970 1004
971 } // namespace kernel 1005 } // namespace kernel
972 } // namespace dart 1006 } // namespace dart
973 1007
974 #endif // !defined(DART_PRECOMPILED_RUNTIME) 1008 #endif // !defined(DART_PRECOMPILED_RUNTIME)
975 #endif // RUNTIME_VM_KERNEL_TO_IL_H_ 1009 #endif // RUNTIME_VM_KERNEL_TO_IL_H_
OLDNEW
« 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