Commit b0530dc9 authored by mbrandy's avatar mbrandy Committed by Commit bot

Fix hash field access for 64-bit big-endian architectures.

Need to use the kHashFieldSlot rather than kHashFieldOffset for
pointer-sized memory accesses.

(Fix for "[builtins] Migrate String.prototype.charCodeAt and String.prototype.charAt to TurboFan.")

R=bmeurer@chromium.org, epertoso@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35741}
parent f6c09c89
......@@ -609,7 +609,7 @@ Node* CodeStubAssembler::AllocateSeqOneByteString(int length) {
StoreMapNoWriteBarrier(result, LoadRoot(Heap::kOneByteStringMapRootIndex));
StoreObjectFieldNoWriteBarrier(result, SeqOneByteString::kLengthOffset,
SmiConstant(Smi::FromInt(length)));
StoreObjectFieldNoWriteBarrier(result, SeqOneByteString::kHashFieldOffset,
StoreObjectFieldNoWriteBarrier(result, SeqOneByteString::kHashFieldSlot,
IntPtrConstant(String::kEmptyHashField));
return result;
}
......@@ -619,7 +619,7 @@ Node* CodeStubAssembler::AllocateSeqTwoByteString(int length) {
StoreMapNoWriteBarrier(result, LoadRoot(Heap::kStringMapRootIndex));
StoreObjectFieldNoWriteBarrier(result, SeqTwoByteString::kLengthOffset,
SmiConstant(Smi::FromInt(length)));
StoreObjectFieldNoWriteBarrier(result, SeqTwoByteString::kHashFieldOffset,
StoreObjectFieldNoWriteBarrier(result, SeqTwoByteString::kHashFieldSlot,
IntPtrConstant(String::kEmptyHashField));
return result;
}
......
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