Commit d86c7e48 authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[d8] Make --stress-delay-tasks a d8-specific flag

The flag is only available in d8 and should therefore not be in
flag-definitions.h.

R=clemensh@chromium.org

Bug: v8:8238
Change-Id: Idd69914cea03e736cf3b156b5961d583a7b5352c
Reviewed-on: https://chromium-review.googlesource.com/c/1349244
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57829}
parent 1bfb0247
...@@ -2895,6 +2895,10 @@ bool Shell::SetOptions(int argc, char* argv[]) { ...@@ -2895,6 +2895,10 @@ bool Shell::SetOptions(int argc, char* argv[]) {
} else if (strncmp(argv[i], "--thread-pool-size=", 19) == 0) { } else if (strncmp(argv[i], "--thread-pool-size=", 19) == 0) {
options.thread_pool_size = atoi(argv[i] + 19); options.thread_pool_size = atoi(argv[i] + 19);
argv[i] = nullptr; argv[i] = nullptr;
} else if (strcmp(argv[i], "--stress-delay-tasks") == 0) {
// Delay execution of tasks by 0-100ms randomly (based on --random-seed).
options.stress_delay_tasks = true;
argv[i] = nullptr;
} }
} }
...@@ -3355,7 +3359,7 @@ int Shell::Main(int argc, char* argv[]) { ...@@ -3355,7 +3359,7 @@ int Shell::Main(int argc, char* argv[]) {
if (i::FLAG_verify_predictable) { if (i::FLAG_verify_predictable) {
g_platform = MakePredictablePlatform(std::move(g_platform)); g_platform = MakePredictablePlatform(std::move(g_platform));
} }
if (i::FLAG_stress_delay_tasks) { if (options.stress_delay_tasks) {
int64_t random_seed = i::FLAG_fuzzer_random_seed; int64_t random_seed = i::FLAG_fuzzer_random_seed;
if (!random_seed) random_seed = i::FLAG_random_seed; if (!random_seed) random_seed = i::FLAG_random_seed;
// If random_seed is still 0 here, the {DelayedTasksPlatform} will choose a // If random_seed is still 0 here, the {DelayedTasksPlatform} will choose a
......
...@@ -386,6 +386,7 @@ class ShellOptions { ...@@ -386,6 +386,7 @@ class ShellOptions {
bool enable_os_system = false; bool enable_os_system = false;
bool quiet_load = false; bool quiet_load = false;
int thread_pool_size = 0; int thread_pool_size = 0;
bool stress_delay_tasks = false;
std::vector<const char*> arguments; std::vector<const char*> arguments;
bool include_arguments = true; bool include_arguments = true;
}; };
......
...@@ -324,11 +324,6 @@ DEFINE_BOOL(enable_one_shot_optimization, true, ...@@ -324,11 +324,6 @@ DEFINE_BOOL(enable_one_shot_optimization, true,
DEFINE_BOOL(unbox_double_arrays, true, "automatically unbox arrays of doubles") DEFINE_BOOL(unbox_double_arrays, true, "automatically unbox arrays of doubles")
DEFINE_BOOL_READONLY(string_slices, true, "use string slices") DEFINE_BOOL_READONLY(string_slices, true, "use string slices")
// Flag to stress different interleavings of tasks.
DEFINE_BOOL(
stress_delay_tasks, false,
"delay execution of tasks by 0-100ms randomly (based on --random-seed)")
// Flags for Ignition for no-snapshot builds. // Flags for Ignition for no-snapshot builds.
#undef FLAG #undef FLAG
#ifndef V8_USE_SNAPSHOT #ifndef V8_USE_SNAPSHOT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment