[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/897494 Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Commit-Queue: Pierre Langlois <pierre.langlois@arm.com> Cr-Commit-Position: refs/heads/master@{#51092}
This commit is contained in:
parent
23dd8ef207
commit
20a83e4ff0
@ -3692,8 +3692,9 @@ Node* EffectControlLinearizer::LowerLoadTypedElement(Node* node) {
|
|||||||
// Compute the effective storage pointer, handling the case where the
|
// Compute the effective storage pointer, handling the case where the
|
||||||
// {external} pointer is the effective storage pointer (i.e. the {base}
|
// {external} pointer is the effective storage pointer (i.e. the {base}
|
||||||
// is Smi zero).
|
// is Smi zero).
|
||||||
Node* storage = NumberMatcher(base).Is(0) ? external : __ UnsafePointerAdd(
|
Node* storage = IntPtrMatcher(base).Is(0)
|
||||||
base, external);
|
? external
|
||||||
|
: __ UnsafePointerAdd(base, external);
|
||||||
|
|
||||||
// Perform the actual typed element access.
|
// Perform the actual typed element access.
|
||||||
return __ LoadElement(AccessBuilder::ForTypedArrayElement(array_type, true),
|
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
|
// Compute the effective storage pointer, handling the case where the
|
||||||
// {external} pointer is the effective storage pointer (i.e. the {base}
|
// {external} pointer is the effective storage pointer (i.e. the {base}
|
||||||
// is Smi zero).
|
// is Smi zero).
|
||||||
Node* storage = NumberMatcher(base).Is(0) ? external : __ UnsafePointerAdd(
|
Node* storage = IntPtrMatcher(base).Is(0)
|
||||||
base, external);
|
? external
|
||||||
|
: __ UnsafePointerAdd(base, external);
|
||||||
|
|
||||||
// Perform the actual typed element access.
|
// Perform the actual typed element access.
|
||||||
__ StoreElement(AccessBuilder::ForTypedArrayElement(array_type, true),
|
__ StoreElement(AccessBuilder::ForTypedArrayElement(array_type, true),
|
||||||
|
Loading…
Reference in New Issue
Block a user