v8/include
Yang Guo 4495cba3d6 [snapshot] clear internal fields that are serialized by callback
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: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57272}
2018-11-06 11:48:19 +00:00
..
libplatform [cleanup] Refactor second batch of general classes to use default members. 2018-09-20 10:34:28 +00:00
APIDesign.md Replace <> with &lt;&gt; in md docs 2017-06-12 10:09:12 +00:00
DEPS [inspector] Build inspector under v8_enable_inspector build flag. 2016-09-06 23:26:35 +00:00
OWNERS [ptr-compr] Add gn arg for 31bit Smis on 64bit arch 2018-10-24 13:26:35 +00:00
v8-inspector-protocol.h [inspector] Build inspector under v8_enable_inspector build flag. 2016-09-06 23:26:35 +00:00
v8-inspector.h [cleanup] Refactor inspector to use default members. 2018-09-18 09:13:59 +00:00
v8-internal.h [ubsan] Port Smi to the new design 2018-11-05 20:52:51 +00:00
v8-platform.h [heap] Reclaim inaccessible memory. 2018-10-22 10:21:57 +00:00
v8-profiler.h [heap profiler] Provide detailed samples information in heap profiler 2018-10-18 20:50:15 +00:00
v8-testing.h Remove easy to remove calls to Isolate::Current() from api.cc 2015-11-30 08:16:59 +00:00
v8-util.h Remove PersistentContainerCallbackType::kWeak 2018-10-17 14:51:20 +00:00
v8-value-serializer-version.h Expose the ValueSerializer data format version as a compile-time constant. 2017-04-27 15:14:41 +00:00
v8-version-string.h [build] Fix V8_VERSION_STRING with embedder string 2017-10-23 14:31:52 +00:00
v8-version.h Bump V8 version 2018-10-11 14:04:09 +00:00
v8-wasm-trap-handler-posix.h [wasm] Refactor trap-handler to allow an extension to windows 2018-10-26 12:02:41 +00:00
v8-wasm-trap-handler-win.h [wasm] Implement trap handler on Windows 2018-10-30 10:25:37 +00:00
v8.h [snapshot] clear internal fields that are serialized by callback 2018-11-06 11:48:19 +00:00
v8config.h [ubsan] Port Smi to the new design 2018-11-05 20:52:51 +00:00