• bmeurer's avatar
    [intrinsics] Kill the %_IsMinusZero intrinsic. · 00f7d1f5
    bmeurer authored
    By now only the default %TypedArray%.prototype.sort compare function
    and the JS implementation of SameValueZero were still using the odd
    %_IsMinusZero intrinsic, whose semantics both included a number check
    (actually HeapNumber test) plus testing if the heap number stores the
    special -0 value. In both cases we already know that we deal with
    number so we can reduce it to a simple number test for -0, which can
    be expressed via dividing 1 by that value and checking the sign of
    the result. In case of the compare function, we can be even smarter
    and work with the reciprocal values in case x and y are equal to 0
    (although long term we should probably rewrite the fast case for
    the typed array sorting function in C++ anyway, which will be way,
    way faster than our handwritten callback-style, type-feedback
    polluted JS implementation).
    
    R=yangguo@chromium.org
    
    Review URL: https://codereview.chromium.org/1680783002
    
    Cr-Commit-Position: refs/heads/master@{#33833}
    00f7d1f5
runtime.js 5.05 KB