[turbofan] Properly zero-extend indices on 64-bit architectures.

This was an oversight from the previous CL. It doesn't really matter
with the current code generation pattern, since the upper bits of the
index will always be zero, but that might change in the future.

Bug: chromium:225811
Change-Id: I568a0824cad9ce9b73a56decc15d146c7dc675a1
Reviewed-on: https://chromium-review.googlesource.com/1174111
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55104}
This commit is contained in:
Benedikt Meurer 2018-08-14 09:03:08 +02:00 committed by Commit Bot
parent f4b76a13ae
commit 6c7c81e07c

View File

@ -3812,6 +3812,12 @@ Node* EffectControlLinearizer::LowerLoadDataViewElement(Node* node) {
Node* index = node->InputAt(2);
Node* is_little_endian = node->InputAt(3);
// On 64-bit platforms, we need to feed a Word64 index to the Load and
// Store operators.
if (machine()->Is64()) {
index = __ ChangeUint32ToUint64(index);
}
// We need to keep the {buffer} alive so that the GC will not release the
// ArrayBuffer (if there's any) as long as we are still operating on it.
__ Retain(buffer);
@ -3854,6 +3860,12 @@ void EffectControlLinearizer::LowerStoreDataViewElement(Node* node) {
Node* value = node->InputAt(3);
Node* is_little_endian = node->InputAt(4);
// On 64-bit platforms, we need to feed a Word64 index to the Load and
// Store operators.
if (machine()->Is64()) {
index = __ ChangeUint32ToUint64(index);
}
// We need to keep the {buffer} alive so that the GC will not release the
// ArrayBuffer (if there's any) as long as we are still operating on it.
__ Retain(buffer);