Index: src/objects.h |
diff --git a/src/objects.h b/src/objects.h |
index a7aabe23e0f856b18734e09f3fe4f40c7b4b508d..d160e7b46a6ba1d2a45719321b3e6bcd4a27f179 100644 |
--- a/src/objects.h |
+++ b/src/objects.h |
@@ -3234,10 +3234,12 @@ class HashTable : public HashTableBase { |
void Rehash(Key key); |
// Returns the key at entry. |
- Object* KeyAt(int entry) { return get(EntryToIndex(entry)); } |
+ Object* KeyAt(int entry) { return get(EntryToIndex(entry) + kEntryKeyIndex); } |
static const int kElementsStartIndex = kPrefixStartIndex + Shape::kPrefixSize; |
static const int kEntrySize = Shape::kEntrySize; |
+ STATIC_ASSERT(kEntrySize > 0); |
+ static const int kEntryKeyIndex = 0; |
static const int kElementsStartOffset = |
kHeaderSize + kElementsStartIndex * kPointerSize; |
static const int kCapacityOffset = |
@@ -3552,15 +3554,16 @@ class BaseDictionaryShape : public BaseShape<Key> { |
static inline PropertyDetails DetailsAt(Dictionary* dict, int entry) { |
STATIC_ASSERT(Dictionary::kEntrySize == 3); |
DCHECK(entry >= 0); // Not found is -1, which is not caught by get(). |
- return PropertyDetails( |
- Smi::cast(dict->get(Dictionary::EntryToIndex(entry) + 2))); |
+ return PropertyDetails(Smi::cast(dict->get( |
+ Dictionary::EntryToIndex(entry) + Dictionary::kEntryDetailsIndex))); |
} |
template <typename Dictionary> |
static inline void DetailsAtPut(Dictionary* dict, int entry, |
PropertyDetails value) { |
STATIC_ASSERT(Dictionary::kEntrySize == 3); |
- dict->set(Dictionary::EntryToIndex(entry) + 2, value.AsSmi()); |
+ dict->set(Dictionary::EntryToIndex(entry) + Dictionary::kEntryDetailsIndex, |
+ value.AsSmi()); |
} |
template <typename Dictionary> |
@@ -3582,6 +3585,8 @@ class NameDictionaryShape : public BaseDictionaryShape<Handle<Name> > { |
static inline Handle<Object> AsHandle(Isolate* isolate, Handle<Name> key); |
static const int kPrefixSize = 2; |
static const int kEntrySize = 3; |
+ static const int kEntryValueIndex = 1; |
+ static const int kEntryDetailsIndex = 2; |
static const bool kIsEnumerable = true; |
}; |
@@ -3596,6 +3601,9 @@ class NameDictionary |
inline static Handle<FixedArray> DoGenerateNewEnumerationIndices( |
Handle<NameDictionary> dictionary); |
+ |
+ static const int kEntryValueIndex = 1; |
+ static const int kEntryDetailsIndex = 2; |
}; |
@@ -3623,6 +3631,8 @@ class GlobalDictionary |
: public NameDictionaryBase<GlobalDictionary, GlobalDictionaryShape> { |
public: |
DECLARE_CAST(GlobalDictionary) |
+ |
+ static const int kEntryValueIndex = 1; |
}; |
@@ -3696,6 +3706,9 @@ class SeededNumberDictionary |
// requires_slow_elements returns false. |
inline uint32_t max_number_key(); |
+ static const int kEntryValueIndex = 1; |
+ static const int kEntryDetailsIndex = 2; |
+ |
// Bit masks. |
static const int kRequiresSlowElementsMask = 1; |
static const int kRequiresSlowElementsTagSize = 1; |
@@ -3726,6 +3739,9 @@ class UnseededNumberDictionary |
Handle<UnseededNumberDictionary> dictionary, |
uint32_t key, |
Handle<Object> value); |
+ |
+ static const int kEntryValueIndex = 1; |
+ static const int kEntryDetailsIndex = 2; |
}; |