Index: src/heap/heap.cc |
diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
index 5499bd0784769847f2415d5f92f3ce9a4c1188b4..ea25bdb69869208c12021b3c6ba1bf4e663efd56 100644 |
--- a/src/heap/heap.cc |
+++ b/src/heap/heap.cc |
@@ -160,6 +160,7 @@ |
gc_callbacks_depth_(0), |
deserialization_complete_(false), |
strong_roots_list_(NULL), |
+ array_buffer_tracker_(NULL), |
heap_iterator_depth_(0), |
force_oom_(false) { |
// Allow build-time customization of the max semispace size. Building |
@@ -1625,6 +1626,8 @@ |
scavenge_collector_->SelectScavengingVisitorsTable(); |
+ array_buffer_tracker()->PrepareDiscoveryInNewSpace(); |
+ |
// Flip the semispaces. After flipping, to space is empty, from space has |
// live objects. |
new_space_.Flip(); |
@@ -1744,7 +1747,7 @@ |
// Set age mark. |
new_space_.set_age_mark(new_space_.top()); |
- ArrayBufferTracker::FreeDeadInNewSpace(this); |
+ array_buffer_tracker()->FreeDead(true); |
// Update how much has survived scavenge. |
IncrementYoungSurvivorsCounter(static_cast<int>( |
@@ -2024,12 +2027,12 @@ |
void Heap::RegisterNewArrayBuffer(JSArrayBuffer* buffer) { |
- ArrayBufferTracker::RegisterNew(this, buffer); |
+ return array_buffer_tracker()->RegisterNew(buffer); |
} |
void Heap::UnregisterArrayBuffer(JSArrayBuffer* buffer) { |
- ArrayBufferTracker::Unregister(this, buffer); |
+ return array_buffer_tracker()->Unregister(buffer); |
} |
@@ -5322,6 +5325,8 @@ |
scavenge_job_ = new ScavengeJob(); |
+ array_buffer_tracker_ = new ArrayBufferTracker(this); |
+ |
LOG(isolate_, IntPtrTEvent("heap-capacity", Capacity())); |
LOG(isolate_, IntPtrTEvent("heap-available", Available())); |
@@ -5480,6 +5485,9 @@ |
delete scavenge_job_; |
scavenge_job_ = nullptr; |
+ |
+ delete array_buffer_tracker_; |
+ array_buffer_tracker_ = nullptr; |
isolate_->global_handles()->TearDown(); |