Chromium Code Reviews| Index: src/objects.h |
| diff --git a/src/objects.h b/src/objects.h |
| index 4cbf2bd75d5f73d871c89e0be423321254c1f444..1e2fafe3a25517f48d41a3e4a6cdc89324fa3a49 100644 |
| --- a/src/objects.h |
| +++ b/src/objects.h |
| @@ -2475,6 +2475,7 @@ class DescriptorArray: public FixedArray { |
| } |
| inline int number_of_entries() { return number_of_descriptors(); } |
| + int NextEnumerationIndex() { return number_of_descriptors() + 1; } |
| int LastAdded() { |
| ASSERT(!IsEmpty()); |
| @@ -2487,13 +2488,6 @@ class DescriptorArray: public FixedArray { |
| } |
| } |
| - int NextEnumerationIndex() { |
| - if (number_of_descriptors() == 0) { |
| - return PropertyDetails::kInitialIndex; |
| - } |
| - return GetDetails(LastAdded()).index() + 1; |
| - } |
| - |
| // Set index of the last added descriptor and flush any enum cache. |
| void SetLastAdded(int index) { |
| ASSERT(!IsEmpty() || index > 0); |
| @@ -2546,6 +2540,12 @@ class DescriptorArray: public FixedArray { |
| inline void Set(int descriptor_number, |
| Descriptor* desc, |
| const WhitenessWitness&); |
| + // Append automatically sets the enumeration index. This should only be used |
| + // to add descriptors in bulk at the end, followed by sorting the descriptor |
| + // array. |
| + inline void Append(int descriptor_number, |
| + Descriptor* desc, |
| + const WhitenessWitness&); |
|
danno
2012/07/12 11:26:08
Remove the need for descriptor_number as discussed
|
| // Transfer a complete descriptor from the src descriptor array to the dst |
| // one, dropping map transitions in CALLBACKS. |
| @@ -2613,6 +2613,9 @@ class DescriptorArray: public FixedArray { |
| // Constant for denoting key was not found. |
| static const int kNotFound = -1; |
| + // Constant for denoting that the LastAdded field was not yet set. |
| + static const int kNoneAdded = -1; |
| + |
| static const int kBackPointerStorageIndex = 0; |
| static const int kLastAddedIndex = 1; |
| static const int kTransitionsIndex = 2; |