| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_H_ | 5 #ifndef V8_OBJECTS_H_ |
| 6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 3227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3238 // Accessors for fetching instance descriptor at descriptor number. | 3238 // Accessors for fetching instance descriptor at descriptor number. |
| 3239 inline Name* GetKey(int descriptor_number); | 3239 inline Name* GetKey(int descriptor_number); |
| 3240 inline Object** GetKeySlot(int descriptor_number); | 3240 inline Object** GetKeySlot(int descriptor_number); |
| 3241 inline Object* GetValue(int descriptor_number); | 3241 inline Object* GetValue(int descriptor_number); |
| 3242 inline void SetValue(int descriptor_number, Object* value); | 3242 inline void SetValue(int descriptor_number, Object* value); |
| 3243 inline Object** GetValueSlot(int descriptor_number); | 3243 inline Object** GetValueSlot(int descriptor_number); |
| 3244 static inline int GetValueOffset(int descriptor_number); | 3244 static inline int GetValueOffset(int descriptor_number); |
| 3245 inline Object** GetDescriptorStartSlot(int descriptor_number); | 3245 inline Object** GetDescriptorStartSlot(int descriptor_number); |
| 3246 inline Object** GetDescriptorEndSlot(int descriptor_number); | 3246 inline Object** GetDescriptorEndSlot(int descriptor_number); |
| 3247 inline PropertyDetails GetDetails(int descriptor_number); | 3247 inline PropertyDetails GetDetails(int descriptor_number); |
| 3248 inline PropertyType GetType(int descriptor_number); | |
| 3249 inline int GetFieldIndex(int descriptor_number); | 3248 inline int GetFieldIndex(int descriptor_number); |
| 3250 inline FieldType* GetFieldType(int descriptor_number); | 3249 inline FieldType* GetFieldType(int descriptor_number); |
| 3251 inline Object* GetConstant(int descriptor_number); | |
| 3252 inline Object* GetCallbacksObject(int descriptor_number); | |
| 3253 inline AccessorDescriptor* GetCallbacks(int descriptor_number); | |
| 3254 | 3250 |
| 3255 inline Name* GetSortedKey(int descriptor_number); | 3251 inline Name* GetSortedKey(int descriptor_number); |
| 3256 inline int GetSortedKeyIndex(int descriptor_number); | 3252 inline int GetSortedKeyIndex(int descriptor_number); |
| 3257 inline void SetSortedKey(int pointer, int descriptor_number); | 3253 inline void SetSortedKey(int pointer, int descriptor_number); |
| 3258 inline void SetRepresentation(int descriptor_number, | 3254 inline void SetRepresentation(int descriptor_number, |
| 3259 Representation representation); | 3255 Representation representation); |
| 3260 | 3256 |
| 3261 // Accessor for complete descriptor. | 3257 // Accessor for complete descriptor. |
| 3262 inline void Get(int descriptor_number, Descriptor* desc); | 3258 inline void Get(int descriptor_number, Descriptor* desc); |
| 3263 inline void Set(int descriptor_number, Descriptor* desc); | 3259 inline void Set(int descriptor_number, Descriptor* desc); |
| 3260 inline void Set(int descriptor_number, Name* key, Object* value, |
| 3261 PropertyDetails details); |
| 3264 void Replace(int descriptor_number, Descriptor* descriptor); | 3262 void Replace(int descriptor_number, Descriptor* descriptor); |
| 3265 | 3263 |
| 3266 // Append automatically sets the enumeration index. This should only be used | 3264 // Append automatically sets the enumeration index. This should only be used |
| 3267 // to add descriptors in bulk at the end, followed by sorting the descriptor | 3265 // to add descriptors in bulk at the end, followed by sorting the descriptor |
| 3268 // array. | 3266 // array. |
| 3269 inline void Append(Descriptor* desc); | 3267 inline void Append(Descriptor* desc); |
| 3270 | 3268 |
| 3271 static Handle<DescriptorArray> CopyUpTo(Handle<DescriptorArray> desc, | 3269 static Handle<DescriptorArray> CopyUpTo(Handle<DescriptorArray> desc, |
| 3272 int enumeration_index, | 3270 int enumeration_index, |
| 3273 int slack = 0); | 3271 int slack = 0); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3365 static int ToValueIndex(int descriptor_number) { | 3363 static int ToValueIndex(int descriptor_number) { |
| 3366 return kFirstIndex + (descriptor_number * kDescriptorSize) + | 3364 return kFirstIndex + (descriptor_number * kDescriptorSize) + |
| 3367 kDescriptorValue; | 3365 kDescriptorValue; |
| 3368 } | 3366 } |
| 3369 | 3367 |
| 3370 private: | 3368 private: |
| 3371 // Transfer a complete descriptor from the src descriptor array to this | 3369 // Transfer a complete descriptor from the src descriptor array to this |
| 3372 // descriptor array. | 3370 // descriptor array. |
| 3373 void CopyFrom(int index, DescriptorArray* src); | 3371 void CopyFrom(int index, DescriptorArray* src); |
| 3374 | 3372 |
| 3375 inline void SetDescriptor(int descriptor_number, Descriptor* desc); | |
| 3376 | |
| 3377 // Swap first and second descriptor. | 3373 // Swap first and second descriptor. |
| 3378 inline void SwapSortedKeys(int first, int second); | 3374 inline void SwapSortedKeys(int first, int second); |
| 3379 | 3375 |
| 3380 DISALLOW_IMPLICIT_CONSTRUCTORS(DescriptorArray); | 3376 DISALLOW_IMPLICIT_CONSTRUCTORS(DescriptorArray); |
| 3381 }; | 3377 }; |
| 3382 | 3378 |
| 3383 | 3379 |
| 3384 enum SearchMode { ALL_ENTRIES, VALID_ENTRIES }; | 3380 enum SearchMode { ALL_ENTRIES, VALID_ENTRIES }; |
| 3385 | 3381 |
| 3386 template <SearchMode search_mode, typename T> | 3382 template <SearchMode search_mode, typename T> |
| (...skipping 8315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11702 } | 11698 } |
| 11703 }; | 11699 }; |
| 11704 | 11700 |
| 11705 | 11701 |
| 11706 } // NOLINT, false-positive due to second-order macros. | 11702 } // NOLINT, false-positive due to second-order macros. |
| 11707 } // NOLINT, false-positive due to second-order macros. | 11703 } // NOLINT, false-positive due to second-order macros. |
| 11708 | 11704 |
| 11709 #include "src/objects/object-macros-undef.h" | 11705 #include "src/objects/object-macros-undef.h" |
| 11710 | 11706 |
| 11711 #endif // V8_OBJECTS_H_ | 11707 #endif // V8_OBJECTS_H_ |
| OLD | NEW |