Commit aea56e0e authored by ben's avatar ben Committed by Commit bot

Unbreak --gdbjit for embedders.

Embedders don't use d8.cc.  Move gdbjit initialization to api.cc.

BUG=

Review URL: https://codereview.chromium.org/1710253002

Cr-Commit-Position: refs/heads/master@{#34180}
parent 35e44387
......@@ -35,6 +35,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"
......@@ -7160,10 +7161,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);
......
......@@ -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
......@@ -2467,11 +2463,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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment