• Benedikt Meurer's avatar
    [turbofan] Don't go MEGAMORPHIC when storing oddballs to typed arrays. · e65c0b25
    Benedikt Meurer authored
    The KEYED_STORE_IC was never able to deal with stores to typed arrays
    where the value being stored is not already a Number (i.e. either a Smi
    or a HeapNumber). By extending it to also handle Oddballs (i.e. true,
    false, undefined and null) and teaching TurboFan to also perform the
    appropriate check plus the truncation to Number, we can easily support
    this use case as well.
    
    On the micro-benchmark in the bug report, we go from
    
      typedArrayStoreBool: 2975 ms.
      typedArrayStoreInt: 44 ms.
    
    to
    
      typedArrayStoreBool: 43 ms.
      typedArrayStoreInt: 44 ms.
    
    so that's roughly a 70x performance boost.
    
    Bug: chromium:287773
    Change-Id: I227419aeabc3f5b6793aa280a95448d03ac2f2dd
    Reviewed-on: https://chromium-review.googlesource.com/691731
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
    Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#48257}
    e65c0b25
code-stub-assembler.cc 369 KB