• Pierre Langlois's avatar
    Simplify DoubleToI stub. · 9f4f3c28
    Pierre Langlois authored
    The DoubleToI stub is no longer called outside of TurboFan, and always in the
    same way:
    
      - The parameter is on top of the stack.
      - The stub is always called in a slow path.
      - It truncates.
    
    Therefore, we can simplify it to only support this case and remove dead
    code.
    
    On top of this, since the stub is always considered to be on a slow path for all
    backends, this patch takes the opportunity to remove the `skip_fastpath`
    optimisation. This would generate a stub which does not handle all inputs,
    assuming that the backend already handled some of the inputs in a fast
    path. Removing this allows the stub to have the same behaviour on all targets.
    
    On Arm, this patch reworks the stub a little. We could use ip instead of saving
    and restoring a register on the stack. Also, comments would mention that we
    assume the exponent to be greater than 31 when the it can be 30 or higher. As
    done for Arm64, let's check this at runtime in debug mode.
    
    On Arm64, we can also implement the stub without pushing and poping off the
    stack. It needs 2 general purpose and a double scratch registers which we have
    reserved already (ip0, ip1 and d30). This removes the need to check that the
    stack pointer is always 16-bytes aligned.
    
    Finally, this also fixes a potential bug on Arm64, in the
    `GetAllocatableRegisterThatIsNotOneOf` method which is now removed. We were
    picking an allocatable double register when we meant to pick a general one.
    
    Bug: v8:6644
    Change-Id: I88d4597f377c9fc05432d5922a0d7129b6d19b47
    Reviewed-on: https://chromium-review.googlesource.com/720963Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
    Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
    Cr-Commit-Position: refs/heads/master@{#48671}
    9f4f3c28
macro-assembler-arm.cc 83.3 KB