diff options
author | Matt Loring <mattloring@google.com> | 2017-03-13 15:17:57 -0700 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2017-08-17 20:26:55 +0200 |
commit | 9e08695f85d4273f01e010cf384f42030d66b453 (patch) | |
tree | 24e9bc7ba9c4e2784cb18b3d692ef227b9de4e28 /src/tracing | |
parent | 5e5a52fc937d53b5bcf5c2c09c898d8311db2bca (diff) | |
download | android-node-v8-9e08695f85d4273f01e010cf384f42030d66b453.tar.gz android-node-v8-9e08695f85d4273f01e010cf384f42030d66b453.tar.bz2 android-node-v8-9e08695f85d4273f01e010cf384f42030d66b453.zip |
src: Node implementation of v8::Platform
Node.js currently uses the V8 implementation of the DefaultPlatform
which schedules VM tasks on a V8 managed thread pool. Since the Node.js
event loop is not aware of these tasks, the Node.js process may exit
while there are outstanding VM tasks. This will become problematic once
asynchronous wasm compilation lands in V8.
This PR introduces a Node.js specific implementation of the v8::Platform
on top of libuv so that the event loop is aware of outstanding VM tasks.
PR-URL: https://github.com/nodejs/node/pull/14001
Fixes: https://github.com/nodejs/node/issues/3665
Fixes: https://github.com/nodejs/node/issues/8496
Fixes: https://github.com/nodejs/node/issues/12980
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'src/tracing')
-rw-r--r-- | src/tracing/agent.cc | 1 | ||||
-rw-r--r-- | src/tracing/agent.h | 1 | ||||
-rw-r--r-- | src/tracing/trace_event.cc | 6 | ||||
-rw-r--r-- | src/tracing/trace_event.h | 1 |
4 files changed, 5 insertions, 4 deletions
diff --git a/src/tracing/agent.cc b/src/tracing/agent.cc index 38e651ebb2..1ac99bbb34 100644 --- a/src/tracing/agent.cc +++ b/src/tracing/agent.cc @@ -4,7 +4,6 @@ #include <string> #include "env-inl.h" -#include "libplatform/libplatform.h" namespace node { namespace tracing { diff --git a/src/tracing/agent.h b/src/tracing/agent.h index cc00c53144..e781281712 100644 --- a/src/tracing/agent.h +++ b/src/tracing/agent.h @@ -1,6 +1,7 @@ #ifndef SRC_TRACING_AGENT_H_ #define SRC_TRACING_AGENT_H_ +#include "node_platform.h" #include "tracing/node_trace_buffer.h" #include "tracing/node_trace_writer.h" #include "uv.h" diff --git a/src/tracing/trace_event.cc b/src/tracing/trace_event.cc index 856b344e9d..f661dd5c69 100644 --- a/src/tracing/trace_event.cc +++ b/src/tracing/trace_event.cc @@ -3,14 +3,14 @@ namespace node { namespace tracing { -v8::TracingController* controller_ = nullptr; +v8::TracingController* g_controller = nullptr; void TraceEventHelper::SetTracingController(v8::TracingController* controller) { - controller_ = controller; + g_controller = controller; } v8::TracingController* TraceEventHelper::GetTracingController() { - return controller_; + return g_controller; } } // namespace tracing diff --git a/src/tracing/trace_event.h b/src/tracing/trace_event.h index 24806d375f..61808eb94f 100644 --- a/src/tracing/trace_event.h +++ b/src/tracing/trace_event.h @@ -7,6 +7,7 @@ #include <stddef.h> +#include "node_platform.h" #include "v8-platform.h" #include "trace_event_common.h" |