summaryrefslogtreecommitdiff
path: root/src/node_main_instance.h
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2019-04-20 17:18:34 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2019-04-23 11:26:07 +0800
commiteb23b176d8c7122af6add5ee38f87044288d3d39 (patch)
tree46a5aa800eb31a0510254ee03dcd35ee2bbcf220 /src/node_main_instance.h
parentbf5dadeef07250763948765e9902edd2ecee5448 (diff)
downloadandroid-node-v8-eb23b176d8c7122af6add5ee38f87044288d3d39.tar.gz
android-node-v8-eb23b176d8c7122af6add5ee38f87044288d3d39.tar.bz2
android-node-v8-eb23b176d8c7122af6add5ee38f87044288d3d39.zip
src: enable context snapshot after running per-context scripts
At build time, snapshot the context after running per-context scripts in the main instance, and in the final build, deserialize the context in the main instance. This provides a ~5% in the misc/startup benchmark when the instance is launched within a process that runs test/fixtures/semicolon.js. PR-URL: https://github.com/nodejs/node/pull/27321 Refs: https://github.com/nodejs/node/issues/17058 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/node_main_instance.h')
-rw-r--r--src/node_main_instance.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node_main_instance.h b/src/node_main_instance.h
index 98c17cc8f0..531c919f05 100644
--- a/src/node_main_instance.h
+++ b/src/node_main_instance.h
@@ -75,6 +75,8 @@ class NodeMainInstance {
static const IndexArray* GetIsolateDataIndexes();
static v8::StartupData* GetEmbeddedSnapshotBlob();
+ static const size_t kNodeContextIndex = 0;
+
private:
NodeMainInstance(const NodeMainInstance&) = delete;
NodeMainInstance& operator=(const NodeMainInstance&) = delete;