Skip to content

Commit ec18131

Browse files
bnoordhuisevanlucas
authored andcommitted
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: #2076 PR-URL: #5577 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
1 parent 660ec9f commit ec18131

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

deps/v8/src/api.cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "src/debug/debug.h"
3232
#include "src/deoptimizer.h"
3333
#include "src/execution.h"
34+
#include "src/gdb-jit.h"
3435
#include "src/global-handles.h"
3536
#include "src/heap-profiler.h"
3637
#include "src/heap-snapshot-generator-inl.h"
@@ -7102,10 +7103,16 @@ Isolate* Isolate::New(const Isolate::CreateParams& params) {
71027103
if (params.entry_hook) {
71037104
isolate->set_function_entry_hook(params.entry_hook);
71047105
}
7105-
if (params.code_event_handler) {
7106+
auto code_event_handler = params.code_event_handler;
7107+
#ifdef ENABLE_GDB_JIT_INTERFACE
7108+
if (code_event_handler == nullptr && i::FLAG_gdbjit) {
7109+
code_event_handler = i::GDBJITInterface::EventHandler;
7110+
}
7111+
#endif // ENABLE_GDB_JIT_INTERFACE
7112+
if (code_event_handler) {
71067113
isolate->InitializeLoggingAndCounters();
71077114
isolate->logger()->SetCodeEventHandler(kJitCodeEventDefault,
7108-
params.code_event_handler);
7115+
code_event_handler);
71097116
}
71107117
if (params.counter_lookup_callback) {
71117118
v8_isolate->SetCounterFunction(params.counter_lookup_callback);

deps/v8/src/d8.cc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@
2626
#include "include/v8-testing.h"
2727
#endif // V8_SHARED
2828

29-
#if !defined(V8_SHARED) && defined(ENABLE_GDB_JIT_INTERFACE)
30-
#include "src/gdb-jit.h"
31-
#endif
32-
3329
#ifdef ENABLE_VTUNE_JIT_INTERFACE
3430
#include "src/third_party/vtune/v8-vtune.h"
3531
#endif
@@ -2389,11 +2385,6 @@ int Shell::Main(int argc, char* argv[]) {
23892385
Shell::array_buffer_allocator = &shell_array_buffer_allocator;
23902386
}
23912387
create_params.array_buffer_allocator = Shell::array_buffer_allocator;
2392-
#if !defined(V8_SHARED) && defined(ENABLE_GDB_JIT_INTERFACE)
2393-
if (i::FLAG_gdbjit) {
2394-
create_params.code_event_handler = i::GDBJITInterface::EventHandler;
2395-
}
2396-
#endif
23972388
#ifdef ENABLE_VTUNE_JIT_INTERFACE
23982389
create_params.code_event_handler = vTune::GetVtuneCodeEventHandler();
23992390
#endif

0 commit comments

Comments
 (0)