[bigint,compiler] Fix endianness issue in bitfield access.

See https://chromium-review.googlesource.com/c/v8/v8/+/904725.

Change-Id: I6b017c0a8d1c521a83e0c6b5315e1c9689bb4f19
Bug: v8:6791
Reviewed-on: https://chromium-review.googlesource.com/906422
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51140}
This commit is contained in:
Georg Neis 2018-02-07 10:55:40 +01:00 committed by Commit Bot
parent a2aac98ddf
commit f4e42f9d31
2 changed files with 4 additions and 4 deletions

View File

@ -56,7 +56,7 @@ FieldAccess AccessBuilder::ForHeapNumberValue() {
FieldAccess AccessBuilder::ForBigIntBitfield() {
FieldAccess access = {
kTaggedBase, BigInt::kBitfieldOffset, MaybeHandle<Name>(),
MaybeHandle<Map>(), TypeCache::Get().kInt32, MachineType::Int32(),
MaybeHandle<Map>(), TypeCache::Get().kInt32, MachineType::IntPtr(),
kNoWriteBarrier};
return access;
}

View File

@ -1175,9 +1175,9 @@ void EffectControlLinearizer::TruncateTaggedPointerToBit(
__ Bind(&if_bigint);
{
Node* bitfield = __ LoadField(AccessBuilder::ForBigIntBitfield(), value);
Node* length_is_zero = __ Word32Equal(
__ Word32And(bitfield, __ Int32Constant(BigInt::LengthBits::kMask)),
zero);
Node* length_is_zero = __ WordEqual(
__ WordAnd(bitfield, __ IntPtrConstant(BigInt::LengthBits::kMask)),
__ IntPtrConstant(0));
__ Goto(done, __ Word32Equal(length_is_zero, zero));
}
}