Index: src/objects.h |
diff --git a/src/objects.h b/src/objects.h |
index 783ed61fd37912461ff002431d19fa703f049c6b..189649836baaa79412a24d9a770b9ef9e13002ae 100644 |
--- a/src/objects.h |
+++ b/src/objects.h |
@@ -2874,10 +2874,12 @@ class FixedArray: public FixedArrayBase { |
void CopyTo(int pos, FixedArray* dest, int dest_pos, int len); |
// Garbage collection support. |
- static int SizeFor(int length) { return kHeaderSize + length * kPointerSize; } |
+ static constexpr int SizeFor(int length) { |
+ return kHeaderSize + length * kPointerSize; |
+ } |
// Code Generation support. |
- static int OffsetOfElementAt(int index) { return SizeFor(index); } |
+ static constexpr int OffsetOfElementAt(int index) { return SizeFor(index); } |
// Garbage collection support. |
inline Object** RawFieldOfElementAt(int index); |
@@ -4278,22 +4280,23 @@ class OrderedHashTable: public FixedArray { |
static const int kNotFound = -1; |
static const int kMinCapacity = 4; |
- static const int kNumberOfBucketsIndex = 0; |
- static const int kNumberOfElementsIndex = kNumberOfBucketsIndex + 1; |
- static const int kNumberOfDeletedElementsIndex = kNumberOfElementsIndex + 1; |
- static const int kHashTableStartIndex = kNumberOfDeletedElementsIndex + 1; |
+ static const int kNumberOfElementsIndex = 0; |
+ // The next table is stored at the same index as the nof elements. |
static const int kNextTableIndex = kNumberOfElementsIndex; |
- |
- static const int kNumberOfBucketsOffset = |
- kHeaderSize + kNumberOfBucketsIndex * kPointerSize; |
- static const int kNumberOfElementsOffset = |
- kHeaderSize + kNumberOfElementsIndex * kPointerSize; |
- static const int kNumberOfDeletedElementsOffset = |
- kHeaderSize + kNumberOfDeletedElementsIndex * kPointerSize; |
- static const int kHashTableStartOffset = |
- kHeaderSize + kHashTableStartIndex * kPointerSize; |
- static const int kNextTableOffset = |
- kHeaderSize + kNextTableIndex * kPointerSize; |
+ static const int kNumberOfDeletedElementsIndex = kNumberOfElementsIndex + 1; |
+ static const int kNumberOfBucketsIndex = kNumberOfDeletedElementsIndex + 1; |
+ static const int kHashTableStartIndex = kNumberOfBucketsIndex + 1; |
+ |
+ static constexpr const int kNumberOfElementsOffset = |
+ FixedArray::OffsetOfElementAt(kNumberOfElementsIndex); |
+ static constexpr const int kNextTableOffset = |
+ FixedArray::OffsetOfElementAt(kNextTableIndex); |
+ static constexpr const int kNumberOfDeletedElementsOffset = |
+ FixedArray::OffsetOfElementAt(kNumberOfDeletedElementsIndex); |
+ static constexpr const int kNumberOfBucketsOffset = |
+ FixedArray::OffsetOfElementAt(kNumberOfBucketsIndex); |
+ static constexpr const int kHashTableStartOffset = |
+ FixedArray::OffsetOfElementAt(kHashTableStartIndex); |
static const int kEntrySize = entrysize + 1; |
static const int kChainOffset = entrysize; |