Commit 1e9504ba authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[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.

R=ulan@chromium.org

Bug: chromium:810739
Change-Id: Ibcd226cb44cc903f2a46e7cccf682b3938c9d408
Reviewed-on: https://chromium-review.googlesource.com/915942Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51274}
parent abac06aa
...@@ -5845,7 +5845,7 @@ void Heap::RegisterExternallyReferencedObject(Object** object) { ...@@ -5845,7 +5845,7 @@ void Heap::RegisterExternallyReferencedObject(Object** object) {
} }
void Heap::TearDown() { void Heap::TearDown() {
use_tasks_ = false; DCHECK(!use_tasks_);
#ifdef VERIFY_HEAP #ifdef VERIFY_HEAP
if (FLAG_verify_heap) { if (FLAG_verify_heap) {
Verify(); Verify();
......
...@@ -970,6 +970,8 @@ class Heap { ...@@ -970,6 +970,8 @@ class Heap {
// Returns whether SetUp has been called. // Returns whether SetUp has been called.
bool HasBeenSetUp(); bool HasBeenSetUp();
void stop_using_tasks() { use_tasks_ = false; }
bool use_tasks() const { return use_tasks_; } bool use_tasks() const { return use_tasks_; }
// =========================================================================== // ===========================================================================
......
...@@ -2608,6 +2608,8 @@ void Isolate::ClearSerializerData() { ...@@ -2608,6 +2608,8 @@ void Isolate::ClearSerializerData() {
void Isolate::Deinit() { void Isolate::Deinit() {
TRACE_ISOLATE(deinit); TRACE_ISOLATE(deinit);
// Make sure that the GC does not post any new tasks.
heap_.stop_using_tasks();
debug()->Unload(); debug()->Unload();
if (concurrent_recompilation_enabled()) { if (concurrent_recompilation_enabled()) {
......
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