v8/test
Georg Neis 90a2430388 Optimize JSCallWithArrayLike with diamond speculation when probable arguments list is empty literal array
The JSCallWithArraylike can be replaced with a JSCall if its probable arguments list is empty literal array. This replacement will introduce a deoptimization check to make sure the length of arguments list is 0 at runtime.

This CL change this optimization to a diamond speculation which may help avoid deoptimization once and keep the fast path. This change may benefit a following usecase,

function calcMax(testArray) {
     Array.max = function(array) {
         return Math.max.apply(Math, array);
     };

     var result = [];
     for (var i = 0; i < testArray.length - 3; i++) {
         var positiveNumbers = [];
         for (var j = 0; j < 3; j++) {
             if (testArray[i + j] > 0) {
                 positiveNumbers.push(testArray[i + j]);
             }
         }
         result.push(Array.max(positiveNumbers));
     }
     return result;
 }

 testArray = [-1, 2, 3, -4, -5, -6, -7, -8, -9, 10];

 for (var i = 0; i < 1000000; i++) {
     calcMax(testArray);
 }

Bug: v8:9974
Change-Id: I595627e2fd937527350c8f8652d701c791b41dd3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2967757
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75636}
2021-07-08 11:38:58 +00:00
..
benchmarks [test] Mark kraken/audio SLOW only on TSAN 2021-06-30 15:21:55 +00:00
bigint [bigint] Toom-Cook multiplication 2021-07-07 10:12:26 +00:00
cctest [wasm] Disable trap handling for memory64 2021-07-08 11:03:08 +00:00
common [wasm][fuzzer] Choose more interesting default parameters 2021-07-07 17:23:50 +00:00
debugger Revert "Reland "Reland "Improve error messages for property access on null/undefined""" 2021-07-08 07:50:18 +00:00
debugging [d8][mjsunit][tools] Improve d8 file API 2021-06-01 13:37:57 +00:00
fuzzer [wasm][fuzzer] Allow Liftoff as a reference tier 2021-07-08 11:06:57 +00:00
fuzzilli
inspector [inspector] Add throwOnSideEffect to Runtime.callFunctionOn. 2021-07-05 12:53:07 +00:00
intl [intl] Skip intl test on Android 2021-06-24 13:15:53 +00:00
js-perf-test A jump-table implementation for constant case switch statements 2021-06-23 09:26:23 +00:00
memory [snapshot] Fix the Memory.json benchmark 2021-04-28 07:54:34 +00:00
message Revert "Reland "Reland "Improve error messages for property access on null/undefined""" 2021-07-08 07:50:18 +00:00
mjsunit Optimize JSCallWithArrayLike with diamond speculation when probable arguments list is empty literal array 2021-07-08 11:38:58 +00:00
mkgrokdump [build] Fold v8_wrappers into v8_libbase 2021-02-25 10:56:20 +00:00
mozilla Reland "[test] Unmark TSAN tests as SLOW/SKIP" 2021-06-28 10:19:20 +00:00
test262 [test262] Roll test262 2021-06-29 07:35:31 +00:00
torque [torque] Add LazyNode support 2021-02-23 16:51:53 +00:00
unittests [wasm-gc] Experiment: allow non-nullable locals 2021-07-07 15:41:01 +00:00
wasm-api-tests [wasm] Make --wasm-trap-handler a d8-only flag 2021-06-30 09:32:55 +00:00
wasm-js [wasm] Update spec tests 2021-06-07 11:45:44 +00:00
wasm-spec-tests Reland "[test] Unmark TSAN tests as SLOW/SKIP" 2021-06-28 10:19:20 +00:00
webkit Revert "Reland "Reland "Improve error messages for property access on null/undefined""" 2021-07-08 07:50:18 +00:00
BUILD.gn Reland^2 "[bigint] Karatsuba multiplication" 2021-06-07 11:01:14 +00:00
OWNERS