[csa] Fix initialization of Name::kHashFieldSlot

On 64-bit architectures, an IntPtr-sized write of Name::kEmptyHashField
will properly initialize the relevant Int32-sized payload of
Name::kHashFieldOffset, as well as zero out the unused portion of the
slot.

Bug: v8:7065
Change-Id: I93113c9744377e76cd0d264568c49b31a1e822a1
Reviewed-on: https://chromium-review.googlesource.com/788530
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49668}
This commit is contained in:
Junliang Yan 2017-11-26 09:39:33 -05:00 committed by Commit Bot
parent 64030c6b56
commit d949c2b673

View File

@ -2128,7 +2128,7 @@ Node* CodeStubAssembler::AllocateSeqOneByteString(int length,
StoreObjectFieldNoWriteBarrier(result, SeqOneByteString::kLengthOffset,
SmiConstant(length),
MachineRepresentation::kTagged);
StoreObjectFieldNoWriteBarrier(result, SeqOneByteString::kHashFieldOffset,
StoreObjectFieldNoWriteBarrier(result, SeqOneByteString::kHashFieldSlot,
IntPtrConstant(String::kEmptyHashField),
MachineType::PointerRepresentation());
return result;
@ -2175,7 +2175,7 @@ Node* CodeStubAssembler::AllocateSeqOneByteString(Node* context,
StoreMapNoWriteBarrier(result, Heap::kOneByteStringMapRootIndex);
StoreObjectFieldNoWriteBarrier(result, SeqOneByteString::kLengthOffset,
length, MachineRepresentation::kTagged);
StoreObjectFieldNoWriteBarrier(result, SeqOneByteString::kHashFieldOffset,
StoreObjectFieldNoWriteBarrier(result, SeqOneByteString::kHashFieldSlot,
IntPtrConstant(String::kEmptyHashField),
MachineType::PointerRepresentation());
var_result.Bind(result);
@ -2213,7 +2213,7 @@ Node* CodeStubAssembler::AllocateSeqTwoByteString(int length,
StoreObjectFieldNoWriteBarrier(result, SeqTwoByteString::kLengthOffset,
SmiConstant(Smi::FromInt(length)),
MachineRepresentation::kTagged);
StoreObjectFieldNoWriteBarrier(result, SeqTwoByteString::kHashFieldOffset,
StoreObjectFieldNoWriteBarrier(result, SeqTwoByteString::kHashFieldSlot,
IntPtrConstant(String::kEmptyHashField),
MachineType::PointerRepresentation());
return result;
@ -2246,7 +2246,7 @@ Node* CodeStubAssembler::AllocateSeqTwoByteString(Node* context,
StoreMapNoWriteBarrier(result, Heap::kStringMapRootIndex);
StoreObjectFieldNoWriteBarrier(result, SeqTwoByteString::kLengthOffset,
length, MachineRepresentation::kTagged);
StoreObjectFieldNoWriteBarrier(result, SeqTwoByteString::kHashFieldOffset,
StoreObjectFieldNoWriteBarrier(result, SeqTwoByteString::kHashFieldSlot,
IntPtrConstant(String::kEmptyHashField),
MachineType::PointerRepresentation());
var_result.Bind(result);
@ -2282,7 +2282,7 @@ Node* CodeStubAssembler::AllocateSlicedString(
StoreMapNoWriteBarrier(result, map_root_index);
StoreObjectFieldNoWriteBarrier(result, SlicedString::kLengthOffset, length,
MachineRepresentation::kTagged);
StoreObjectFieldNoWriteBarrier(result, SlicedString::kHashFieldOffset,
StoreObjectFieldNoWriteBarrier(result, SlicedString::kHashFieldSlot,
IntPtrConstant(String::kEmptyHashField),
MachineType::PointerRepresentation());
StoreObjectFieldNoWriteBarrier(result, SlicedString::kParentOffset, parent,
@ -2317,7 +2317,7 @@ Node* CodeStubAssembler::AllocateConsString(Heap::RootListIndex map_root_index,
StoreMapNoWriteBarrier(result, map_root_index);
StoreObjectFieldNoWriteBarrier(result, ConsString::kLengthOffset, length,
MachineRepresentation::kTagged);
StoreObjectFieldNoWriteBarrier(result, ConsString::kHashFieldOffset,
StoreObjectFieldNoWriteBarrier(result, ConsString::kHashFieldSlot,
IntPtrConstant(String::kEmptyHashField),
MachineType::PointerRepresentation());
bool const new_space = !(flags & kPretenured);