[turbofan] Don't go MEGAMORPHIC when storing oddballs to typed arrays.
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: Michael Stanton <mvstanton@chromium.org> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org> Cr-Commit-Position: refs/heads/master@{#48257}
Showing
Please
register
or
sign in
to comment