summaryrefslogtreecommitdiff
path: root/deps
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2016-03-06 12:12:22 +0100
committerMyles Borins <mborins@us.ibm.com>2016-04-08 16:54:58 -0400
commitaadf356aa2bc70e3a93b4a036cf5794ae16b084e (patch)
tree00a0ed67ff02cc006185f52a0d93d5d70ae40161 /deps
parent16216a81dec6f1da289903c62026e988bcefa536 (diff)
downloadnodejs-aadf356aa2bc70e3a93b4a036cf5794ae16b084e.tar.gz
nodejs-aadf356aa2bc70e3a93b4a036cf5794ae16b084e.tar.bz2
nodejs-aadf356aa2bc70e3a93b4a036cf5794ae16b084e.zip
deps: backport 8d00c2c from v8 upstream
Original commit message: Unbreak --gdbjit for embedders. Embedders don't use d8.cc. Move gdbjit initialization to api.cc. Review URL: https://codereview.chromium.org/1710253002 Fixes: https://github.com/nodejs/node/issues/2076 PR-URL: https://github.com/nodejs/node/pull/5577 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Diffstat (limited to 'deps')
-rw-r--r--deps/v8/src/api.cc11
-rw-r--r--deps/v8/src/d8.cc9
2 files changed, 9 insertions, 11 deletions
diff --git a/deps/v8/src/api.cc b/deps/v8/src/api.cc
index a57171f8a..ec0f80587 100644
--- a/deps/v8/src/api.cc
+++ b/deps/v8/src/api.cc
@@ -29,6 +29,7 @@
#include "src/debug.h"
#include "src/deoptimizer.h"
#include "src/execution.h"
+#include "src/gdb-jit.h"
#include "src/global-handles.h"
#include "src/heap/spaces.h"
#include "src/heap-profiler.h"
@@ -7118,10 +7119,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 45bf33167..12edeb4fa 100644
--- a/deps/v8/src/d8.cc
+++ b/deps/v8/src/d8.cc
@@ -25,10 +25,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
@@ -2331,11 +2327,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