Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Unified Diff: src/heap/heap.h

Issue 2210263002: [heap] Improve size profiling for ArrayBuffer tracking (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/array-buffer-tracker-inl.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index e15c1f37e77dfa3dd43b61ed0c2125e93c871c7c..31d228aa6f547b7ebce2b9a51ff79184bfd348db 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -843,14 +843,9 @@ class Heap {
int64_t external_memory() { return external_memory_; }
void update_external_memory(int64_t delta) { external_memory_ += delta; }
- void update_external_memory_concurrently_freed(intptr_t freed) {
- external_memory_concurrently_freed_.Increment(freed);
- }
+ size_t external_memory_retained_from_new_space();
- void account_external_memory_concurrently_freed() {
- external_memory_ -= external_memory_concurrently_freed_.Value();
- external_memory_concurrently_freed_.SetValue(0);
- }
+ bool ShouldDoScavengeForReducingExternalMemory();
void DeoptMarkedAllocationSites();
@@ -1405,6 +1400,8 @@ class Heap {
void RegisterNewArrayBuffer(JSArrayBuffer* buffer);
void UnregisterArrayBuffer(JSArrayBuffer* buffer);
+ ArrayBufferTracker* array_buffer_tracker() { return array_buffer_tracker_; }
+
// ===========================================================================
// Allocation site tracking. =================================================
// ===========================================================================
@@ -2045,9 +2042,6 @@ class Heap {
// Caches the amount of external memory registered at the last MC.
int64_t external_memory_at_last_mark_compact_;
- // The amount of memory that has been freed concurrently.
- base::AtomicNumber<intptr_t> external_memory_concurrently_freed_;
-
// This can be calculated directly from a pointer to the heap; however, it is
// more expedient to get at the isolate directly from within Heap methods.
Isolate* isolate_;
@@ -2289,6 +2283,9 @@ class Heap {
// Used for testing purposes.
bool force_oom_;
+ // Tracker for ArrayBuffers pointing to external memory.
+ ArrayBufferTracker* array_buffer_tracker_;
+
// Classes in "heap" can be friends.
friend class AlwaysAllocateScope;
friend class GCCallbacksScope;
« no previous file with comments | « src/heap/array-buffer-tracker-inl.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698