diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2021-11-18 06:56:39 +0300 |
---|---|---|
committer | Bryan English <bryan@bryanenglish.com> | 2022-05-30 19:26:49 +0300 |
commit | 85d81a764f7ddd60a18ea772bf912950b0818b2f (patch) | |
tree | 786c07ce8692d404f57e5057006a96a091fb91a4 /lib | |
parent | 82fb037388f510fde52558c8e19746a5ebb63938 (diff) |
bootstrap: include code cache in the embedded snapshot
Since V8 code cache encodes indices to the read-only space
it is safer to make sure that the code cache is generated in the
same heap used to generate the embdded snapshot. This patch
merges the code cache builder into the snapshot builder and
makes the code cache part of node::SnapshotData that is
deserialized into the native module loader during bootstrap.
PR-URL: https://github.com/nodejs/node/pull/43023
Fixes: https://github.com/nodejs/node/issues/31074
Refs: https://github.com/nodejs/node/issues/35711
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/internal/bootstrap/node.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 1fc59fdeffd..0be64e136d1 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -270,9 +270,8 @@ const features = { tls_sni: hasOpenSSL, tls_ocsp: hasOpenSSL, tls: hasOpenSSL, - // This needs to be dynamic because snapshot is built without code cache. - // TODO(joyeecheung): https://github.com/nodejs/node/issues/31074 - // Make it possible to build snapshot with code cache + // This needs to be dynamic because --no-node-snapshot disables the + // code cache even if the binary is built with embedded code cache. get cached_builtins() { return nativeModule.hasCachedBuiltins(); } |