diff --git a/src/objects-inl.h b/src/objects-inl.h index 3384619631..61dfa44a3f 100644 --- a/src/objects-inl.h +++ b/src/objects-inl.h @@ -6428,7 +6428,11 @@ ACCESSORS(JSArrayBuffer, byte_length, Object, kByteLengthOffset) void JSArrayBuffer::set_bit_field(uint32_t bits) { if (kInt32Size != kPointerSize) { - WRITE_UINT32_FIELD(this, kBitFieldOffset + kInt32Size, 0); +#if V8_TARGET_LITTLE_ENDIAN + WRITE_UINT32_FIELD(this, kBitFieldSlot + kInt32Size, 0); +#else + WRITE_UINT32_FIELD(this, kBitFieldSlot, 0); +#endif } WRITE_UINT32_FIELD(this, kBitFieldOffset, bits); } diff --git a/src/objects.h b/src/objects.h index f09e893f08..bcd426e1fa 100644 --- a/src/objects.h +++ b/src/objects.h @@ -10268,8 +10268,13 @@ class JSArrayBuffer: public JSObject { static const int kBackingStoreOffset = JSObject::kHeaderSize; static const int kByteLengthOffset = kBackingStoreOffset + kPointerSize; - static const int kBitFieldOffset = kByteLengthOffset + kPointerSize; - static const int kWeakNextOffset = kBitFieldOffset + kPointerSize; + static const int kBitFieldSlot = kByteLengthOffset + kPointerSize; +#if V8_TARGET_LITTLE_ENDIAN || !V8_HOST_ARCH_64_BIT + static const int kBitFieldOffset = kBitFieldSlot; +#else + static const int kBitFieldOffset = kBitFieldSlot + kIntSize; +#endif + static const int kWeakNextOffset = kBitFieldSlot + kPointerSize; static const int kSize = kWeakNextOffset + kPointerSize; static const int kSizeWithInternalFields =