• Tom Tan's avatar
    Unwind V8 frames correctly on Windows ARM64 · 3f1f001a
    Tom Tan authored
    On Windows ARM64, OS stack walking does not work because the V8 ARM64 backend
    doesn't emit unwinding info and also because it doesn't emit ABI compliant
    stack frames. This was fixed for Windows X64 (https://crrev.com/c/1469329) and
    documented below:
    
    https://docs.google.com/document/d/1-wf50jFlii0c_Pr52lm2ZU-49m220nhYMrHDi3vXnh0
    
    This problem can be fixed similarly for Windows ARM64 by observing that V8
    frames usually all have the same prolog which maintains a chain via frame
    pointer (fp or x29 register).
    
    stp fp, lr, [sp, ...]
    
    One exception is JSEntry which stops fp pointer chain and needs to be handled
    specially.
    
    So it is possible to define XDATA with UNWIND_CODE which specify how Windows
    should walk through V8 dynamic frames. The same as X64, since V8 Code objects
    are all allocated in the same code-range for an Isolate, it is possible to
    register at most 2 XDATA and a group of PDATA entries to cover stack walking
    for all the code generated inside that code-range. This is more than 1
    PDATA/XDATA because according to the Windows ARM64 exeption handling document,
    1 PDATA can cover less than 1MB code range (see below doc).
    
    https://docs.microsoft.com/en-us/cpp/build/arm64-exception-handling
    
    This PR implements stackwalk for Windows ARM64 to be on par with X64, including
    embedded builtins, jitted code and wasm jitted code, but not including register
    handler for handling exception only, because there is no backward compatibility
    to maintain for Windows ARM64 which was released since 1709 windows build.
    
    Bug: chromium:893460
    Change-Id: Ic74cbdad8af5cf342185030a4c53796f12ea5429
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1701133Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
    Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
    Commit-Queue: Jakob Gruber <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#63002}
    3f1f001a
Name
Last commit
Last update
..
arm Loading commit data...
arm64 Loading commit data...
ia32 Loading commit data...
mips Loading commit data...
mips64 Loading commit data...
ppc Loading commit data...
s390 Loading commit data...
x64 Loading commit data...
DEPS Loading commit data...
OWNERS Loading commit data...
basic-block-profiler.cc Loading commit data...
basic-block-profiler.h Loading commit data...
code-tracer.h Loading commit data...
compilation-statistics.cc Loading commit data...
compilation-statistics.h Loading commit data...
disasm.h Loading commit data...
disassembler.cc Loading commit data...
disassembler.h Loading commit data...
eh-frame.cc Loading commit data...
eh-frame.h Loading commit data...
gdb-jit.cc Loading commit data...
gdb-jit.h Loading commit data...
objects-debug.cc Loading commit data...
objects-printer.cc Loading commit data...
perf-jit.cc Loading commit data...
perf-jit.h Loading commit data...
unwinder.cc Loading commit data...
unwinding-info-win64.cc Loading commit data...
unwinding-info-win64.h Loading commit data...