Skip to content

Commit

Permalink
deps: backport 8d00c2c from v8 upstream
Browse files Browse the repository at this point in the history
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: #2076
PR-URL: #5577
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
  • Loading branch information
bnoordhuis authored and evanlucas committed Mar 31, 2016
1 parent 660ec9f commit ec18131
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
11 changes: 9 additions & 2 deletions deps/v8/src/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,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/heap-profiler.h"
#include "src/heap-snapshot-generator-inl.h"
Expand Down Expand Up @@ -7102,10 +7103,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);
Expand Down
9 changes: 0 additions & 9 deletions deps/v8/src/d8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2389,11 +2385,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
Expand Down

0 comments on commit ec18131

Please sign in to comment.