Commit 38e67f18 authored by Dominik Inführ's avatar Dominik Inführ Committed by V8 LUCI CQ

[execution] Cancel concurrent tasks earlier

We should cancel tasks before we destroy objects like the string table
from the isolate. So far our concurrent tasks didn't interact with
the isolate much, but we now have tasks that can e.g. access the heap
concurrently. While this is not strictly necessary at the moment, I want
to see whether there might be problems with that approach. In the future
this order will be required e.g. for baseline batch compilation tasks.

Bug: v8:11708
Change-Id: I80d8a9447bb51e9ae84ed9b6c0da6183290dc70b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3164338
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76989}
parent f61ce6b7
......@@ -3138,6 +3138,11 @@ void Isolate::Deinit() {
// not cause a GC.
heap_.StartTearDown();
// This stops cancelable tasks (i.e. concurrent marking tasks).
// Stop concurrent tasks before destroying resources since they might still
// use those.
cancelable_task_manager()->CancelAndWait();
ReleaseSharedPtrs();
string_table_.reset();
......@@ -3159,9 +3164,6 @@ void Isolate::Deinit() {
delete baseline_batch_compiler_;
baseline_batch_compiler_ = nullptr;
// This stops cancelable tasks (i.e. concurrent marking tasks)
cancelable_task_manager()->CancelAndWait();
// After all concurrent tasks are stopped, we know for sure that stats aren't
// updated anymore.
DumpAndResetStats();
......
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