diff --git a/src/wasm/module-compiler.cc b/src/wasm/module-compiler.cc index 87a9c32da4..8f266d59b7 100644 --- a/src/wasm/module-compiler.cc +++ b/src/wasm/module-compiler.cc @@ -87,7 +87,6 @@ class CompilationState { void ScheduleUnitForFinishing(std::unique_ptr unit, WasmCompilationUnit::CompilationMode mode); - void CancelAndWait(); void OnBackgroundTaskStopped(); void RestartBackgroundTasks(size_t max = std::numeric_limits::max()); // Only one foreground thread (finisher) is allowed to run at a time. @@ -154,8 +153,6 @@ class CompilationState { // the given {ErrorThrower} can be done at most once. std::vector> callbacks_; - // When canceling the background_task_manager_, use {CancelAndWait} on - // the CompilationState in order to cleanly clean up. CancelableTaskManager background_task_manager_; CancelableTaskManager foreground_task_manager_; std::shared_ptr foreground_task_runner_; @@ -2734,7 +2731,7 @@ CompilationState::CompilationState(internal::Isolate* isolate, } CompilationState::~CompilationState() { - CancelAndWait(); + background_task_manager_.CancelAndWait(); foreground_task_manager_.CancelAndWait(); NotifyOnEvent(CompilationEvent::kDestroyed, nullptr); } @@ -2823,7 +2820,7 @@ void CompilationState::OnFinishedUnit() { --outstanding_units_; if (outstanding_units_ == 0) { - CancelAndWait(); + background_task_manager_.CancelAndWait(); baseline_compilation_finished_ = true; DCHECK(compile_mode_ == CompileMode::kRegular || @@ -2867,10 +2864,6 @@ void CompilationState::ScheduleUnitForFinishing( } } -void CompilationState::CancelAndWait() { - background_task_manager_.CancelAndWait(); -} - void CompilationState::OnBackgroundTaskStopped() { base::LockGuard guard(&mutex_); DCHECK_LE(1, num_background_tasks_); @@ -2924,7 +2917,7 @@ void CompilationState::Abort() { base::LockGuard guard(&mutex_); failed_ = true; } - CancelAndWait(); + background_task_manager_.CancelAndWait(); } void CompilationState::NotifyOnEvent(CompilationEvent event,