| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0794c10 commit 31349e2
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,6 +13,7 @@ namespace v8 { | |||
| 13 | 13 | namespace platform { | |
| 14 | 14 | ||
| 15 | 15 | enum class IdleTaskSupport { kDisabled, kEnabled }; | |
| 16 | + enum class InProcessStackDumping { kDisabled, kEnabled }; | ||
| 16 | 17 | ||
| 17 | 18 | /** | |
| 18 | 19 | * Returns a new instance of the default v8::Platform implementation. | |
@@ -27,7 +28,9 @@ enum class IdleTaskSupport { kDisabled, kEnabled }; | |||
| 27 | 28 | */ | |
| 28 | 29 | V8_PLATFORM_EXPORT v8::Platform* CreateDefaultPlatform( | |
| 29 | 30 | int thread_pool_size = 0, | |
| 30 | - IdleTaskSupport idle_task_support = IdleTaskSupport::kDisabled); | ||
| 31 | + IdleTaskSupport idle_task_support = IdleTaskSupport::kDisabled, | ||
| 32 | + InProcessStackDumping in_process_stack_dumping = | ||
| 33 | + InProcessStackDumping::kEnabled); | ||
| 31 | 34 | ||
| 32 | 35 | /** | |
| 33 | 36 | * Pumps the message loop for the given isolate. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2575,6 +2575,9 @@ bool Shell::SetOptions(int argc, char* argv[]) { | |||
| 2575 | 2575 | } else if (strncmp(argv[i], "--lcov=", 7) == 0) { | |
| 2576 | 2576 | options.lcov_file = argv[i] + 7; | |
| 2577 | 2577 | argv[i] = NULL; | |
| 2578 | + } else if (strcmp(argv[i], "--disable-in-process-stack-traces") == 0) { | ||
| 2579 | + options.disable_in_process_stack_traces = true; | ||
| 2580 | + argv[i] = NULL; | ||
| 2578 | 2581 | } | |
| 2579 | 2582 | } | |
| 2580 | 2583 | ||
@@ -2998,10 +3001,17 @@ int Shell::Main(int argc, char* argv[]) { | |||
| 2998 | 3001 | #endif // defined(_WIN32) || defined(_WIN64) | |
| 2999 | 3002 | if (!SetOptions(argc, argv)) return 1; | |
| 3000 | 3003 | v8::V8::InitializeICUDefaultLocation(argv[0], options.icu_data_file); | |
| 3004 | + | ||
| 3005 | + v8::platform::InProcessStackDumping in_process_stack_dumping = | ||
| 3006 | + options.disable_in_process_stack_traces | ||
| 3007 | + ? v8::platform::InProcessStackDumping::kDisabled | ||
| 3008 | + : v8::platform::InProcessStackDumping::kEnabled; | ||
| 3009 | + | ||
| 3001 | 3010 | g_platform = i::FLAG_verify_predictable | |
| 3002 | 3011 | ? new PredictablePlatform() | |
| 3003 | 3012 | : v8::platform::CreateDefaultPlatform( | |
| 3004 | - 0, v8::platform::IdleTaskSupport::kEnabled); | ||
| 3013 | + 0, v8::platform::IdleTaskSupport::kEnabled, | ||
| 3014 | + in_process_stack_dumping); | ||
| 3005 | 3015 | ||
| 3006 | 3016 | platform::tracing::TracingController* tracing_controller; | |
| 3007 | 3017 | if (options.trace_enabled) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -304,7 +304,8 @@ class ShellOptions { | |||
| 304 | 304 | snapshot_blob(NULL), | |
| 305 | 305 | trace_enabled(false), | |
| 306 | 306 | trace_config(NULL), | |
| 307 | - lcov_file(NULL) {} | ||
| 307 | + lcov_file(NULL), | ||
| 308 | + disable_in_process_stack_traces(false) {} | ||
| 308 | 309 | ||
| 309 | 310 | ~ShellOptions() { | |
| 310 | 311 | delete[] isolate_sources; | |
@@ -336,6 +337,7 @@ class ShellOptions { | |||
| 336 | 337 | bool trace_enabled; | |
| 337 | 338 | const char* trace_config; | |
| 338 | 339 | const char* lcov_file; | |
| 340 | + bool disable_in_process_stack_traces; | ||
| 339 | 341 | }; | |
| 340 | 342 | ||
| 341 | 343 | class Shell : public i::AllStatic { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,9 +29,12 @@ void PrintStackTrace() { | |||
| 29 | 29 | ||
| 30 | 30 | } // namespace | |
| 31 | 31 | ||
| 32 | - v8::Platform* CreateDefaultPlatform(int thread_pool_size, | ||
| 33 | - IdleTaskSupport idle_task_support) { | ||
| 34 | - v8::base::debug::EnableInProcessStackDumping(); | ||
| 32 | + v8::Platform* CreateDefaultPlatform( | ||
| 33 | + int thread_pool_size, IdleTaskSupport idle_task_support, | ||
| 34 | + InProcessStackDumping in_process_stack_dumping) { | ||
| 35 | + if (in_process_stack_dumping == InProcessStackDumping::kEnabled) { | ||
| 36 | + v8::base::debug::EnableInProcessStackDumping(); | ||
| 37 | + } | ||
| 35 | 38 | DefaultPlatform* platform = new DefaultPlatform(idle_task_support); | |
| 36 | 39 | platform->SetThreadPoolSize(thread_pool_size); | |
| 37 | 40 | platform->EnsureInitialized(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments