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

Side by Side Diff: src/objects/dictionary.h

Issue 2961253002: [objects] Rename macros from DECLARE_ to DECL_ for consistency. (Closed)
Patch Set: Created 3 years, 5 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 | « src/objects/descriptor-array.h ('k') | src/objects/frame-array.h » ('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 2017 the V8 project authors. All rights reserved. 1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_OBJECTS_DICTIONARY_H_ 5 #ifndef V8_OBJECTS_DICTIONARY_H_
6 #define V8_OBJECTS_DICTIONARY_H_ 6 #define V8_OBJECTS_DICTIONARY_H_
7 7
8 #include "src/objects/hash-table.h" 8 #include "src/objects/hash-table.h"
9 9
10 #include "src/base/export-template.h" 10 #include "src/base/export-template.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 160
161 MUST_USE_RESULT static Handle<Derived> Add(Handle<Derived> dictionary, 161 MUST_USE_RESULT static Handle<Derived> Add(Handle<Derived> dictionary,
162 Key key, Handle<Object> value, 162 Key key, Handle<Object> value,
163 PropertyDetails details, 163 PropertyDetails details,
164 int* entry_out = nullptr); 164 int* entry_out = nullptr);
165 }; 165 };
166 166
167 class NameDictionary 167 class NameDictionary
168 : public BaseNameDictionary<NameDictionary, NameDictionaryShape> { 168 : public BaseNameDictionary<NameDictionary, NameDictionaryShape> {
169 public: 169 public:
170 DECLARE_CAST(NameDictionary) 170 DECL_CAST(NameDictionary)
171 171
172 static const int kEntryDetailsIndex = 2; 172 static const int kEntryDetailsIndex = 2;
173 static const int kInitialCapacity = 2; 173 static const int kInitialCapacity = 2;
174 inline Name* NameAt(int entry); 174 inline Name* NameAt(int entry);
175 }; 175 };
176 176
177 class GlobalDictionaryShape : public NameDictionaryShape { 177 class GlobalDictionaryShape : public NameDictionaryShape {
178 public: 178 public:
179 static inline bool IsMatch(Handle<Name> key, Object* other); 179 static inline bool IsMatch(Handle<Name> key, Object* other);
180 static inline uint32_t HashForObject(Isolate* isolate, Object* object); 180 static inline uint32_t HashForObject(Isolate* isolate, Object* object);
181 181
182 static const int kEntrySize = 1; // Overrides NameDictionaryShape::kEntrySize 182 static const int kEntrySize = 1; // Overrides NameDictionaryShape::kEntrySize
183 183
184 template <typename Dictionary> 184 template <typename Dictionary>
185 static inline PropertyDetails DetailsAt(Dictionary* dict, int entry); 185 static inline PropertyDetails DetailsAt(Dictionary* dict, int entry);
186 186
187 template <typename Dictionary> 187 template <typename Dictionary>
188 static inline void DetailsAtPut(Dictionary* dict, int entry, 188 static inline void DetailsAtPut(Dictionary* dict, int entry,
189 PropertyDetails value); 189 PropertyDetails value);
190 190
191 static inline Object* Unwrap(Object* key); 191 static inline Object* Unwrap(Object* key);
192 static inline bool IsKey(Isolate* isolate, Object* k); 192 static inline bool IsKey(Isolate* isolate, Object* k);
193 static inline bool IsLive(Isolate* isolate, Object* key); 193 static inline bool IsLive(Isolate* isolate, Object* key);
194 }; 194 };
195 195
196 class GlobalDictionary 196 class GlobalDictionary
197 : public BaseNameDictionary<GlobalDictionary, GlobalDictionaryShape> { 197 : public BaseNameDictionary<GlobalDictionary, GlobalDictionaryShape> {
198 public: 198 public:
199 DECLARE_CAST(GlobalDictionary) 199 DECL_CAST(GlobalDictionary)
200 200
201 inline Object* ValueAt(int entry); 201 inline Object* ValueAt(int entry);
202 inline PropertyCell* CellAt(int entry); 202 inline PropertyCell* CellAt(int entry);
203 inline void SetEntry(int entry, Object* key, Object* value, 203 inline void SetEntry(int entry, Object* key, Object* value,
204 PropertyDetails details); 204 PropertyDetails details);
205 inline Name* NameAt(int entry); 205 inline Name* NameAt(int entry);
206 void ValueAtPut(int entry, Object* value) { set(EntryToIndex(entry), value); } 206 void ValueAtPut(int entry, Object* value) { set(EntryToIndex(entry), value); }
207 }; 207 };
208 208
209 class NumberDictionaryShape : public BaseDictionaryShape<uint32_t> { 209 class NumberDictionaryShape : public BaseDictionaryShape<uint32_t> {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 246
247 extern template class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE) 247 extern template class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE)
248 HashTable<SeededNumberDictionary, SeededNumberDictionaryShape>; 248 HashTable<SeededNumberDictionary, SeededNumberDictionaryShape>;
249 249
250 extern template class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE) 250 extern template class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE)
251 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape>; 251 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape>;
252 252
253 class SeededNumberDictionary 253 class SeededNumberDictionary
254 : public Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape> { 254 : public Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape> {
255 public: 255 public:
256 DECLARE_CAST(SeededNumberDictionary) 256 DECL_CAST(SeededNumberDictionary)
257 257
258 // Type specific at put (default NONE attributes is used when adding). 258 // Type specific at put (default NONE attributes is used when adding).
259 MUST_USE_RESULT static Handle<SeededNumberDictionary> Set( 259 MUST_USE_RESULT static Handle<SeededNumberDictionary> Set(
260 Handle<SeededNumberDictionary> dictionary, uint32_t key, 260 Handle<SeededNumberDictionary> dictionary, uint32_t key,
261 Handle<Object> value, Handle<JSObject> dictionary_holder, 261 Handle<Object> value, Handle<JSObject> dictionary_holder,
262 PropertyDetails details = PropertyDetails::Empty()); 262 PropertyDetails details = PropertyDetails::Empty());
263 263
264 static const int kMaxNumberKeyIndex = kPrefixStartIndex; 264 static const int kMaxNumberKeyIndex = kPrefixStartIndex;
265 void UpdateMaxNumberKey(uint32_t key, Handle<JSObject> dictionary_holder); 265 void UpdateMaxNumberKey(uint32_t key, Handle<JSObject> dictionary_holder);
266 266
(...skipping 27 matching lines...) Expand all
294 294
295 // JSObjects prefer dictionary elements if the dictionary saves this much 295 // JSObjects prefer dictionary elements if the dictionary saves this much
296 // memory compared to a fast elements backing store. 296 // memory compared to a fast elements backing store.
297 static const uint32_t kPreferFastElementsSizeFactor = 3; 297 static const uint32_t kPreferFastElementsSizeFactor = 3;
298 }; 298 };
299 299
300 class UnseededNumberDictionary 300 class UnseededNumberDictionary
301 : public Dictionary<UnseededNumberDictionary, 301 : public Dictionary<UnseededNumberDictionary,
302 UnseededNumberDictionaryShape> { 302 UnseededNumberDictionaryShape> {
303 public: 303 public:
304 DECLARE_CAST(UnseededNumberDictionary) 304 DECL_CAST(UnseededNumberDictionary)
305 305
306 // Type specific at put (default NONE attributes is used when adding). 306 // Type specific at put (default NONE attributes is used when adding).
307 MUST_USE_RESULT static Handle<UnseededNumberDictionary> Set( 307 MUST_USE_RESULT static Handle<UnseededNumberDictionary> Set(
308 Handle<UnseededNumberDictionary> dictionary, uint32_t key, 308 Handle<UnseededNumberDictionary> dictionary, uint32_t key,
309 Handle<Object> value); 309 Handle<Object> value);
310 310
311 static const int kEntryValueIndex = 1; 311 static const int kEntryValueIndex = 1;
312 }; 312 };
313 313
314 } // namespace internal 314 } // namespace internal
315 } // namespace v8 315 } // namespace v8
316 316
317 #include "src/objects/object-macros-undef.h" 317 #include "src/objects/object-macros-undef.h"
318 318
319 #endif // V8_OBJECTS_DICTIONARY_H_ 319 #endif // V8_OBJECTS_DICTIONARY_H_
OLDNEW
« no previous file with comments | « src/objects/descriptor-array.h ('k') | src/objects/frame-array.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698