Commit 27040aac authored by Simon Zünd's avatar Simon Zünd Committed by Commit Bot

[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/1188122Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Simon Zünd <szuend@google.com>
Cr-Commit-Position: refs/heads/master@{#55371}
parent 20f8e28e
......@@ -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);
......
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