• 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
..
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...