Fix JSArrayBuffer for big endian.

BUG=
R=jochen@chromium.org, dcarney@chromium.org, dstence@us.ibm.com, michael_dawson@ca.ibm.com

Review URL: https://codereview.chromium.org/1108373002

Cr-Commit-Position: refs/heads/master@{#28118}
This commit is contained in:
mbrandy 2015-04-28 13:00:44 -07:00 committed by Commit bot
parent 29bee1604f
commit f76fd06d11
2 changed files with 12 additions and 3 deletions

View File

@ -6428,7 +6428,11 @@ ACCESSORS(JSArrayBuffer, byte_length, Object, kByteLengthOffset)
void JSArrayBuffer::set_bit_field(uint32_t bits) { void JSArrayBuffer::set_bit_field(uint32_t bits) {
if (kInt32Size != kPointerSize) { 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); WRITE_UINT32_FIELD(this, kBitFieldOffset, bits);
} }

View File

@ -10268,8 +10268,13 @@ class JSArrayBuffer: public JSObject {
static const int kBackingStoreOffset = JSObject::kHeaderSize; static const int kBackingStoreOffset = JSObject::kHeaderSize;
static const int kByteLengthOffset = kBackingStoreOffset + kPointerSize; static const int kByteLengthOffset = kBackingStoreOffset + kPointerSize;
static const int kBitFieldOffset = kByteLengthOffset + kPointerSize; static const int kBitFieldSlot = kByteLengthOffset + kPointerSize;
static const int kWeakNextOffset = kBitFieldOffset + 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 kSize = kWeakNextOffset + kPointerSize;
static const int kSizeWithInternalFields = static const int kSizeWithInternalFields =