Commit 11e34674 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] Remove {AbortCompileJobsOnIsolate}

After https://crrev.com/c/1172285, abortion and deletion of an
{AsyncCompileJob} is the same. Hence, remove the
{AbortCompileJobsOnIsolate} method and replace all uses by
{DeleteCompileJobsOnIsolate}.

R=ahaas@chromium.org
CC=mstarzinger@chromium.org

Bug: chromium:869420
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I053dc47395a257066bbca55069d53445dc28eeb9
Reviewed-on: https://chromium-review.googlesource.com/1172288Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55092}
parent 46f000bc
...@@ -9016,7 +9016,7 @@ int Isolate::ContextDisposedNotification(bool dependant_context) { ...@@ -9016,7 +9016,7 @@ int Isolate::ContextDisposedNotification(bool dependant_context) {
if (!dependant_context) { if (!dependant_context) {
// We left the current context, we can abort all WebAssembly compilations on // We left the current context, we can abort all WebAssembly compilations on
// that isolate. // that isolate.
isolate->wasm_engine()->AbortCompileJobsOnIsolate(isolate); isolate->wasm_engine()->DeleteCompileJobsOnIsolate(isolate);
} }
// TODO(ahaas): move other non-heap activity out of the heap call. // TODO(ahaas): move other non-heap activity out of the heap call.
return isolate->heap()->NotifyContextDisposed(dependant_context); return isolate->heap()->NotifyContextDisposed(dependant_context);
......
...@@ -242,21 +242,6 @@ bool WasmEngine::HasRunningCompileJob(Isolate* isolate) { ...@@ -242,21 +242,6 @@ bool WasmEngine::HasRunningCompileJob(Isolate* isolate) {
return false; return false;
} }
void WasmEngine::AbortCompileJobsOnIsolate(Isolate* isolate) {
// Iterate over a copy of {jobs_}, because {job->Abort} modifies {jobs_}.
std::vector<AsyncCompileJob*> isolate_jobs;
{
base::LockGuard<base::Mutex> guard(&mutex_);
for (auto& entry : jobs_) {
if (entry.first->isolate() != isolate) continue;
isolate_jobs.push_back(entry.first);
}
}
for (auto* job : isolate_jobs) job->Abort();
}
void WasmEngine::DeleteCompileJobsOnIsolate(Isolate* isolate) { void WasmEngine::DeleteCompileJobsOnIsolate(Isolate* isolate) {
base::LockGuard<base::Mutex> guard(&mutex_); base::LockGuard<base::Mutex> guard(&mutex_);
for (auto it = jobs_.begin(); it != jobs_.end();) { for (auto it = jobs_.begin(); it != jobs_.end();) {
......
...@@ -123,14 +123,9 @@ class V8_EXPORT_PRIVATE WasmEngine { ...@@ -123,14 +123,9 @@ class V8_EXPORT_PRIVATE WasmEngine {
// Isolate is currently running. // Isolate is currently running.
bool HasRunningCompileJob(Isolate* isolate); bool HasRunningCompileJob(Isolate* isolate);
// Cancel all AsyncCompileJobs that belong to the given Isolate. Their // Deletes all AsyncCompileJobs that belong to the given Isolate. All
// deletion is delayed until all tasks accessing the AsyncCompileJob finish // compilation is aborted, no more callbacks will be triggered. This is used
// their execution. This is used to clean-up the isolate to be reused. // for tearing down an isolate, or to clean it up to be reused.
void AbortCompileJobsOnIsolate(Isolate* isolate);
// Deletes all AsyncCompileJobs that belong to the given Isolate. Similar to
// the above {AbortCompileJobsOnIsolate} but does not delay deletion because
// this is only used during tear-down of the Isolate.
void DeleteCompileJobsOnIsolate(Isolate* isolate); void DeleteCompileJobsOnIsolate(Isolate* isolate);
// Call on process start and exit. // Call on process start and exit.
......
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