Commit 6cd16f02 authored by Shu-yu Guo's avatar Shu-yu Guo Committed by V8 LUCI CQ

[change-array-by-copy] Split out slow toReversed test

Bug: v8:13328, v8:12764
Change-Id: Idd079b6eaa7e47b0cbe57840e9cd185c2abfe7dd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913771Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83440}
parent 890ee74c
// Copyright 2022 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-change-array-by-copy
(function TestBigPacked() {
let a = [];
for (let i = 0; i < 50000; i++) a.push(i);
let r = a.toReversed();
for (let i = 0; i < 50000; i++) {
assertEquals(r[i], a.at(-(i+1)));
}
})();
......@@ -61,15 +61,6 @@ assertEquals("toReversed", Array.prototype.toReversed.name);
assertEquals([], [].toReversed());
})();
(function TestBig() {
let a = [];
for (let i = 0; i < 50000; i++) a.push(i);
let r = a.toReversed();
for (let i = 0; i < 50000; i++) {
assertEquals(r[i], a.at(-(i+1)));
}
})();
(function TestTooBig() {
let a = { length: Math.pow(2, 32) };
assertThrows(() => Array.prototype.toReversed.call(a), RangeError);
......
......@@ -1413,6 +1413,10 @@
# it. In the slow path, this results in one runtime call per element, which
# takes several minutes overall.
'regress/wasm/regress-9017': [SKIP],
# This tests Array#toReversed on a big packed array, which is created by
# repeated calls to Array#push. In the slow path this is very slow.
'harmony/array-to-reversed-big': [SKIP],
}], # variant == slow_path
['((arch == mips64el or arch == mips64) and not simd_mips) or (arch in [ppc64])', {
......
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