Commit 20a83e4f authored by Pierre Langlois's avatar Pierre Langlois Committed by Commit Bot

[turbofan] Remove UnsafePointerAdd operation in TypedArray accesses.

A previous CL lowered NumberConstant nodes into IntPtrConstant nodes during
simplified lowering. It inadvertently disabled an optimization in TypeArray
accesses that relied on matching NumberConstant(0).

Bug: chromium:806727
Change-Id: If1938af057be66dea8edc588cc048a01410ca0ad
Reviewed-on: https://chromium-review.googlesource.com/897494Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
Cr-Commit-Position: refs/heads/master@{#51092}
parent 23dd8ef2
......@@ -3692,8 +3692,9 @@ Node* EffectControlLinearizer::LowerLoadTypedElement(Node* node) {
// Compute the effective storage pointer, handling the case where the
// {external} pointer is the effective storage pointer (i.e. the {base}
// is Smi zero).
Node* storage = NumberMatcher(base).Is(0) ? external : __ UnsafePointerAdd(
base, external);
Node* storage = IntPtrMatcher(base).Is(0)
? external
: __ UnsafePointerAdd(base, external);
// Perform the actual typed element access.
return __ LoadElement(AccessBuilder::ForTypedArrayElement(array_type, true),
......@@ -3715,8 +3716,9 @@ void EffectControlLinearizer::LowerStoreTypedElement(Node* node) {
// Compute the effective storage pointer, handling the case where the
// {external} pointer is the effective storage pointer (i.e. the {base}
// is Smi zero).
Node* storage = NumberMatcher(base).Is(0) ? external : __ UnsafePointerAdd(
base, external);
Node* storage = IntPtrMatcher(base).Is(0)
? external
: __ UnsafePointerAdd(base, external);
// Perform the actual typed element access.
__ StoreElement(AccessBuilder::ForTypedArrayElement(array_type, true),
......
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