• 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
..
OWNERS Loading commit data...
address-map.cc Loading commit data...
address-map.h Loading commit data...
allocation.cc Loading commit data...
allocation.h Loading commit data...
bit-vector.cc Loading commit data...
bit-vector.h Loading commit data...
boxed-float.h Loading commit data...
detachable-vector.cc Loading commit data...
detachable-vector.h Loading commit data...
identity-map.cc Loading commit data...
identity-map.h Loading commit data...
locked-queue-inl.h Loading commit data...
locked-queue.h Loading commit data...
memcopy.cc Loading commit data...
memcopy.h Loading commit data...
ostreams.cc Loading commit data...
ostreams.h Loading commit data...
pointer-with-payload.h Loading commit data...
scoped-list.h Loading commit data...
utils-inl.h Loading commit data...
utils.cc Loading commit data...
utils.h Loading commit data...
v8dll-main.cc Loading commit data...
vector.h Loading commit data...
version.cc Loading commit data...
version.h Loading commit data...