-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Original commit message: [fastcall] Disable fast calls with stack args on M1 Bug: v8:13171 Change-Id: I549d942d8ae24e2de0aa3202d7400b587254fb75 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3963995 Commit-Queue: Camillo Bruni <cbruni@chromium.org> Auto-Submit: Maya Lekova <mslekova@chromium.org> Reviewed-by: Camillo Bruni <cbruni@chromium.org> Commit-Queue: Maya Lekova <mslekova@chromium.org> Cr-Commit-Position: refs/heads/main@{#83886} Refs: v8/v8@bf0bd48 PR-URL: #45908 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
- Loading branch information
Showing
5 changed files
with
127 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright 2021 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. | ||
|
||
// This file tests fast callbacks with more than 8 arguments. It should | ||
// fail on arm64 + OSX configuration, because of stack alignment issue, | ||
// see crbug.com/v8/13171. | ||
|
||
// Flags: --turbo-fast-api-calls --expose-fast-api --allow-natives-syntax --turbofan | ||
// --always-turbofan is disabled because we rely on particular feedback for | ||
// optimizing to the fastest path. | ||
// Flags: --no-always-turbofan | ||
// The test relies on optimizing/deoptimizing at predictable moments, so | ||
// it's not suitable for deoptimization fuzzing. | ||
// Flags: --deopt-every-n-times=0 | ||
|
||
const add_all_32bit_int_arg1 = -42; | ||
const add_all_32bit_int_arg2 = 45; | ||
const add_all_32bit_int_arg3 = -12345678; | ||
const add_all_32bit_int_arg4 = 0x1fffffff; | ||
const add_all_32bit_int_arg5 = 1e6; | ||
const add_all_32bit_int_arg6 = 1e8; | ||
const add_all_32bit_int_arg7 = 31; | ||
const add_all_32bit_int_arg8 = 63; | ||
const add_all_32bit_int_result_8args = add_all_32bit_int_arg1 + | ||
add_all_32bit_int_arg2 + add_all_32bit_int_arg3 + add_all_32bit_int_arg4 + | ||
add_all_32bit_int_arg5 + add_all_32bit_int_arg6 + add_all_32bit_int_arg7 + add_all_32bit_int_arg8; | ||
|
||
const fast_c_api = new d8.test.FastCAPI(); | ||
|
||
(function () { | ||
function overloaded_add_all(should_fallback = false) { | ||
return fast_c_api.overloaded_add_all_8args(should_fallback, | ||
add_all_32bit_int_arg1, add_all_32bit_int_arg2, add_all_32bit_int_arg3, | ||
add_all_32bit_int_arg4, add_all_32bit_int_arg5, add_all_32bit_int_arg6, | ||
add_all_32bit_int_arg7, add_all_32bit_int_arg8); | ||
} | ||
|
||
%PrepareFunctionForOptimization(overloaded_add_all); | ||
let result = overloaded_add_all(); | ||
assertEquals(add_all_32bit_int_result_8args, result); | ||
|
||
fast_c_api.reset_counts(); | ||
%OptimizeFunctionOnNextCall(overloaded_add_all); | ||
result = overloaded_add_all(); | ||
assertOptimized(overloaded_add_all); | ||
|
||
assertEquals(1, fast_c_api.fast_call_count()); | ||
assertEquals(0, fast_c_api.slow_call_count()); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters