• 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
..
api Loading commit data...
asmjs Loading commit data...
ast Loading commit data...
base Loading commit data...
builtins Loading commit data...
codegen Loading commit data...
common Loading commit data...
compiler Loading commit data...
compiler-dispatcher Loading commit data...
d8 Loading commit data...
date Loading commit data...
debug Loading commit data...
deoptimizer Loading commit data...
diagnostics Loading commit data...
execution Loading commit data...
extensions Loading commit data...
flags Loading commit data...
handles Loading commit data...
heap Loading commit data...
ic Loading commit data...
init Loading commit data...
inspector Loading commit data...
interpreter Loading commit data...
json Loading commit data...
libplatform Loading commit data...
libsampler Loading commit data...
logging Loading commit data...
numbers Loading commit data...
objects Loading commit data...
parsing Loading commit data...
profiler Loading commit data...
protobuf Loading commit data...
regexp Loading commit data...
roots Loading commit data...
runtime Loading commit data...
sanitizer Loading commit data...
snapshot Loading commit data...
strings Loading commit data...
tasks Loading commit data...
third_party Loading commit data...
torque Loading commit data...
tracing Loading commit data...
trap-handler Loading commit data...
utils Loading commit data...
wasm Loading commit data...
zone Loading commit data...
DEPS Loading commit data...
OWNERS Loading commit data...