Chromium Code Reviews| Index: src/objects.h |
| diff --git a/src/objects.h b/src/objects.h |
| index 8203b36a97f1dee7ef9c14a2cf413ae2c370c7e4..589e4db1b30f402f0ceee7f15fe36ac185f22a1a 100644 |
| --- a/src/objects.h |
| +++ b/src/objects.h |
| @@ -3168,13 +3168,13 @@ class ConstantPoolArray: public HeapObject { |
| // get_extended_section_header_offset(). |
| static const int kExtendedInt64CountOffset = 0; |
| static const int kExtendedCodePtrCountOffset = |
| - kExtendedInt64CountOffset + kPointerSize; |
| + kExtendedInt64CountOffset + kInt32Size; |
|
Sven Panne
2014/09/16 10:48:40
I think that this is wrong: We access this via REA
rmcilroy
2014/09/18 10:54:44
Yeah I agree - Andrew - could you change the acces
andrew_low
2014/09/22 17:49:18
Done.
|
| static const int kExtendedHeapPtrCountOffset = |
| - kExtendedCodePtrCountOffset + kPointerSize; |
| + kExtendedCodePtrCountOffset + kInt32Size; |
| static const int kExtendedInt32CountOffset = |
| - kExtendedHeapPtrCountOffset + kPointerSize; |
| + kExtendedHeapPtrCountOffset + kInt32Size; |
| static const int kExtendedFirstOffset = |
| - kExtendedInt32CountOffset + kPointerSize; |
| + kExtendedInt32CountOffset + kInt32Size; |
| // Dispatched behavior. |
| void ConstantPoolIterateBody(ObjectVisitor* v); |
| @@ -5682,7 +5682,7 @@ class Code: public HeapObject { |
| static const int kPrologueOffset = kKindSpecificFlags2Offset + kIntSize; |
| static const int kConstantPoolOffset = kPrologueOffset + kPointerSize; |
| - static const int kHeaderPaddingStart = kConstantPoolOffset + kIntSize; |
| + static const int kHeaderPaddingStart = kConstantPoolOffset + kPointerSize; |
| // Add padding to align the instruction start following right after |
| // the Code object header. |
| @@ -7252,10 +7252,11 @@ class SharedFunctionInfo: public HeapObject { |
| // garbage collections. |
| // To avoid wasting space on 64-bit architectures we use |
| // the following trick: we group integer fields into pairs |
| - // First integer in each pair is shifted left by 1. |
| - // By doing this we guarantee that LSB of each kPointerSize aligned |
| - // word is not set and thus this word cannot be treated as pointer |
| - // to HeapObject during old space traversal. |
| +// The least significant integer in each pair is shifted left by 1. |
| +// By doing this we guarantee that LSB of each kPointerSize aligned |
| +// word is not set and thus this word cannot be treated as pointer |
| +// to HeapObject during old space traversal. |
| +#if V8_TARGET_LITTLE_ENDIAN |
| static const int kLengthOffset = |
| kFeedbackVectorOffset + kPointerSize; |
| static const int kFormalParameterCountOffset = |
| @@ -7289,7 +7290,37 @@ class SharedFunctionInfo: public HeapObject { |
| // Total size. |
| static const int kSize = kProfilerTicksOffset + kIntSize; |
| -#endif |
| +#elif V8_TARGET_BIG_ENDIAN |
|
Sven Panne
2014/09/16 10:48:40
This is very fragile: At least we have to cross-re
andrew_low
2014/09/22 17:49:18
It's not clear what you're suggesting should be do
|
| + static const int kFormalParameterCountOffset = |
| + kFeedbackVectorOffset + kPointerSize; |
| + static const int kLengthOffset = kFormalParameterCountOffset + kIntSize; |
| + |
| + static const int kNumLiteralsOffset = kLengthOffset + kIntSize; |
| + static const int kExpectedNofPropertiesOffset = kNumLiteralsOffset + kIntSize; |
| + |
| + static const int kStartPositionAndTypeOffset = |
| + kExpectedNofPropertiesOffset + kIntSize; |
| + static const int kEndPositionOffset = kStartPositionAndTypeOffset + kIntSize; |
| + |
| + static const int kCompilerHintsOffset = kEndPositionOffset + kIntSize; |
| + static const int kFunctionTokenPositionOffset = |
| + kCompilerHintsOffset + kIntSize; |
| + |
| + static const int kCountersOffset = kFunctionTokenPositionOffset + kIntSize; |
| + static const int kOptCountAndBailoutReasonOffset = kCountersOffset + kIntSize; |
| + |
| + static const int kProfilerTicksOffset = |
| + kOptCountAndBailoutReasonOffset + kIntSize; |
| + static const int kAstNodeCountOffset = kProfilerTicksOffset + kIntSize; |
| + |
| + // Total size. |
| + static const int kSize = kAstNodeCountOffset + kIntSize; |
| + |
| +#else |
| +#error Unknown byte ordering |
| +#endif // Big endian |
| +#endif // 64-bit |
| + |
| static const int kAlignedSize = POINTER_SIZE_ALIGN(kSize); |
| @@ -8812,8 +8843,13 @@ class Name: public HeapObject { |
| DECLARE_PRINTER(Name) |
| // Layout description. |
| - static const int kHashFieldOffset = HeapObject::kHeaderSize; |
| - static const int kSize = kHashFieldOffset + kPointerSize; |
| + static const int kHashFieldSlot = HeapObject::kHeaderSize; |
| +#if V8_TARGET_LITTLE_ENDIAN || !V8_HOST_ARCH_64_BIT |
| + static const int kHashFieldOffset = kHashFieldSlot; |
| +#else |
| + static const int kHashFieldOffset = kHashFieldSlot + kIntSize; |
| +#endif |
| + static const int kSize = kHashFieldSlot + kPointerSize; |
| // Mask constant for checking if a name has a computed hash code |
| // and if it is a string that is an array index. The least significant bit |