[mjsunit] Fixing two test flakes due to unexpected deopts

(at least hoping to).

Bug: v8:12486, v8:13354
Change-Id: I5bd9fedde5369b5644a4e9ab36e103902ee5b2b9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3964273
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83802}
This commit is contained in:
Nico Hartmann 2022-10-19 15:37:03 +02:00 committed by V8 LUCI CQ
parent 93f3f3369e
commit c437ecdf21
2 changed files with 4 additions and 0 deletions

View File

@ -27,6 +27,8 @@ if(%Is64Bit()) {
// The next time the function is optimized, speculation should be disabled
// so the builtin call is kept, which won't deoptimize again.
%PrepareFunctionForOptimization(f);
assertEquals(-1n, f(7n));
assertEquals(1n, f(9n));
%OptimizeFunctionOnNextCall(f);
}
assertEquals(-1n, f(7n));

View File

@ -27,6 +27,8 @@ if(%Is64Bit()) {
// The next time the function is optimized, speculation should be disabled
// so the builtin call is kept, which won't deoptimize again.
%PrepareFunctionForOptimization(f);
assertEquals(7n, f(7n));
assertEquals(1n, f(9n));
%OptimizeFunctionOnNextCall(f);
}
assertEquals(7n, f(7n));