Commit 6c7c81e0 authored by Benedikt Meurer's avatar Benedikt Meurer Committed by Commit Bot

[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: 's avatarJaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55104}
parent f4b76a13
......@@ -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);
......
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