• Pierre Langlois's avatar
    [arm] Introduce UseScratchRegisterScope · 8e84b715
    Pierre Langlois authored
    Introduce a stripped down version of UseScratchRegisterScope for ARM and use it
    inside the assembler and macro-assembler. At the exception of the Call
    instructions, we now use this scope instead of using the ip register
    directly. This is inspired from how the ARM64 backend works.
    
    In general, the benefit of doing this is we can catch cases where ip is being
    used both by the caller and by the assembler. But more specifically, TurboFan
    reserves r9 as an extra scratch register because ip can already be used by the
    assembler. With this utility, we can isolate the cases in the code generator
    which need an extra register and potentially fix them, allowing us to give r9
    back to the register allocator.
    
    This patch uncovered places in the assembler where we were using ip
    unconditionally when we could have re-used the destination register instead.
    
    Bug: v8:6553
    Change-Id: Ib7134e3ed64dd1f90baf209ae831ed8f644cac78
    Reviewed-on: https://chromium-review.googlesource.com/544956
    Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
    Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#46425}
    8e84b715
macro-assembler-arm64.h 108 KB