summaryrefslogtreecommitdiffstats
path: root/js/src/vm/HelperThreadState.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /js/src/vm/HelperThreadState.h
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/vm/HelperThreadState.h')
-rw-r--r--js/src/vm/HelperThreadState.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/js/src/vm/HelperThreadState.h b/js/src/vm/HelperThreadState.h
index 8e601a385c..a43efef7af 100644
--- a/js/src/vm/HelperThreadState.h
+++ b/js/src/vm/HelperThreadState.h
@@ -26,13 +26,12 @@
#include <stdint.h> // uint32_t, uint64_t
#include <utility> // std::move
-#include "ds/Fifo.h" // Fifo
-#include "frontend/CompilationStencil.h" // frontend::CompilationStencil
-#include "gc/GCRuntime.h" // gc::GCRuntime
-#include "js/AllocPolicy.h" // SystemAllocPolicy
-#include "js/CompileOptions.h" // JS::ReadOnlyCompileOptions
-#include "js/experimental/CompileScript.h" // JS::CompilationStorage
-#include "js/experimental/JSStencil.h" // JS::InstantiationStorage
+#include "ds/Fifo.h" // Fifo
+#include "frontend/CompilationStencil.h" // frontend::CompilationStencil
+#include "gc/GCRuntime.h" // gc::GCRuntime
+#include "js/AllocPolicy.h" // SystemAllocPolicy
+#include "js/CompileOptions.h" // JS::ReadOnlyCompileOptions
+#include "js/experimental/JSStencil.h" // JS::InstantiationStorage
#include "js/HelperThreadAPI.h" // JS::HelperThreadTaskCallback, JS::DispatchReason
#include "js/MemoryMetrics.h" // JS::GlobalStats
#include "js/ProfilingStack.h" // JS::RegisterThreadCallback, JS::UnregisterThreadCallback
@@ -115,13 +114,19 @@ class GlobalHelperThreadState {
PromiseHelperTaskVector;
// Count of running task by each threadType.
- mozilla::EnumeratedArray<ThreadType, ThreadType::THREAD_TYPE_MAX, size_t>
+ mozilla::EnumeratedArray<ThreadType, size_t,
+ size_t(ThreadType::THREAD_TYPE_MAX)>
runningTaskCount;
size_t totalCountRunningTasks;
WriteOnceData<JS::RegisterThreadCallback> registerThread;
WriteOnceData<JS::UnregisterThreadCallback> unregisterThread;
+ // Count of helper threads 'reserved' for parallel marking. This is used to
+ // prevent too many runtimes trying to mark in parallel at once. Does not stop
+ // threads from being used for other kinds of task, including GC tasks.
+ HelperThreadLockData<size_t> gcParallelMarkingThreads;
+
private:
// The lists below are all protected by |lock|.