Commit 769be761 authored by Daniel Clifford's avatar Daniel Clifford Committed by Commit Bot

Reland "Fix Array.prototype.sort speed regression"

This is a reland of c88994f8

Turned out to not be the issue.

Original change's description:
> Fix Array.prototype.sort speed regression
>
> CanUseSameAccessor<ElementsAccessor: type> is array-sort.tq is super
> performance-critical. Reverting the type-safe cleanup made in this
> function while landing Array.prototype.slice.
>
> Bug=chromium:852764
>
> Change-Id: I1252d2ff8e431581f916794807e59abb39248abb
> Reviewed-on: https://chromium-review.googlesource.com/c/1317815
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Commit-Queue: Daniel Clifford <danno@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#57248}

TBR=danno@chromium.org

Change-Id: I627a131a8525ae4e131c6467561cab9832f3792f
Reviewed-on: https://chromium-review.googlesource.com/c/1319581Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57270}
parent 9e83f1f2
...@@ -325,12 +325,12 @@ module array { ...@@ -325,12 +325,12 @@ module array {
builtin CanUseSameAccessor<ElementsAccessor: type>( builtin CanUseSameAccessor<ElementsAccessor: type>(
context: Context, receiver: JSReceiver, initialReceiverMap: Object, context: Context, receiver: JSReceiver, initialReceiverMap: Object,
initialReceiverLength: Number): Boolean { initialReceiverLength: Number): Boolean {
const a: JSArray = Cast<JSArray>(receiver) otherwise unreachable; const a: JSArray = UnsafeCast<JSArray>(receiver);
if (a.map != initialReceiverMap) return False; if (a.map != initialReceiverMap) return False;
assert(TaggedIsSmi(initialReceiverLength)); assert(TaggedIsSmi(initialReceiverLength));
let originalLength: Smi = UnsafeCast<Smi>(initialReceiverLength); let originalLength: Smi = UnsafeCast<Smi>(initialReceiverLength);
if (a.length != originalLength) return False; if (UnsafeCast<Smi>(a.length) != originalLength) return False;
return True; return 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