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

Side by Side Diff: src/heap/heap.h

Issue 2005723005: Reland of "[heap] Fine-grained JSArrayBuffer tracking" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comment Created 4 years, 7 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_HEAP_HEAP_H_ 5 #ifndef V8_HEAP_HEAP_H_
6 #define V8_HEAP_HEAP_H_ 6 #define V8_HEAP_HEAP_H_
7 7
8 #include <cmath> 8 #include <cmath>
9 #include <map> 9 #include <map>
10 10
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 } 811 }
812 812
813 int64_t amount_of_external_allocated_memory() { 813 int64_t amount_of_external_allocated_memory() {
814 return amount_of_external_allocated_memory_; 814 return amount_of_external_allocated_memory_;
815 } 815 }
816 816
817 void update_amount_of_external_allocated_memory(int64_t delta) { 817 void update_amount_of_external_allocated_memory(int64_t delta) {
818 amount_of_external_allocated_memory_ += delta; 818 amount_of_external_allocated_memory_ += delta;
819 } 819 }
820 820
821 void update_amount_of_external_allocated_freed_memory(intptr_t freed) {
822 amount_of_external_allocated_memory_freed_.Increment(freed);
823 }
824
825 void account_amount_of_external_allocated_freed_memory() {
826 amount_of_external_allocated_memory_ -=
827 amount_of_external_allocated_memory_freed_.Value();
828 amount_of_external_allocated_memory_freed_.SetValue(0);
829 }
830
821 void DeoptMarkedAllocationSites(); 831 void DeoptMarkedAllocationSites();
822 832
823 bool DeoptMaybeTenuredAllocationSites() { 833 bool DeoptMaybeTenuredAllocationSites() {
824 return new_space_.IsAtMaximumCapacity() && maximum_size_scavenges_ == 0; 834 return new_space_.IsAtMaximumCapacity() && maximum_size_scavenges_ == 0;
825 } 835 }
826 836
827 void AddWeakObjectToCodeDependency(Handle<HeapObject> obj, 837 void AddWeakObjectToCodeDependency(Handle<HeapObject> obj,
828 Handle<DependentCode> dep); 838 Handle<DependentCode> dep);
829 839
830 DependentCode* LookupWeakObjectToCodeDependency(Handle<HeapObject> obj); 840 DependentCode* LookupWeakObjectToCodeDependency(Handle<HeapObject> obj);
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1978 1988
1979 void set_force_oom(bool value) { force_oom_ = value; } 1989 void set_force_oom(bool value) { force_oom_ = value; }
1980 1990
1981 // The amount of external memory registered through the API kept alive 1991 // The amount of external memory registered through the API kept alive
1982 // by global handles 1992 // by global handles
1983 int64_t amount_of_external_allocated_memory_; 1993 int64_t amount_of_external_allocated_memory_;
1984 1994
1985 // Caches the amount of external memory registered at the last global gc. 1995 // Caches the amount of external memory registered at the last global gc.
1986 int64_t amount_of_external_allocated_memory_at_last_global_gc_; 1996 int64_t amount_of_external_allocated_memory_at_last_global_gc_;
1987 1997
1998 base::AtomicNumber<intptr_t> amount_of_external_allocated_memory_freed_;
1999
1988 // This can be calculated directly from a pointer to the heap; however, it is 2000 // This can be calculated directly from a pointer to the heap; however, it is
1989 // more expedient to get at the isolate directly from within Heap methods. 2001 // more expedient to get at the isolate directly from within Heap methods.
1990 Isolate* isolate_; 2002 Isolate* isolate_;
1991 2003
1992 Object* roots_[kRootListLength]; 2004 Object* roots_[kRootListLength];
1993 2005
1994 size_t code_range_size_; 2006 size_t code_range_size_;
1995 int max_semi_space_size_; 2007 int max_semi_space_size_;
1996 int initial_semispace_size_; 2008 int initial_semispace_size_;
1997 intptr_t max_old_generation_size_; 2009 intptr_t max_old_generation_size_;
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
2650 friend class LargeObjectSpace; 2662 friend class LargeObjectSpace;
2651 friend class NewSpace; 2663 friend class NewSpace;
2652 friend class PagedSpace; 2664 friend class PagedSpace;
2653 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); 2665 DISALLOW_COPY_AND_ASSIGN(AllocationObserver);
2654 }; 2666 };
2655 2667
2656 } // namespace internal 2668 } // namespace internal
2657 } // namespace v8 2669 } // namespace v8
2658 2670
2659 #endif // V8_HEAP_HEAP_H_ 2671 #endif // V8_HEAP_HEAP_H_
OLDNEW
« 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