Index: src/heap/heap.cc |
diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
index 50e1efc15039e284039c6e85e8390a57348aa256..0d753e2227654db5244900aeb958802cf242201e 100644 |
--- a/src/heap/heap.cc |
+++ b/src/heap/heap.cc |
@@ -162,8 +162,7 @@ |
deserialization_complete_(false), |
strong_roots_list_(NULL), |
heap_iterator_depth_(0), |
- force_oom_(false), |
- array_buffer_tracker_(nullptr) { |
+ force_oom_(false) { |
// Allow build-time customization of the max semispace size. Building |
// V8 with snapshots and a non-default max semispace size is much |
// easier if you can define it as part of the build environment. |
@@ -313,21 +312,6 @@ |
return SCAVENGER; |
} |
-size_t Heap::external_memory_retained_from_new_space() { |
- // This is just an approximation. |
- return array_buffer_tracker()->retained_from_new_space(); |
-} |
- |
-bool Heap::ShouldDoScavengeForReducingExternalMemory() { |
- size_t retained_new_space = external_memory_retained_from_new_space(); |
- size_t retained_old_space = external_memory() - retained_new_space; |
- float new_space_ratio = |
- static_cast<float>(new_space_.SizeOfObjects()) / retained_new_space; |
- float old_space_ratio = |
- static_cast<float>(old_space_->SizeOfObjects()) / retained_old_space; |
- // TODO(mlippautz): Add some lower bound. |
- return new_space_ratio > old_space_ratio; |
-} |
// TODO(1238405): Combine the infrastructure for --heap-stats and |
// --log-gc to avoid the complicated preprocessor and flag testing. |
@@ -1732,7 +1716,7 @@ |
// Set age mark. |
new_space_.set_age_mark(new_space_.top()); |
- array_buffer_tracker()->FreeDeadInNewSpace(); |
+ ArrayBufferTracker::FreeDeadInNewSpace(this); |
// Update how much has survived scavenge. |
IncrementYoungSurvivorsCounter(static_cast<int>( |
@@ -2018,12 +2002,12 @@ |
void Heap::RegisterNewArrayBuffer(JSArrayBuffer* buffer) { |
- array_buffer_tracker()->RegisterNew(buffer); |
+ ArrayBufferTracker::RegisterNew(this, buffer); |
} |
void Heap::UnregisterArrayBuffer(JSArrayBuffer* buffer) { |
- array_buffer_tracker()->Unregister(buffer); |
+ ArrayBufferTracker::Unregister(this, buffer); |
} |
@@ -5374,8 +5358,6 @@ |
*this, ScavengeJob::kBytesAllocatedBeforeNextIdleTask); |
new_space()->AddAllocationObserver(idle_scavenge_observer_); |
- array_buffer_tracker_ = new ArrayBufferTracker(this); |
- |
return true; |
} |
@@ -5575,9 +5557,6 @@ |
delete store_buffer_; |
store_buffer_ = nullptr; |
- |
- delete array_buffer_tracker_; |
- array_buffer_tracker_ = nullptr; |
delete memory_allocator_; |
memory_allocator_ = nullptr; |