[jstest] Fix ElementsKind of the array that gets sorted

This CL fixes the "sort-lengths" benchmark so the ElementsKind of the
array to sort is PACKED_SMI again. This was somehow broken.

R=jgruber@chromium.org

Change-Id: I129e001eae4c88e9f99174b3494193232d933c3f
Reviewed-on: https://chromium-review.googlesource.com/1188122
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Simon Zünd <szuend@google.com>
Cr-Commit-Position: refs/heads/master@{#55371}
This commit is contained in:
Simon Zünd 2018-08-24 08:50:32 +02:00 committed by Commit Bot
parent 20f8e28eb9
commit 27040aac02

View File

@ -9,6 +9,7 @@ function SortAsc() {
}
function Random(length) {
array_to_sort = [];
for (let i = 0; i < length; ++i) {
array_to_sort.push(Math.floor(Math.random() * length));
}
@ -16,21 +17,16 @@ function Random(length) {
}
function Sorted(length) {
array_to_sort = [];
for (let i = 0; i < length; ++i) {
array_to_sort.push(i);
}
AssertPackedSmiElements();
}
function TearDown() {
array_to_sort = [];
}
function CreateSortSuitesForLength(length) {
createSortSuite(
'Random' + length, 1000, SortAsc, () => Random(length), TearDown);
createSortSuite(
'Sorted' + length, 1000, SortAsc, () => Sorted(length), TearDown);
createSortSuite('Random' + length, 1000, SortAsc, () => Random(length));
createSortSuite('Sorted' + length, 1000, SortAsc, () => Sorted(length));
}
CreateSortSuitesForLength(10);