OLD | NEW |
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 Loading... |
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 | |
831 void DeoptMarkedAllocationSites(); | 821 void DeoptMarkedAllocationSites(); |
832 | 822 |
833 bool DeoptMaybeTenuredAllocationSites() { | 823 bool DeoptMaybeTenuredAllocationSites() { |
834 return new_space_.IsAtMaximumCapacity() && maximum_size_scavenges_ == 0; | 824 return new_space_.IsAtMaximumCapacity() && maximum_size_scavenges_ == 0; |
835 } | 825 } |
836 | 826 |
837 void AddWeakObjectToCodeDependency(Handle<HeapObject> obj, | 827 void AddWeakObjectToCodeDependency(Handle<HeapObject> obj, |
838 Handle<DependentCode> dep); | 828 Handle<DependentCode> dep); |
839 | 829 |
840 DependentCode* LookupWeakObjectToCodeDependency(Handle<HeapObject> obj); | 830 DependentCode* LookupWeakObjectToCodeDependency(Handle<HeapObject> obj); |
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1988 | 1978 |
1989 void set_force_oom(bool value) { force_oom_ = value; } | 1979 void set_force_oom(bool value) { force_oom_ = value; } |
1990 | 1980 |
1991 // The amount of external memory registered through the API kept alive | 1981 // The amount of external memory registered through the API kept alive |
1992 // by global handles | 1982 // by global handles |
1993 int64_t amount_of_external_allocated_memory_; | 1983 int64_t amount_of_external_allocated_memory_; |
1994 | 1984 |
1995 // Caches the amount of external memory registered at the last global gc. | 1985 // Caches the amount of external memory registered at the last global gc. |
1996 int64_t amount_of_external_allocated_memory_at_last_global_gc_; | 1986 int64_t amount_of_external_allocated_memory_at_last_global_gc_; |
1997 | 1987 |
1998 base::AtomicNumber<intptr_t> amount_of_external_allocated_memory_freed_; | |
1999 | |
2000 // This can be calculated directly from a pointer to the heap; however, it is | 1988 // This can be calculated directly from a pointer to the heap; however, it is |
2001 // more expedient to get at the isolate directly from within Heap methods. | 1989 // more expedient to get at the isolate directly from within Heap methods. |
2002 Isolate* isolate_; | 1990 Isolate* isolate_; |
2003 | 1991 |
2004 Object* roots_[kRootListLength]; | 1992 Object* roots_[kRootListLength]; |
2005 | 1993 |
2006 size_t code_range_size_; | 1994 size_t code_range_size_; |
2007 int max_semi_space_size_; | 1995 int max_semi_space_size_; |
2008 int initial_semispace_size_; | 1996 int initial_semispace_size_; |
2009 intptr_t max_old_generation_size_; | 1997 intptr_t max_old_generation_size_; |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2662 friend class LargeObjectSpace; | 2650 friend class LargeObjectSpace; |
2663 friend class NewSpace; | 2651 friend class NewSpace; |
2664 friend class PagedSpace; | 2652 friend class PagedSpace; |
2665 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2653 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
2666 }; | 2654 }; |
2667 | 2655 |
2668 } // namespace internal | 2656 } // namespace internal |
2669 } // namespace v8 | 2657 } // namespace v8 |
2670 | 2658 |
2671 #endif // V8_HEAP_HEAP_H_ | 2659 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |