Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 56945c8fdd481fe6ff3783779ab576fc62f29ada..20b7d04986422aef44d77a1bf2c819a2822c629f 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -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" |
@@ -7159,10 +7160,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; |
+ if (code_event_handler == nullptr && i::FLAG_gdbjit) { |
Yang
2016/02/18 22:25:34
could we have the ifdef around the if-statement?
noordhuis
2016/02/19 08:24:43
The idea here was to keep the dead code if !define
Yang
2016/02/19 08:29:38
I still think it's nicer to get rid of the if-stat
|
+#ifdef ENABLE_GDB_JIT_INTERFACE |
+ code_event_handler = i::GDBJITInterface::EventHandler; |
+#endif |
+ } |
+ 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); |