diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2019-04-21 07:47:32 +0300 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2020-07-18 06:15:57 +0300 |
commit | 1faf6f459f220bb67866f12b30626ef7856876ee (patch) | |
tree | d1308396c07e8289f8d987178c294141f4687889 /src/node.cc | |
parent | f04538761f5bb3c334d3c8d16d093ac0916ff3bc (diff) |
src: snapshot Environment upon instantiation
This includes the initial Environment (without running bootstrap
scripts) into the builtin snapshot
PR-URL: https://github.com/nodejs/node/pull/32984
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Diffstat (limited to 'src/node.cc')
-rw-r--r-- | src/node.cc | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/node.cc b/src/node.cc index e27edec0efe..ce2834448e9 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1060,20 +1060,15 @@ int Start(int argc, char** argv) { { Isolate::CreateParams params; const std::vector<size_t>* indexes = nullptr; - std::vector<intptr_t> external_references; - + const EnvSerializeInfo* env_info = nullptr; bool force_no_snapshot = per_process::cli_options->per_isolate->no_node_snapshot; if (!force_no_snapshot) { v8::StartupData* blob = NodeMainInstance::GetEmbeddedSnapshotBlob(); if (blob != nullptr) { - // TODO(joyeecheung): collect external references and set it in - // params.external_references. - external_references = NodeMainInstance::CollectExternalReferences(); - external_references.push_back(reinterpret_cast<intptr_t>(nullptr)); - params.external_references = external_references.data(); params.snapshot_blob = blob; indexes = NodeMainInstance::GetIsolateDataIndexes(); + env_info = NodeMainInstance::GetEnvSerializeInfo(); } } @@ -1083,7 +1078,7 @@ int Start(int argc, char** argv) { result.args, result.exec_args, indexes); - result.exit_code = main_instance.Run(); + result.exit_code = main_instance.Run(env_info); } TearDownOncePerProcess(); |