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/env.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/env.cc')
-rw-r--r-- | src/env.cc | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/env.cc b/src/env.cc index b618f840af8..fe774b4bf31 100644 --- a/src/env.cc +++ b/src/env.cc @@ -414,10 +414,6 @@ Environment::Environment(IsolateData* isolate_data, "args", std::move(traced_value)); } - - // This adjusts the return value of base_object_count() so that tests that - // check the count do not have to account for internally created BaseObjects. - initial_base_object_count_ = base_object_count(); } Environment::Environment(IsolateData* isolate_data, @@ -460,10 +456,6 @@ void Environment::InitializeMainContext(Local<Context> context, per_process::node_start_time); performance_state_->Mark(performance::NODE_PERFORMANCE_MILESTONE_V8_START, performance::performance_v8_start); - - // This adjusts the return value of base_object_count() so that tests that - // check the count do not have to account for internally created BaseObjects. - initial_base_object_count_ = base_object_count(); } Environment::~Environment() { @@ -654,7 +646,6 @@ void Environment::RunCleanup() { TraceEventScope trace_scope(TRACING_CATEGORY_NODE1(environment), "RunCleanup", this); bindings_.clear(); - initial_base_object_count_ = 0; CleanupHandles(); while (!cleanup_hooks_.empty() || |