• Andreas Haas's avatar
    [win] Fix corner case in AllocateStackSpace · 1e8ab268
    Andreas Haas authored
    With this CL it is guaranteed that every time after AllocatedStackSpace
    allocates a full page, this page also gets touched.
    
    Background:
    
    On Windows it is required to touch every new memory page on the stack
    before adding another memory page. This is implemented in
    {AllocateStackSpace}. This was implemented so far by repeatedly
    allocating a new page, followed by touching the new page. The last
    allocation, which may has up to the size of a page, did not get touched
    anymore, with the assumption that allocated stack space will be used
    before new stack space gets allocated. However, this assumption is
    wrong. In Liftoff, the whole stack space that is needed for a function
    gets allocated in the beginning of the function. This stack space may
    only be used for spills though, and the spilling may only happen after
    the first function call in the function. In this case the callee
    function will write to its own stack frame before the stack frame of the
    caller gets used.
    
    As written above, the last allocation does not get touched anymore. In
    the case that this is a full memory page, this can mean that a full
    memory page gets skipped without getting touched. With this CL it is
    guaranteed that the last allocation is always smaller than one page, and
    therefore it is impossible to skip a full page without touching it as
    long as there are no two calls to {AllocateStackSpace} without a {push}
    in between.
    
    
    Bug: v8:12063
    Change-Id: If0bb41212e882beb926aac538001b02f179fc03e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3168276
    Commit-Queue: Andreas Haas <ahaas@chromium.org>
    Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#76915}
    1e8ab268
Name
Last commit
Last update
.github Loading commit data...
bazel Loading commit data...
build_overrides Loading commit data...
custom_deps Loading commit data...
docs Loading commit data...
gni Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.bazelrc Loading commit data...
.clang-format Loading commit data...
.clang-tidy Loading commit data...
.editorconfig Loading commit data...
.flake8 Loading commit data...
.git-blame-ignore-revs Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.mailmap Loading commit data...
.vpython Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.bazel Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
COMMON_OWNERS Loading commit data...
DEPS Loading commit data...
DIR_METADATA Loading commit data...
ENG_REVIEW_OWNERS Loading commit data...
INFRA_OWNERS Loading commit data...
INTL_OWNERS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LOONG_OWNERS Loading commit data...
MIPS_OWNERS Loading commit data...
OWNERS Loading commit data...
PPC_OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
RISCV_OWNERS Loading commit data...
S390_OWNERS Loading commit data...
WATCHLISTS Loading commit data...
WORKSPACE Loading commit data...
codereview.settings Loading commit data...