Commit c6930923 authored by Hannes Payer's avatar Hannes Payer Committed by Commit Bot

[heap] Fix semaphore flaky crasher in ScavengerCollector.

Bug: v8:8228
Change-Id: I5a666d3bfebe4bce9e06cc6a7fd82aac1fbf2a61
Reviewed-on: https://chromium-review.googlesource.com/1249144Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56269}
parent c9bfddf2
...@@ -1925,8 +1925,7 @@ void Heap::Scavenge() { ...@@ -1925,8 +1925,7 @@ void Heap::Scavenge() {
// Implements Cheney's copying algorithm // Implements Cheney's copying algorithm
LOG(isolate_, ResourceEvent("scavenge", "begin")); LOG(isolate_, ResourceEvent("scavenge", "begin"));
ScavengerCollector scavenger_collector(this); scavenger_collector_->CollectGarbage();
scavenger_collector.CollectGarbage();
LOG(isolate_, ResourceEvent("scavenge", "end")); LOG(isolate_, ResourceEvent("scavenge", "end"));
...@@ -4348,6 +4347,9 @@ void Heap::SetUp() { ...@@ -4348,6 +4347,9 @@ void Heap::SetUp() {
heap_controller_ = new HeapController(this); heap_controller_ = new HeapController(this);
mark_compact_collector_ = new MarkCompactCollector(this); mark_compact_collector_ = new MarkCompactCollector(this);
scavenger_collector_ = new ScavengerCollector(this);
incremental_marking_ = incremental_marking_ =
new IncrementalMarking(this, mark_compact_collector_->marking_worklist(), new IncrementalMarking(this, mark_compact_collector_->marking_worklist(),
mark_compact_collector_->weak_objects()); mark_compact_collector_->weak_objects());
...@@ -4609,6 +4611,11 @@ void Heap::TearDown() { ...@@ -4609,6 +4611,11 @@ void Heap::TearDown() {
} }
#endif // ENABLE_MINOR_MC #endif // ENABLE_MINOR_MC
if (scavenger_collector_ != nullptr) {
delete scavenger_collector_;
scavenger_collector_ = nullptr;
}
if (array_buffer_collector_ != nullptr) { if (array_buffer_collector_ != nullptr) {
delete array_buffer_collector_; delete array_buffer_collector_;
array_buffer_collector_ = nullptr; array_buffer_collector_ = nullptr;
......
...@@ -196,6 +196,7 @@ class PagedSpace; ...@@ -196,6 +196,7 @@ class PagedSpace;
class RootVisitor; class RootVisitor;
class ScavengeJob; class ScavengeJob;
class Scavenger; class Scavenger;
class ScavengerCollector;
class Space; class Space;
class StoreBuffer; class StoreBuffer;
class StressScavengeObserver; class StressScavengeObserver;
...@@ -2102,6 +2103,7 @@ class Heap { ...@@ -2102,6 +2103,7 @@ class Heap {
GCTracer* tracer_ = nullptr; GCTracer* tracer_ = nullptr;
MarkCompactCollector* mark_compact_collector_ = nullptr; MarkCompactCollector* mark_compact_collector_ = nullptr;
MinorMarkCompactCollector* minor_mark_compact_collector_ = nullptr; MinorMarkCompactCollector* minor_mark_compact_collector_ = nullptr;
ScavengerCollector* scavenger_collector_ = nullptr;
ArrayBufferCollector* array_buffer_collector_ = nullptr; ArrayBufferCollector* array_buffer_collector_ = nullptr;
MemoryAllocator* memory_allocator_ = nullptr; MemoryAllocator* memory_allocator_ = nullptr;
StoreBuffer* store_buffer_ = nullptr; StoreBuffer* store_buffer_ = nullptr;
......
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