Commit 6aadf0e0 authored by Victor Gomes's avatar Victor Gomes Committed by V8 LUCI CQ

[baseline] Add max threads flags for CSP

Bug: v8:12054
Change-Id: I49238fe673858b60c2a2a935ed1f45f465269216
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3308707
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78187}
parent 2e17aaca
......@@ -9,6 +9,8 @@
#include "src/flags/flags.h"
#if ENABLE_SPARKPLUG
#include <algorithm>
#include "src/baseline/baseline-compiler.h"
#include "src/codegen/compiler.h"
#include "src/execution/isolate.h"
......@@ -181,6 +183,10 @@ class ConcurrentBaselineCompiler {
}
size_t GetMaxConcurrency(size_t worker_count) const override {
size_t max_threads = FLAG_concurrent_sparkplug_max_threads;
if (max_threads > 0) {
return std::min(max_threads, incoming_queue_->size());
}
return incoming_queue_->size();
}
......
......@@ -709,6 +709,9 @@ DEFINE_BOOL_READONLY(concurrent_sparkplug, false,
#else
DEFINE_BOOL(concurrent_sparkplug, false,
"compile Sparkplug code in a background thread")
DEFINE_UINT(
concurrent_sparkplug_max_threads, 0,
"max number of threads that concurrent Sparkplug can use (0 for unbounded)")
DEFINE_WEAK_IMPLICATION(future, concurrent_sparkplug)
DEFINE_NEG_IMPLICATION(predictable, concurrent_sparkplug)
DEFINE_NEG_IMPLICATION(single_threaded, concurrent_sparkplug)
......
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