• Seth Brenith's avatar
    Fix JSEntry unwinding data on Windows ARM64 · cdf8925e
    Seth Brenith authored
    The current unwinding data for JSEntry correctly restores the frame
    pointer and program counter from the caller frame, which might or might
    not be sufficient to continue unwinding, depending on the contents of
    that caller frame. Currently, the cctest StackUnwindingWin64 is broken
    (at least with my build config) because the caller frame also needs the
    stack pointer, which is not restored correctly.
    
    In particular, I see this xdata for v8::internal::GeneratedCode<...>,
    which is the function that calls Builtins_JSEntry:
    
    10400015 : 2 code words, 1 epilog, function length=15
    01000012 : epilog starts at 12 and its unwind handler starts at 4
    e405c8d2 : save_reg x=b z=8
               alloc_s x=5
               end
    e405c8d2 : same thing but for the epilog
    
    The prolog that corresponds to the unwind codes above is:
    
    sub sp, sp, #50
    str lr, [sp, #0x40]
    
    Note that it does not set fp, so unwinding requires an accurate sp.
    
    This change emits slightly more complicated unwinding data for JSEntry
    so that the frame pointer, stack pointer, and program counter can all be
    restored.
    
    Change-Id: I0c7f3eba97ef64408f46631b487c4b0ceb06fa9b
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1848860
    Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
    Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
    Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#64435}
    cdf8925e
unwinding-info-win64.cc 22.4 KB