• Yang Guo's avatar
    [snapshot] clear internal fields that are serialized by callback · 4495cba3
    Yang Guo authored
    This is to ensure the snapshot is deterministic.
    
    Internal fields can contain:
    - reference to heap object
    - embedder-defined aligned pointer
    - a smi
    
    The latter two are not distinguishable by V8, so if the serializer
    callback returns non-zero value, we consider it to be an aligned pointer
    and clear it to ensure that the snapshot does not contain memory
    addresses that may not be deterministic. If the callback returns
    { nullptr, 0 } as result, we consider it to be a smi or some in-place
    data that we then serialize verbatim.
    
    
    R=jgruber@chromium.org
    
    Bug: chromium:870584
    Change-Id: I3cf9abf135ffd28d8138fa32636b12596b076e13
    Reviewed-on: https://chromium-review.googlesource.com/c/1304441
    Commit-Queue: Yang Guo <yangguo@chromium.org>
    Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
    Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#57272}
    4495cba3
Name
Last commit
Last update
benchmarks Loading commit data...
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...
.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...
ChangeLog Loading commit data...
DEPS 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...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...