Skip to content

Commit c2a6be0

Browse files
gahaasCommit Bot
authored andcommitted
Merged: [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. NOTRY=true NOPRESUBMIT=true NOTREECHECKS=true R=​[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-Original-Commit-Position: refs/heads/master@{#51274}(cherry picked from commit 1e9504b) Reviewed-on: https://chromium-review.googlesource.com/958961 Cr-Commit-Position: refs/branch-heads/6.5@{#69} Cr-Branched-From: 73c55f5-refs/heads/6.5.254@{#1} Cr-Branched-From: 594a1a0-refs/heads/master@{#50664}
1 parent 333e637 commit c2a6be0

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
@@ -5745,7 +5745,7 @@ void Heap::RegisterExternallyReferencedObject(Object** object) {
57455745
}
57465746

57475747
void Heap::TearDown() {
5748-
use_tasks_ = false;
5748+
DCHECK(!use_tasks_);
57495749
#ifdef VERIFY_HEAP
57505750
if (FLAG_verify_heap) {
57515751
Verify();

src/heap/heap.h

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

969+
void stop_using_tasks() { use_tasks_ = false; }
970+
969971
bool use_tasks() const { return use_tasks_; }
970972

971973
// ===========================================================================

src/isolate.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2617,6 +2617,8 @@ void Isolate::ClearSerializerData() {
26172617
void Isolate::Deinit() {
26182618
TRACE_ISOLATE(deinit);
26192619

2620+
// Make sure that the GC does not post any new tasks.
2621+
heap_.stop_using_tasks();
26202622
debug()->Unload();
26212623

26222624
if (concurrent_recompilation_enabled()) {

0 commit comments

Comments
 (0)