Use type feedback to improve exponentiation.
With this change, we use Float64Pow for both Smi and Float inputs, also introduce new speculative operator. For this PoC ========================================================== let result = [NaN]; // Avoid HeapNumber-boxing the results. function slow(){ for(let i = 0; i < 100000000; i++) { result[0] = i ** 2; } } start = Date.now(); slow(); console.log(Date.now() - start); ========================================================== Before: 1313 After: 112 Bug: v8:11731 Change-Id: I07a1bde068bef8184b9f556be9d1fe2d6a288705 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2960064 Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Reviewed-by: Georg Neis <neis@chromium.org> Cr-Commit-Position: refs/heads/master@{#75590}
Showing
Please
register
or
sign in
to comment