diff --git a/deps/v8/src/api.cc b/deps/v8/src/api.cc index 8274a735689ce3..c787dd5f1fc937 100644 --- a/deps/v8/src/api.cc +++ b/deps/v8/src/api.cc @@ -34,6 +34,7 @@ #include "src/debug/debug.h" #include "src/deoptimizer.h" #include "src/execution.h" +#include "src/gdb-jit.h" #include "src/global-handles.h" #include "src/icu_util.h" #include "src/isolate-inl.h" @@ -7158,10 +7159,16 @@ Isolate* Isolate::New(const Isolate::CreateParams& params) { if (params.entry_hook) { isolate->set_function_entry_hook(params.entry_hook); } - if (params.code_event_handler) { + auto code_event_handler = params.code_event_handler; +#ifdef ENABLE_GDB_JIT_INTERFACE + if (code_event_handler == nullptr && i::FLAG_gdbjit) { + code_event_handler = i::GDBJITInterface::EventHandler; + } +#endif // ENABLE_GDB_JIT_INTERFACE + if (code_event_handler) { isolate->InitializeLoggingAndCounters(); isolate->logger()->SetCodeEventHandler(kJitCodeEventDefault, - params.code_event_handler); + code_event_handler); } if (params.counter_lookup_callback) { v8_isolate->SetCounterFunction(params.counter_lookup_callback); diff --git a/deps/v8/src/d8.cc b/deps/v8/src/d8.cc index c58c172640edfd..bd98b93dae812c 100644 --- a/deps/v8/src/d8.cc +++ b/deps/v8/src/d8.cc @@ -26,10 +26,6 @@ #include "include/v8-testing.h" #endif // V8_SHARED -#if !defined(V8_SHARED) && defined(ENABLE_GDB_JIT_INTERFACE) -#include "src/gdb-jit.h" -#endif - #ifdef ENABLE_VTUNE_JIT_INTERFACE #include "src/third_party/vtune/v8-vtune.h" #endif @@ -2459,11 +2455,6 @@ int Shell::Main(int argc, char* argv[]) { Shell::array_buffer_allocator = &shell_array_buffer_allocator; } create_params.array_buffer_allocator = Shell::array_buffer_allocator; -#if !defined(V8_SHARED) && defined(ENABLE_GDB_JIT_INTERFACE) - if (i::FLAG_gdbjit) { - create_params.code_event_handler = i::GDBJITInterface::EventHandler; - } -#endif #ifdef ENABLE_VTUNE_JIT_INTERFACE create_params.code_event_handler = vTune::GetVtuneCodeEventHandler(); #endif