Skip to content

Commit aadf356

Browse files
bnoordhuisMyles Borins
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 16216a8 commit aadf356

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
@@ -29,6 +29,7 @@
2929
#include "src/debug.h"
3030
#include "src/deoptimizer.h"
3131
#include "src/execution.h"
32+
#include "src/gdb-jit.h"
3233
#include "src/global-handles.h"
3334
#include "src/heap/spaces.h"
3435
#include "src/heap-profiler.h"
@@ -7118,10 +7119,16 @@ Isolate* Isolate::New(const Isolate::CreateParams& params) {
71187119
if (params.entry_hook) {
71197120
isolate->set_function_entry_hook(params.entry_hook);
71207121
}
7121-
if (params.code_event_handler) {
7122+
auto code_event_handler = params.code_event_handler;
7123+
#ifdef ENABLE_GDB_JIT_INTERFACE
7124+
if (code_event_handler == nullptr && i::FLAG_gdbjit) {
7125+
code_event_handler = i::GDBJITInterface::EventHandler;
7126+
}
7127+
#endif // ENABLE_GDB_JIT_INTERFACE
7128+
if (code_event_handler) {
71227129
isolate->InitializeLoggingAndCounters();
71237130
isolate->logger()->SetCodeEventHandler(kJitCodeEventDefault,
7124-
params.code_event_handler);
7131+
code_event_handler);
71257132
}
71267133
if (params.counter_lookup_callback) {
71277134
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
@@ -25,10 +25,6 @@
2525
#include "include/v8-testing.h"
2626
#endif // V8_SHARED
2727

28-
#if !defined(V8_SHARED) && defined(ENABLE_GDB_JIT_INTERFACE)
29-
#include "src/gdb-jit.h"
30-
#endif
31-
3228
#ifdef ENABLE_VTUNE_JIT_INTERFACE
3329
#include "src/third_party/vtune/v8-vtune.h"
3430
#endif
@@ -2331,11 +2327,6 @@ int Shell::Main(int argc, char* argv[]) {
23312327
Shell::array_buffer_allocator = &shell_array_buffer_allocator;
23322328
}
23332329
create_params.array_buffer_allocator = Shell::array_buffer_allocator;
2334-
#if !defined(V8_SHARED) && defined(ENABLE_GDB_JIT_INTERFACE)
2335-
if (i::FLAG_gdbjit) {
2336-
create_params.code_event_handler = i::GDBJITInterface::EventHandler;
2337-
}
2338-
#endif
23392330
#ifdef ENABLE_VTUNE_JIT_INTERFACE
23402331
create_params.code_event_handler = vTune::GetVtuneCodeEventHandler();
23412332
#endif

0 commit comments

Comments
 (0)