src : elevate v8 namespaces

Leverage `using` semantics for repeated usage of
v8 artifacts.

PR-URL: https://github.com/nodejs/node/pull/28801
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
This commit is contained in:
Harshitha KP 2019-07-22 06:04:42 -04:00 committed by Rich Trott
parent 30666edd05
commit 10dd1012d9

View File

@ -26,6 +26,7 @@
namespace node { namespace node {
using v8::Isolate;
using v8::JitCodeEvent; using v8::JitCodeEvent;
using v8::V8; using v8::V8;
@ -127,11 +128,11 @@ void CodeAddressNotification(const JitCodeEvent* jevent) {
void etw_events_change_async(uv_async_t* handle) { void etw_events_change_async(uv_async_t* handle) {
if (events_enabled > 0) { if (events_enabled > 0) {
NODE_V8SYMBOL_RESET(); NODE_V8SYMBOL_RESET();
v8::Isolate::GetCurrent()->SetJitCodeEventHandler( Isolate::GetCurrent()->SetJitCodeEventHandler(
v8::kJitCodeEventEnumExisting, v8::kJitCodeEventEnumExisting,
CodeAddressNotification); CodeAddressNotification);
} else { } else {
v8::Isolate::GetCurrent()->SetJitCodeEventHandler( Isolate::GetCurrent()->SetJitCodeEventHandler(
v8::kJitCodeEventDefault, v8::kJitCodeEventDefault,
nullptr); nullptr);
} }
@ -199,7 +200,7 @@ void shutdown_etw() {
} }
events_enabled = 0; events_enabled = 0;
v8::Isolate::GetCurrent()->SetJitCodeEventHandler( Isolate::GetCurrent()->SetJitCodeEventHandler(
v8::kJitCodeEventDefault, v8::kJitCodeEventDefault,
nullptr); nullptr);