Commit fa5e0490 authored by jyan's avatar jyan Committed by Commit bot

[compiler] Fix turbofan string allocation

The hash field is supposed to be 4 bytes even in 64-bit. But the
default parameter of StoreObjectFieldNoWriteBarrier using kTagged
will generate 64-bit store. Fix by Replacing kTagged with kWord32.

This causes ~200 test failures on big-endian, because hash field
offset in BE is 12 instead of 8 in LE platforms.

R=bmeurer@chromium.org, epertoso@chromium.org, joransiu@ca.ibm.com, michael_dawson@ca.ibm.com, mbrandy@us.ibm.com, bjaideep@ca.ibm.com
BUG=

Review-Url: https://codereview.chromium.org/2095003003
Cr-Commit-Position: refs/heads/master@{#37256}
parent 196a0d3a
......@@ -695,7 +695,8 @@ Node* CodeStubAssembler::AllocateSeqOneByteString(int length) {
StoreObjectFieldNoWriteBarrier(result, SeqOneByteString::kLengthOffset,
SmiConstant(Smi::FromInt(length)));
StoreObjectFieldNoWriteBarrier(result, SeqOneByteString::kHashFieldOffset,
IntPtrConstant(String::kEmptyHashField));
IntPtrConstant(String::kEmptyHashField),
MachineRepresentation::kWord32);
return result;
}
......@@ -722,7 +723,8 @@ Node* CodeStubAssembler::AllocateSeqOneByteString(Node* context, Node* length) {
StoreObjectFieldNoWriteBarrier(result, SeqOneByteString::kLengthOffset,
SmiFromWord(length));
StoreObjectFieldNoWriteBarrier(result, SeqOneByteString::kHashFieldOffset,
IntPtrConstant(String::kEmptyHashField));
IntPtrConstant(String::kEmptyHashField),
MachineRepresentation::kWord32);
var_result.Bind(result);
Goto(&if_join);
}
......@@ -746,7 +748,8 @@ Node* CodeStubAssembler::AllocateSeqTwoByteString(int length) {
StoreObjectFieldNoWriteBarrier(result, SeqTwoByteString::kLengthOffset,
SmiConstant(Smi::FromInt(length)));
StoreObjectFieldNoWriteBarrier(result, SeqTwoByteString::kHashFieldOffset,
IntPtrConstant(String::kEmptyHashField));
IntPtrConstant(String::kEmptyHashField),
MachineRepresentation::kWord32);
return result;
}
......@@ -773,7 +776,8 @@ Node* CodeStubAssembler::AllocateSeqTwoByteString(Node* context, Node* length) {
StoreObjectFieldNoWriteBarrier(result, SeqTwoByteString::kLengthOffset,
SmiFromWord(length));
StoreObjectFieldNoWriteBarrier(result, SeqTwoByteString::kHashFieldOffset,
IntPtrConstant(String::kEmptyHashField));
IntPtrConstant(String::kEmptyHashField),
MachineRepresentation::kWord32);
var_result.Bind(result);
Goto(&if_join);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment