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

Side by Side Diff: runtime/vm/precompiler.h

Issue 1644543004: Precompilation: canonicalize lists of stackmaps. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | runtime/vm/precompiler.cc » ('j') | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 VM_PRECOMPILER_H_ 5 #ifndef VM_PRECOMPILER_H_
6 #define VM_PRECOMPILER_H_ 6 #define VM_PRECOMPILER_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/hash_map.h" 9 #include "vm/hash_map.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 return key->PcOffset(); 57 return key->PcOffset();
58 } 58 }
59 59
60 static inline bool IsKeyEqual(Pair pair, Key key) { 60 static inline bool IsKeyEqual(Pair pair, Key key) {
61 return pair->Equals(*key); 61 return pair->Equals(*key);
62 } 62 }
63 }; 63 };
64 64
65 typedef DirectChainedHashMap<StackmapKeyValueTrait> StackmapSet; 65 typedef DirectChainedHashMap<StackmapKeyValueTrait> StackmapSet;
66 66
67
68 class ArrayKeyValueTrait {
69 public:
70 // Typedefs needed for the DirectChainedHashMap template.
71 typedef const Array* Key;
72 typedef const Array* Value;
73 typedef const Array* Pair;
74
75 static Key KeyOf(Pair kv) { return kv; }
76
77 static Value ValueOf(Pair kv) { return kv; }
78
79 static inline intptr_t Hashcode(Key key) {
80 return key->Length();
81 }
82
83 static inline bool IsKeyEqual(Pair pair, Key key) {
84 if (pair->Length() != key->Length()) {
85 return false;
86 }
87 for (intptr_t i = 0; i < pair->Length(); i++) {
88 if (pair->At(i) != key->At(i)) {
89 return false;
90 }
91 }
92 return true;
93 }
94 };
95
96 typedef DirectChainedHashMap<ArrayKeyValueTrait> ArraySet;
97
98
67 class FunctionKeyValueTrait { 99 class FunctionKeyValueTrait {
68 public: 100 public:
69 // Typedefs needed for the DirectChainedHashMap template. 101 // Typedefs needed for the DirectChainedHashMap template.
70 typedef const Function* Key; 102 typedef const Function* Key;
71 typedef const Function* Value; 103 typedef const Function* Value;
72 typedef const Function* Pair; 104 typedef const Function* Pair;
73 105
74 static Key KeyOf(Pair kv) { return kv; } 106 static Key KeyOf(Pair kv) { return kv; }
75 107
76 static Value ValueOf(Pair kv) { return kv; } 108 static Value ValueOf(Pair kv) { return kv; }
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 bool IsSent(const String& selector); 177 bool IsSent(const String& selector);
146 178
147 void ProcessFunction(const Function& function); 179 void ProcessFunction(const Function& function);
148 void CheckForNewDynamicFunctions(); 180 void CheckForNewDynamicFunctions();
149 181
150 void DropUncompiledFunctions(); 182 void DropUncompiledFunctions();
151 void DropFields(); 183 void DropFields();
152 void CollectDynamicFunctionNames(); 184 void CollectDynamicFunctionNames();
153 void BindStaticCalls(); 185 void BindStaticCalls();
154 void DedupStackmaps(); 186 void DedupStackmaps();
187 void DedupStackmapLists();
155 void ResetPrecompilerState(); 188 void ResetPrecompilerState();
156 189
157 class FunctionVisitor : public ValueObject { 190 class FunctionVisitor : public ValueObject {
158 public: 191 public:
159 virtual ~FunctionVisitor() {} 192 virtual ~FunctionVisitor() {}
160 virtual void VisitFunction(const Function& function) = 0; 193 virtual void VisitFunction(const Function& function) = 0;
161 }; 194 };
162 195
163 void VisitFunctions(FunctionVisitor* visitor); 196 void VisitFunctions(FunctionVisitor* visitor);
164 197
(...skipping 20 matching lines...) Expand all
185 const GrowableObjectArray& pending_functions_; 218 const GrowableObjectArray& pending_functions_;
186 SymbolSet sent_selectors_; 219 SymbolSet sent_selectors_;
187 FunctionSet enqueued_functions_; 220 FunctionSet enqueued_functions_;
188 FieldSet fields_to_retain_; 221 FieldSet fields_to_retain_;
189 Error& error_; 222 Error& error_;
190 }; 223 };
191 224
192 } // namespace dart 225 } // namespace dart
193 226
194 #endif // VM_PRECOMPILER_H_ 227 #endif // VM_PRECOMPILER_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/precompiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698