summaryrefslogtreecommitdiff
path: root/src/env.cc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-03-01 23:35:54 +0100
committerAnna Henningsen <anna@addaleax.net>2019-03-13 00:12:56 +0000
commit6d9aa73b1f2a0b053e39d743b1ddf382d35adfad (patch)
tree3254de3bb6292f36c4458f06f28a663614df924f /src/env.cc
parent377c5835e8bfcd04273f24a244b2ba4aff76a27c (diff)
downloadandroid-node-v8-6d9aa73b1f2a0b053e39d743b1ddf382d35adfad.tar.gz
android-node-v8-6d9aa73b1f2a0b053e39d743b1ddf382d35adfad.tar.bz2
android-node-v8-6d9aa73b1f2a0b053e39d743b1ddf382d35adfad.zip
src: clean up MultiIsolatePlatform interface
- Since this was introduced, V8 has effectively started requiring that the platform knows of the `Isolate*` before we (or an embedder) create our `IsolateData` structure; therefore, (un)registering it from the `IsolateData` constructor/destructor doesn’t make much sense anymore. - Instead, we can require that the register/unregister functions are only called once, simplifying the implementation a bit. - Add a callback that we can use to know when the platform has cleaned up its resources associated with a given `Isolate`. In particular, this means that in the Worker code, we don’t need to rely on what are essentially guesses about the number of event loop turns that we need in order to have everything cleaned up. PR-URL: https://github.com/nodejs/node/pull/26384 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'src/env.cc')
-rw-r--r--src/env.cc8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/env.cc b/src/env.cc
index 5046aa0dd1..d791e41f92 100644
--- a/src/env.cc
+++ b/src/env.cc
@@ -84,8 +84,6 @@ IsolateData::IsolateData(Isolate* isolate,
uses_node_allocator_(allocator_ == node_allocator_),
platform_(platform) {
CHECK_NOT_NULL(allocator_);
- if (platform_ != nullptr)
- platform_->RegisterIsolate(isolate_, event_loop);
options_.reset(
new PerIsolateOptions(*(per_process::cli_options->per_isolate)));
@@ -137,12 +135,6 @@ IsolateData::IsolateData(Isolate* isolate,
#undef V
}
-IsolateData::~IsolateData() {
- if (platform_ != nullptr)
- platform_->UnregisterIsolate(isolate_);
-}
-
-
void InitThreadLocalOnce() {
CHECK_EQ(0, uv_key_create(&Environment::thread_local_env));
}