@@ -166,13 +166,9 @@ class GlobalHelperThreadState {
166
166
// pool is used.
167
167
JS::HelperThreadTaskCallback dispatchTaskCallback = nullptr ;
168
168
169
- // The number of tasks dispatched to the external thread pool that have not
170
- // started running yet.
171
- size_t externalTasksPending_ = 0 ;
172
-
173
169
bool isInitialized_ = false ;
174
170
175
- bool useInternalThreadPool_ = true ;
171
+ bool useInternalThreadPool_;
176
172
177
173
ParseTask* removeFinishedParseTask (JSContext* cx, ParseTaskKind kind,
178
174
JS::OffThreadToken* token);
@@ -206,8 +202,8 @@ class GlobalHelperThreadState {
206
202
[[nodiscard]] bool ensureInitialized ();
207
203
[[nodiscard]] bool ensureThreadCount (size_t count,
208
204
const AutoLockHelperThreadState& lock);
209
- void finish (AutoLockHelperThreadState& lock );
210
- void finishThreads (AutoLockHelperThreadState& lock );
205
+ void finish ();
206
+ void finishThreads ();
211
207
212
208
void setCpuCount (size_t count);
213
209
@@ -239,9 +235,7 @@ class GlobalHelperThreadState {
239
235
mozilla::TimeDuration timeout = mozilla::TimeDuration::Forever());
240
236
void notifyAll (CondVar which, const AutoLockHelperThreadState&);
241
237
242
- bool useInternalThreadPool (const AutoLockHelperThreadState& lock) const {
243
- return useInternalThreadPool_;
244
- }
238
+ bool useInternalThreadPool (const AutoLockHelperThreadState& locked);
245
239
246
240
bool isTerminating (const AutoLockHelperThreadState& locked) const {
247
241
return terminating_;
@@ -344,19 +338,6 @@ class GlobalHelperThreadState {
344
338
return helperTasks_;
345
339
}
346
340
347
- bool canStartWasmCompile (const AutoLockHelperThreadState& lock,
348
- wasm::CompileMode mode);
349
-
350
- bool canStartWasmTier1CompileTask (const AutoLockHelperThreadState& lock);
351
- bool canStartWasmTier2CompileTask (const AutoLockHelperThreadState& lock);
352
- bool canStartWasmTier2GeneratorTask (const AutoLockHelperThreadState& lock);
353
- bool canStartPromiseHelperTask (const AutoLockHelperThreadState& lock);
354
- bool canStartIonCompileTask (const AutoLockHelperThreadState& lock);
355
- bool canStartIonFreeTask (const AutoLockHelperThreadState& lock);
356
- bool canStartParseTask (const AutoLockHelperThreadState& lock);
357
- bool canStartCompressionTask (const AutoLockHelperThreadState& lock);
358
- bool canStartGCParallelTask (const AutoLockHelperThreadState& lock);
359
-
360
341
HelperThreadTask* maybeGetWasmCompile (const AutoLockHelperThreadState& lock,
361
342
wasm::CompileMode mode);
362
343
@@ -421,9 +402,9 @@ class GlobalHelperThreadState {
421
402
JSContext* cx, JS::OffThreadToken* token);
422
403
423
404
bool hasActiveThreads (const AutoLockHelperThreadState&);
424
- bool canStartTasks (const AutoLockHelperThreadState& locked);
425
- void waitForAllTasks ();
426
- void waitForAllTasksLocked (AutoLockHelperThreadState&);
405
+ bool hasQueuedTasks (const AutoLockHelperThreadState& locked);
406
+ void waitForAllThreads ();
407
+ void waitForAllThreadsLocked (AutoLockHelperThreadState&);
427
408
428
409
bool checkTaskThreadLimit (ThreadType threadType, size_t maxThreads,
429
410
bool isMaster,
@@ -454,8 +435,6 @@ class GlobalHelperThreadState {
454
435
455
436
void dispatch (const AutoLockHelperThreadState& locked);
456
437
457
- void runTask (HelperThreadTask* task, AutoLockHelperThreadState& lock);
458
-
459
438
public:
460
439
bool submitTask (wasm::UniqueTier2GeneratorTask task);
461
440
bool submitTask (wasm::CompileTask* task, wasm::CompileMode mode);
@@ -471,7 +450,6 @@ class GlobalHelperThreadState {
471
450
bool submitTask (GCParallelTask* task,
472
451
const AutoLockHelperThreadState& locked);
473
452
void runTaskLocked (HelperThreadTask* task, AutoLockHelperThreadState& lock);
474
- void runTaskFromExternalThread (AutoLockHelperThreadState& lock);
475
453
476
454
using Selector = HelperThreadTask* (
477
455
GlobalHelperThreadState::*)(const AutoLockHelperThreadState&);
0 commit comments