| 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 3354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3365 static int ToKeyIndex(int descriptor_number) { | 3365 static int ToKeyIndex(int descriptor_number) { |
| 3366 return kFirstIndex + (descriptor_number * kDescriptorSize) + kDescriptorKey; | 3366 return kFirstIndex + (descriptor_number * kDescriptorSize) + kDescriptorKey; |
| 3367 } | 3367 } |
| 3368 | 3368 |
| 3369 static int ToValueIndex(int descriptor_number) { | 3369 static int ToValueIndex(int descriptor_number) { |
| 3370 return kFirstIndex + (descriptor_number * kDescriptorSize) + | 3370 return kFirstIndex + (descriptor_number * kDescriptorSize) + |
| 3371 kDescriptorValue; | 3371 kDescriptorValue; |
| 3372 } | 3372 } |
| 3373 | 3373 |
| 3374 private: | 3374 private: |
| 3375 // An entry in a DescriptorArray, represented as an (array, index) pair. | |
| 3376 class Entry { | |
| 3377 public: | |
| 3378 inline explicit Entry(DescriptorArray* descs, int index) : | |
| 3379 descs_(descs), index_(index) { } | |
| 3380 | |
| 3381 inline PropertyType type(); | |
| 3382 inline Object* GetCallbackObject(); | |
| 3383 | |
| 3384 private: | |
| 3385 DescriptorArray* descs_; | |
| 3386 int index_; | |
| 3387 }; | |
| 3388 | |
| 3389 // Transfer a complete descriptor from the src descriptor array to this | 3375 // Transfer a complete descriptor from the src descriptor array to this |
| 3390 // descriptor array. | 3376 // descriptor array. |
| 3391 void CopyFrom(int index, DescriptorArray* src); | 3377 void CopyFrom(int index, DescriptorArray* src); |
| 3392 | 3378 |
| 3393 inline void SetDescriptor(int descriptor_number, Descriptor* desc); | 3379 inline void SetDescriptor(int descriptor_number, Descriptor* desc); |
| 3394 | 3380 |
| 3395 // Swap first and second descriptor. | 3381 // Swap first and second descriptor. |
| 3396 inline void SwapSortedKeys(int first, int second); | 3382 inline void SwapSortedKeys(int first, int second); |
| 3397 | 3383 |
| 3398 DISALLOW_IMPLICIT_CONSTRUCTORS(DescriptorArray); | 3384 DISALLOW_IMPLICIT_CONSTRUCTORS(DescriptorArray); |
| (...skipping 8349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11748 } | 11734 } |
| 11749 }; | 11735 }; |
| 11750 | 11736 |
| 11751 | 11737 |
| 11752 } // NOLINT, false-positive due to second-order macros. | 11738 } // NOLINT, false-positive due to second-order macros. |
| 11753 } // NOLINT, false-positive due to second-order macros. | 11739 } // NOLINT, false-positive due to second-order macros. |
| 11754 | 11740 |
| 11755 #include "src/objects/object-macros-undef.h" | 11741 #include "src/objects/object-macros-undef.h" |
| 11756 | 11742 |
| 11757 #endif // V8_OBJECTS_H_ | 11743 #endif // V8_OBJECTS_H_ |
| OLD | NEW |