diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2021-01-28 17:00:03 +0300 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2021-02-05 15:10:29 +0300 |
commit | 9aeb83643486328cbdffb55a23efe953f6ee54e0 (patch) | |
tree | e5f192f2ba3d20065b2cf01b2b344ef4b37e5c7f /src/node.cc | |
parent | 664cce92ec09363d5a37c9f2a360ee0810fe30e3 (diff) |
src: refactor bookkeeping of bootstrap status
This patch
1. Refactors the bootstrap routine of the main instance so that
when --no-node-snapshot is used,
Environment::InitializeMainContext() will only be called once
(previously it would be called twice, which was harmless for now
but not ideal).
2. Mark the number of BaseObjects in RunBootstrapping() when creating
the Environment from scratch and in InitializeMainContext() when
the Environment is deserialized. Previously the marking was done in
the Environment constructor and InitializeMainContext() respectively
for the cctest which was incorrect because the cctest never uses
an Environment that's not bootstrapped. Also renames the mark
to base_object_created_after_bootstrap to reflect what it's
intended for.
PR-URL: https://github.com/nodejs/node/pull/37113
Refs: https://github.com/nodejs/node/pull/36943
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node.cc')
-rw-r--r-- | src/node.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node.cc b/src/node.cc index c3f423cb579..343a8d9b79a 100644 --- a/src/node.cc +++ b/src/node.cc @@ -415,7 +415,7 @@ MaybeLocal<Value> Environment::RunBootstrapping() { CHECK(req_wrap_queue()->IsEmpty()); CHECK(handle_wrap_queue()->IsEmpty()); - set_has_run_bootstrapping_code(true); + DoneBootstrapping(); return scope.Escape(result); } |