Skip to content

Commit 1e9504b

Browse files
gahaasCommit Bot
authored andcommitted
[heap] Make setting use_tasks_ explicit
At the moment the flag is set too late, it is possible that the GC still tries to post tasks in Isolate::Deinit when the isolate is already disconnected from the platform, see the referenced bug. [email protected] Bug: chromium:810739 Change-Id: Ibcd226cb44cc903f2a46e7cccf682b3938c9d408 Reviewed-on: https://chromium-review.googlesource.com/915942 Reviewed-by: Ulan Degenbaev <[email protected]> Commit-Queue: Andreas Haas <[email protected]> Cr-Commit-Position: refs/heads/master@{#51274}
1 parent abac06a commit 1e9504b

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/heap/heap.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5845,7 +5845,7 @@ void Heap::RegisterExternallyReferencedObject(Object** object) {
58455845
}
58465846

58475847
void Heap::TearDown() {
5848-
use_tasks_ = false;
5848+
DCHECK(!use_tasks_);
58495849
#ifdef VERIFY_HEAP
58505850
if (FLAG_verify_heap) {
58515851
Verify();

src/heap/heap.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,8 @@ class Heap {
970970
// Returns whether SetUp has been called.
971971
bool HasBeenSetUp();
972972

973+
void stop_using_tasks() { use_tasks_ = false; }
974+
973975
bool use_tasks() const { return use_tasks_; }
974976

975977
// ===========================================================================

src/isolate.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2608,6 +2608,8 @@ void Isolate::ClearSerializerData() {
26082608
void Isolate::Deinit() {
26092609
TRACE_ISOLATE(deinit);
26102610

2611+
// Make sure that the GC does not post any new tasks.
2612+
heap_.stop_using_tasks();
26112613
debug()->Unload();
26122614

26132615
if (concurrent_recompilation_enabled()) {

0 commit comments

Comments
 (0)