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

Unified Diff: src/heap/heap.h

Issue 2036643002: Reland "[heap] Fine-grained JSArrayBuffer tracking" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove unneeded locking to avoid lock-inversion-order errors in TSAN Created 4 years, 6 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.cc ('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 fd51806deeb01b75f4d7f83542d982172ee2967d..c97c1889d1614b63298828745d6b360594bcbea5 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -822,6 +822,16 @@ class Heap {
amount_of_external_allocated_memory_ += delta;
}
+ void update_amount_of_external_allocated_freed_memory(intptr_t freed) {
+ amount_of_external_allocated_memory_freed_.Increment(freed);
+ }
+
+ void account_amount_of_external_allocated_freed_memory() {
+ amount_of_external_allocated_memory_ -=
+ amount_of_external_allocated_memory_freed_.Value();
+ amount_of_external_allocated_memory_freed_.SetValue(0);
+ }
+
void DeoptMarkedAllocationSites();
bool DeoptMaybeTenuredAllocationSites() {
@@ -1356,10 +1366,6 @@ class Heap {
void RegisterNewArrayBuffer(JSArrayBuffer* buffer);
void UnregisterArrayBuffer(JSArrayBuffer* buffer);
- inline ArrayBufferTracker* array_buffer_tracker() {
- return array_buffer_tracker_;
- }
-
// ===========================================================================
// Allocation site tracking. =================================================
// ===========================================================================
@@ -1997,6 +2003,8 @@ class Heap {
// Caches the amount of external memory registered at the last global gc.
int64_t amount_of_external_allocated_memory_at_last_global_gc_;
+ base::AtomicNumber<intptr_t> amount_of_external_allocated_memory_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_;
@@ -2235,8 +2243,6 @@ class Heap {
StrongRootsList* strong_roots_list_;
- ArrayBufferTracker* array_buffer_tracker_;
-
// The depth of HeapIterator nestings.
int heap_iterator_depth_;
« no previous file with comments | « src/heap/array-buffer-tracker.cc ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698