• Leszek Swirski's avatar
    [serializer] Serialize map before object · 7c912ffa
    Leszek Swirski authored
    Change the serialization protocol to ensure that maps are serialized
    before objects using them. This ensures that as soon as we allocate
    space for an object, we can immediately write the object's map into that
    allocation. In the future, this will allow us to make deserialized
    object visible to the GC.
    
    Specifically, this forces map serialization to happen after emitting
    a kNewObject for an object, but before allocating the space for it. We
    have to serialize the map after kNewObject because otherwise the map
    itself would be written into the "current" slot, into which the object
    is supposed to be deserialized.
    
    Objects whose maps are currently being deserialized are considered
    "pending" -- started, but not yet allocated. The map might point to a
    pending object (e.g. if an object's constructor points to the object).
    This is solved by introducing a new concept of forward references, where
    the field referring to the pending object is serialized as a "pending
    forward reference" which is "resolved" once the object is allocated.
    
    It might also point to itself, in the case of the meta map -- this is
    simply solved by introducing a new bytecode for the meta map; this
    cannot be a pending forward reference because the meta map is not yet
    allocated, so its map slot cannot be registered as pending.
    
    Finally, we may need to go to a new chunk after serializing the map; so
    after the map serialization, we peek to see if there's a next chunk
    bytecode before the object allocation.
    
    Bug: v8:10815
    Change-Id: Ifa8f25bdaf3b15b5d990a1d2e7be677c2fa80013
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2362953
    Commit-Queue: Leszek Swirski <leszeks@chromium.org>
    Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#69636}
    7c912ffa
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...