[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}
This commit is contained in:
jyan 2016-06-24 11:25:44 -07:00 committed by Commit bot
parent 196a0d3a64
commit fa5e049055

View File

@ -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);
}