• Dan Elphick's avatar
    [snapshot] Create a ReadOnly snapshot · f602712f
    Dan Elphick authored
    In preparation for sharing RO_SPACE between all Isolates within a
    process, this first pulls RO_SPACE out of the Startup snapshot and puts
    it in its own ReadOnly snapshot.
    
    The snapshot is first populated with the read-only roots. After that the
    StartupSerializer serializes as before but starting from the first
    mutable root. References to objects in the ReadOnly snapshot that aren't
    themselves roots are added to a new cache called ReadOnlyObjectCache
    which functions like the PartialSnapshotCache but lives in the
    ReadOnlySerializer rather than the StartupSerializer. These cache
    entries are referenced using a new bytecode: ReadOnlyObjectCache. (To
    make room for this, the ApiReference bytecode has been moved).
    
    To reduce code duplication, the StartupSerializer has been refactored to
    create a new base class RootSerializer, which ReadOnlySerializer also
    subclasses. The base class is responsible primarily for keeping track of
    already serialized roots and visiting the roots.
    
    Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
    Change-Id: Iff26042886130ae22eccf2e11b35f6f226f4a792
    Bug: v8:8191
    Reviewed-on: https://chromium-review.googlesource.com/c/1244676
    Commit-Queue: Dan Elphick <delphick@chromium.org>
    Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
    Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#56681}
    f602712f
builtin-serializer.cc 3.92 KB