v8/test
Benedikt Meurer 75629d5f9a [turbofan] Skip arguments adaptor when target cannot observe arguments.
When calling a known function from optimized code, where the number of
actual arguments does not match the number of expected arguments,
TurboFan has to call indirectly via the arguments adaptor trampoline,
which creates an argument adaptor frame underneath the activation record
for the callee. This is done so that the callee can still get to the
actual arguments, using either

1. the arguments object, or
2. rest parameters (to get to superfluous arguments), or
3. the non-standard Function.arguments accessor (for sloppy mode
   functions), or
4. direct eval(), where we don't know whether there's a use of the
   arguments object hiding somewhere in the string.

However going through the arguments adaptor trampoline is quite
expensive usually, it seems to be responsible for over 60% of the
call overhead in those cases.

So this adds a fast path for the case of calling strict mode functions
where we have an arguments mismatch, but where we are sure that the
callee cannot observe the actual arguments. We use a bit on the
SharedFunctionInfo to indicate that this is safe, which is controlled
by hints from the Parser which knows whether the callee uses either
arguments object or rest parameters.

In those cases we use a direct call from optimized code, passing the
expected arguments instead of the actual arguments. This improves the
benchmark on the document below by around 60-65%, which is exactly
the overhead of the arguments adaptor trampoline that we save in this
case.

This also adds a runtime flag --fast_calls_with_arguments_mismatches,
which can be used to turn off the new behavior. This might be handy
for checking the performance impact via Finch.

Bug: v8:8895
Change-Id: Idea51dba7ee6cb989e86e0742eaf3516e5afe3c4
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Doc: http://bit.ly/v8-faster-calls-with-arguments-mismatch
Reviewed-on: https://chromium-review.googlesource.com/c/1482735
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59825}
2019-02-25 12:47:36 +00:00
..
benchmarks Revert "Preparing v8 to use with python3 /test" 2019-02-20 10:20:59 +00:00
cctest [turbofan] Skip arguments adaptor when target cannot observe arguments. 2019-02-25 12:47:36 +00:00
common Reland "[wasm] add wasm atomic wait callback test" 2019-02-20 05:17:07 +00:00
debugger [test] Explicitly add --turbo-inlining to tests that require it 2019-02-19 19:30:30 +00:00
fuzzer Reland "Reland "[test] refactor testsuite configuration"" 2019-02-06 09:02:09 +00:00
inspector [inspector] Do not leak Handles from V8InspectorSession methods 2019-02-25 10:17:11 +00:00
intl [regexp] Remove internal match and replace methods 2019-02-19 14:21:31 +00:00
js-perf-test [test] Add perf test for in operator on arrays 2019-02-20 22:36:13 +00:00
memory [snapshot] Remove the builtins snapshot 2018-10-31 10:18:28 +00:00
message [asm.js] Fix handling of bogus code after export statement. 2019-02-21 14:37:37 +00:00
mjsunit [turbofan] Skip arguments adaptor when target cannot observe arguments. 2019-02-25 12:47:36 +00:00
mkgrokdump [cleanup] #include heap-inl.h less often 2019-02-15 06:22:53 +00:00
mozilla Revert "Preparing v8 to use with python3 /test" 2019-02-20 10:20:59 +00:00
preparser Revert "Preparing v8 to use with python3 /test" 2019-02-20 10:20:59 +00:00
test262 Update V8 DEPS. 2019-02-22 10:07:13 +00:00
torque [torque] make overload resolution robust concerning branching contexts 2019-02-15 10:04:36 +00:00
unittests [heap] Simplify idle notification handler 2019-02-21 12:25:52 +00:00
wasm-js Reland "Reland "[test] refactor testsuite configuration"" 2019-02-06 09:02:09 +00:00
wasm-spec-tests Reland "Reland "[test] refactor testsuite configuration"" 2019-02-06 09:02:09 +00:00
webkit Reland "Reland "[test] refactor testsuite configuration"" 2019-02-06 09:02:09 +00:00
BUILD.gn Add target for common test headers 2019-02-12 09:30:01 +00:00
OWNERS Make tmrts an infra OWNER 2019-02-15 09:02:24 +00:00