diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2021-05-26 19:42:00 +0300 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2021-06-10 09:17:49 +0300 |
commit | 30e8b5e2a2638d26939eb6cb00c1ffb77fdba6f7 (patch) | |
tree | e131e2ad4cc707355cbe4c40db7ff94d2a9a77c8 /src/env.h | |
parent | f461158febdffe8eaa6468b1b716f2dbe40fd056 (diff) |
tools: refactor snapshot builder
This patch:
- Moves the snapshot building code to src/ so that we can reuse it
later when generating custom snapshots from an entry point accepted
by the node binary.
- Create a SnapshotData struct that incorporates all the data useful
for a snapshot blob, including both the V8 data and the Node.js
data.
PR-URL: https://github.com/nodejs/node/pull/38902
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Diffstat (limited to 'src/env.h')
-rw-r--r-- | src/env.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/env.h b/src/env.h index 4a50227ee8d..a3944eab90a 100644 --- a/src/env.h +++ b/src/env.h @@ -955,6 +955,13 @@ struct EnvSerializeInfo { friend std::ostream& operator<<(std::ostream& o, const EnvSerializeInfo& i); }; +struct SnapshotData { + SnapshotData() { blob.data = nullptr; } + v8::StartupData blob; + std::vector<size_t> isolate_data_indices; + EnvSerializeInfo env_info; +}; + class Environment : public MemoryRetainer { public: Environment(const Environment&) = delete; |