deps: cherry-pick 3f4536894ac from V8 upstream
Original commit message: d8: Make in process stack dumping optional Adds a flag (--disable-in-process-stack-traces) to not install signal handlers so that e.g. ASan signal handlers will work. This flag mirrors chromium's one. R=jochen@chromium.org BUG=chromium:716235 Review-Url: https://codereview.chromium.org/2854173002 Cr-Commit-Position: refs/heads/master@{#45142} PR-URL: https://github.com/nodejs/node/pull/13985 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
0794c101ef
commit
31349e2245
5
deps/v8/include/libplatform/libplatform.h
vendored
5
deps/v8/include/libplatform/libplatform.h
vendored
@ -13,6 +13,7 @@ namespace v8 {
|
|||||||
namespace platform {
|
namespace platform {
|
||||||
|
|
||||||
enum class IdleTaskSupport { kDisabled, kEnabled };
|
enum class IdleTaskSupport { kDisabled, kEnabled };
|
||||||
|
enum class InProcessStackDumping { kDisabled, kEnabled };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a new instance of the default v8::Platform implementation.
|
* Returns a new instance of the default v8::Platform implementation.
|
||||||
@ -27,7 +28,9 @@ enum class IdleTaskSupport { kDisabled, kEnabled };
|
|||||||
*/
|
*/
|
||||||
V8_PLATFORM_EXPORT v8::Platform* CreateDefaultPlatform(
|
V8_PLATFORM_EXPORT v8::Platform* CreateDefaultPlatform(
|
||||||
int thread_pool_size = 0,
|
int thread_pool_size = 0,
|
||||||
IdleTaskSupport idle_task_support = IdleTaskSupport::kDisabled);
|
IdleTaskSupport idle_task_support = IdleTaskSupport::kDisabled,
|
||||||
|
InProcessStackDumping in_process_stack_dumping =
|
||||||
|
InProcessStackDumping::kEnabled);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pumps the message loop for the given isolate.
|
* Pumps the message loop for the given isolate.
|
||||||
|
12
deps/v8/src/d8.cc
vendored
12
deps/v8/src/d8.cc
vendored
@ -2575,6 +2575,9 @@ bool Shell::SetOptions(int argc, char* argv[]) {
|
|||||||
} else if (strncmp(argv[i], "--lcov=", 7) == 0) {
|
} else if (strncmp(argv[i], "--lcov=", 7) == 0) {
|
||||||
options.lcov_file = argv[i] + 7;
|
options.lcov_file = argv[i] + 7;
|
||||||
argv[i] = NULL;
|
argv[i] = NULL;
|
||||||
|
} else if (strcmp(argv[i], "--disable-in-process-stack-traces") == 0) {
|
||||||
|
options.disable_in_process_stack_traces = true;
|
||||||
|
argv[i] = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2998,10 +3001,17 @@ int Shell::Main(int argc, char* argv[]) {
|
|||||||
#endif // defined(_WIN32) || defined(_WIN64)
|
#endif // defined(_WIN32) || defined(_WIN64)
|
||||||
if (!SetOptions(argc, argv)) return 1;
|
if (!SetOptions(argc, argv)) return 1;
|
||||||
v8::V8::InitializeICUDefaultLocation(argv[0], options.icu_data_file);
|
v8::V8::InitializeICUDefaultLocation(argv[0], options.icu_data_file);
|
||||||
|
|
||||||
|
v8::platform::InProcessStackDumping in_process_stack_dumping =
|
||||||
|
options.disable_in_process_stack_traces
|
||||||
|
? v8::platform::InProcessStackDumping::kDisabled
|
||||||
|
: v8::platform::InProcessStackDumping::kEnabled;
|
||||||
|
|
||||||
g_platform = i::FLAG_verify_predictable
|
g_platform = i::FLAG_verify_predictable
|
||||||
? new PredictablePlatform()
|
? new PredictablePlatform()
|
||||||
: v8::platform::CreateDefaultPlatform(
|
: v8::platform::CreateDefaultPlatform(
|
||||||
0, v8::platform::IdleTaskSupport::kEnabled);
|
0, v8::platform::IdleTaskSupport::kEnabled,
|
||||||
|
in_process_stack_dumping);
|
||||||
|
|
||||||
platform::tracing::TracingController* tracing_controller;
|
platform::tracing::TracingController* tracing_controller;
|
||||||
if (options.trace_enabled) {
|
if (options.trace_enabled) {
|
||||||
|
4
deps/v8/src/d8.h
vendored
4
deps/v8/src/d8.h
vendored
@ -304,7 +304,8 @@ class ShellOptions {
|
|||||||
snapshot_blob(NULL),
|
snapshot_blob(NULL),
|
||||||
trace_enabled(false),
|
trace_enabled(false),
|
||||||
trace_config(NULL),
|
trace_config(NULL),
|
||||||
lcov_file(NULL) {}
|
lcov_file(NULL),
|
||||||
|
disable_in_process_stack_traces(false) {}
|
||||||
|
|
||||||
~ShellOptions() {
|
~ShellOptions() {
|
||||||
delete[] isolate_sources;
|
delete[] isolate_sources;
|
||||||
@ -336,6 +337,7 @@ class ShellOptions {
|
|||||||
bool trace_enabled;
|
bool trace_enabled;
|
||||||
const char* trace_config;
|
const char* trace_config;
|
||||||
const char* lcov_file;
|
const char* lcov_file;
|
||||||
|
bool disable_in_process_stack_traces;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Shell : public i::AllStatic {
|
class Shell : public i::AllStatic {
|
||||||
|
9
deps/v8/src/libplatform/default-platform.cc
vendored
9
deps/v8/src/libplatform/default-platform.cc
vendored
@ -29,9 +29,12 @@ void PrintStackTrace() {
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
v8::Platform* CreateDefaultPlatform(int thread_pool_size,
|
v8::Platform* CreateDefaultPlatform(
|
||||||
IdleTaskSupport idle_task_support) {
|
int thread_pool_size, IdleTaskSupport idle_task_support,
|
||||||
v8::base::debug::EnableInProcessStackDumping();
|
InProcessStackDumping in_process_stack_dumping) {
|
||||||
|
if (in_process_stack_dumping == InProcessStackDumping::kEnabled) {
|
||||||
|
v8::base::debug::EnableInProcessStackDumping();
|
||||||
|
}
|
||||||
DefaultPlatform* platform = new DefaultPlatform(idle_task_support);
|
DefaultPlatform* platform = new DefaultPlatform(idle_task_support);
|
||||||
platform->SetThreadPoolSize(thread_pool_size);
|
platform->SetThreadPoolSize(thread_pool_size);
|
||||||
platform->EnsureInitialized();
|
platform->EnsureInitialized();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user