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

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

Issue 1964023002: [heap] Fine-grained JSArrayBuffer tracking (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase again 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 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 } 808 }
809 809
810 int64_t amount_of_external_allocated_memory() { 810 int64_t amount_of_external_allocated_memory() {
811 return amount_of_external_allocated_memory_; 811 return amount_of_external_allocated_memory_;
812 } 812 }
813 813
814 void update_amount_of_external_allocated_memory(int64_t delta) { 814 void update_amount_of_external_allocated_memory(int64_t delta) {
815 amount_of_external_allocated_memory_ += delta; 815 amount_of_external_allocated_memory_ += delta;
816 } 816 }
817 817
818 void update_amount_of_external_allocated_freed_memory(intptr_t freed) {
819 amount_of_external_allocated_memory_freed_.Increment(freed);
820 }
821
822 void account_amount_of_external_allocated_freed_memory() {
823 amount_of_external_allocated_memory_ -=
824 amount_of_external_allocated_memory_freed_.Value();
825 amount_of_external_allocated_memory_freed_.SetValue(0);
826 }
827
818 void DeoptMarkedAllocationSites(); 828 void DeoptMarkedAllocationSites();
819 829
820 bool DeoptMaybeTenuredAllocationSites() { 830 bool DeoptMaybeTenuredAllocationSites() {
821 return new_space_.IsAtMaximumCapacity() && maximum_size_scavenges_ == 0; 831 return new_space_.IsAtMaximumCapacity() && maximum_size_scavenges_ == 0;
822 } 832 }
823 833
824 void AddWeakObjectToCodeDependency(Handle<HeapObject> obj, 834 void AddWeakObjectToCodeDependency(Handle<HeapObject> obj,
825 Handle<DependentCode> dep); 835 Handle<DependentCode> dep);
826 836
827 DependentCode* LookupWeakObjectToCodeDependency(Handle<HeapObject> obj); 837 DependentCode* LookupWeakObjectToCodeDependency(Handle<HeapObject> obj);
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1975 1985
1976 void set_force_oom(bool value) { force_oom_ = value; } 1986 void set_force_oom(bool value) { force_oom_ = value; }
1977 1987
1978 // The amount of external memory registered through the API kept alive 1988 // The amount of external memory registered through the API kept alive
1979 // by global handles 1989 // by global handles
1980 int64_t amount_of_external_allocated_memory_; 1990 int64_t amount_of_external_allocated_memory_;
1981 1991
1982 // Caches the amount of external memory registered at the last global gc. 1992 // Caches the amount of external memory registered at the last global gc.
1983 int64_t amount_of_external_allocated_memory_at_last_global_gc_; 1993 int64_t amount_of_external_allocated_memory_at_last_global_gc_;
1984 1994
1995 base::AtomicNumber<intptr_t> amount_of_external_allocated_memory_freed_;
1996
1985 // This can be calculated directly from a pointer to the heap; however, it is 1997 // This can be calculated directly from a pointer to the heap; however, it is
1986 // more expedient to get at the isolate directly from within Heap methods. 1998 // more expedient to get at the isolate directly from within Heap methods.
1987 Isolate* isolate_; 1999 Isolate* isolate_;
1988 2000
1989 Object* roots_[kRootListLength]; 2001 Object* roots_[kRootListLength];
1990 2002
1991 size_t code_range_size_; 2003 size_t code_range_size_;
1992 int max_semi_space_size_; 2004 int max_semi_space_size_;
1993 int initial_semispace_size_; 2005 int initial_semispace_size_;
1994 intptr_t max_old_generation_size_; 2006 intptr_t max_old_generation_size_;
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
2647 friend class LargeObjectSpace; 2659 friend class LargeObjectSpace;
2648 friend class NewSpace; 2660 friend class NewSpace;
2649 friend class PagedSpace; 2661 friend class PagedSpace;
2650 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); 2662 DISALLOW_COPY_AND_ASSIGN(AllocationObserver);
2651 }; 2663 };
2652 2664
2653 } // namespace internal 2665 } // namespace internal
2654 } // namespace v8 2666 } // namespace v8
2655 2667
2656 #endif // V8_HEAP_HEAP_H_ 2668 #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