Skip to content

Commit fb51c39

Browse files
committed
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 <[email protected]>
1 parent ec6af31 commit fb51c39

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
@@ -34,6 +34,7 @@
3434
#include "src/debug/debug.h"
3535
#include "src/deoptimizer.h"
3636
#include "src/execution.h"
37+
#include "src/gdb-jit.h"
3738
#include "src/global-handles.h"
3839
#include "src/icu_util.h"
3940
#include "src/isolate-inl.h"
@@ -7158,10 +7159,16 @@ Isolate* Isolate::New(const Isolate::CreateParams& params) {
71587159
if (params.entry_hook) {
71597160
isolate->set_function_entry_hook(params.entry_hook);
71607161
}
7161-
if (params.code_event_handler) {
7162+
auto code_event_handler = params.code_event_handler;
7163+
#ifdef ENABLE_GDB_JIT_INTERFACE
7164+
if (code_event_handler == nullptr && i::FLAG_gdbjit) {
7165+
code_event_handler = i::GDBJITInterface::EventHandler;
7166+
}
7167+
#endif // ENABLE_GDB_JIT_INTERFACE
7168+
if (code_event_handler) {
71627169
isolate->InitializeLoggingAndCounters();
71637170
isolate->logger()->SetCodeEventHandler(kJitCodeEventDefault,
7164-
params.code_event_handler);
7171+
code_event_handler);
71657172
}
71667173
if (params.counter_lookup_callback) {
71677174
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
@@ -2459,11 +2455,6 @@ int Shell::Main(int argc, char* argv[]) {
24592455
Shell::array_buffer_allocator = &shell_array_buffer_allocator;
24602456
}
24612457
create_params.array_buffer_allocator = Shell::array_buffer_allocator;
2462-
#if !defined(V8_SHARED) && defined(ENABLE_GDB_JIT_INTERFACE)
2463-
if (i::FLAG_gdbjit) {
2464-
create_params.code_event_handler = i::GDBJITInterface::EventHandler;
2465-
}
2466-
#endif
24672458
#ifdef ENABLE_VTUNE_JIT_INTERFACE
24682459
create_params.code_event_handler = vTune::GetVtuneCodeEventHandler();
24692460
#endif

0 commit comments

Comments
 (0)