• Z Nguyen-Huu's avatar
    Reland "Improve NumberToString when cache miss and Smi" · 22874998
    Z Nguyen-Huu authored
    This is a reland of 1b35c0fa
    
    Reason for revert: Seems to reliably break a numerics test:
    https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20debug/31516
    
    It was really slow and timeout with debug build run this test
    mjsunit/math-exp-precision with --optimize-for-size because we resize
    cache in CSA. Default this to runtime would avoid the timeout.
    
    Also with --optimize-for-size, we don't have enough space to allocate
    full-size cache so avoid to resize cache in this case.
    
    In my local PC, time for this test decreases as follows.
    Before: 52s
    After: 3s
    
    Original change's description:
    > Improve NumberToString when cache miss and Smi
    >
    > Cache miss was handled in runtime before. This change add fast path for
    > Smi in this case.
    >
    > Perf show 30% improvement for the following example.
    > Before 67 ms
    > After 42 ms
    >
    > const start = new Date();
    > const MAX = 1000000;
    > for (var i = 0; i < MAX; i++) {
    >     i.toString();
    > }
    > const end = new Date();
    > console.log("Time :"+ (end-start));
    >
    > Change-Id: I162e9c35f58551ca6a5a0efe79fb7c7b482a8594
    > Bug: v8:10477
    > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2332866
    > Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
    > Reviewed-by: Jakob Gruber <jgruber@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#69362}
    
    Bug: v8:10477
    Change-Id: I892a9007210032640d0bf22e61c8e7ad1a4377c4
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2351398Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
    Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
    Commit-Queue: Leszek Swirski <leszeks@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#69413}
    22874998
code-stub-assembler.cc 500 KB