• Dan Elphick's avatar
    [heap] Share RO_SPACE pages with pointer compression · c7d22c49
    Dan Elphick authored
    This allows the configuration v8_enable_shared_ro_heap and
    v8_enable_pointer_compression on Linux and Android, although it still
    defaults to off.
    
    When pointer compression and read-only heap sharing are enabled, sharing
    is achieved by allocating ReadOnlyPages in shared memory that are
    retained in the shared ReadOnlyArtifacts object. These ReadOnlyPages are
    then remapped into the address space of the Isolate ultimately using
    mremap.
    
    To simplify the creation process the ReadOnlySpace memory for the first
    Isolate is created as before without any sharing. It is only when the
    ReadOnlySpace memory has been finalized that the shared memory is
    allocated and has its contents copied into it. The original memory is
    then released (with PC this means it's just released back to the
    BoundedPageAllocator) and immediately re-allocated as a shared mapping.
    
    Because we would like to make v8_enable_shared_ro_heap default to true
    at some point but can't make this conditional on the value returned by
    a method in the code we are yet to compile, the code required for
    sharing has been mostly changed to use ifs with
    ReadOnlyHeap::IsReadOnlySpaceShared() instead of #ifdefs except where
    a compile error would result due to the absence of a class members
    without sharing. IsReadOnlySpaceShared() will evaluate
    CanAllocateSharedPages in the platform PageAllocator (with pointer
    compression and sharing enabled) once and cache that value so sharing
    cannot be toggled during the lifetime of the process.
    
    Bug: v8:10454
    Change-Id: I0236d752047ecce71bd64c159430517a712bc1e2
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2267300
    Commit-Queue: Dan Elphick <delphick@chromium.org>
    Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
    Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#69174}
    c7d22c49
Name
Last commit
Last update
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...
.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...
.vpython Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
COMMON_OWNERS Loading commit data...
DEPS 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...
LICENSE.valgrind 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...
S390_OWNERS Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...