| 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 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1167 size_t ObjectSizeAtLastGC(size_t index); | 1167 size_t ObjectSizeAtLastGC(size_t index); |
| 1168 | 1168 |
| 1169 // Retrieves names of buckets used by object statistics tracking. | 1169 // Retrieves names of buckets used by object statistics tracking. |
| 1170 bool GetObjectTypeName(size_t index, const char** object_type, | 1170 bool GetObjectTypeName(size_t index, const char** object_type, |
| 1171 const char** object_sub_type); | 1171 const char** object_sub_type); |
| 1172 | 1172 |
| 1173 // =========================================================================== | 1173 // =========================================================================== |
| 1174 // GC statistics. ============================================================ | 1174 // GC statistics. ============================================================ |
| 1175 // =========================================================================== | 1175 // =========================================================================== |
| 1176 | 1176 |
| 1177 // Returns the maximum amount of memory reserved for the heap. For | 1177 // Returns the maximum amount of memory reserved for the heap. |
| 1178 // the young generation, we reserve 4 times the amount needed for a | |
| 1179 // semi space. The young generation consists of two semi spaces and | |
| 1180 // we reserve twice the amount needed for those in order to ensure | |
| 1181 // that new space can be aligned to its size. | |
| 1182 intptr_t MaxReserved() { | 1178 intptr_t MaxReserved() { |
| 1183 return 4 * reserved_semispace_size_ + max_old_generation_size_; | 1179 return 2 * max_semi_space_size_ + max_old_generation_size_; |
| 1184 } | 1180 } |
| 1185 int MaxSemiSpaceSize() { return max_semi_space_size_; } | 1181 int MaxSemiSpaceSize() { return max_semi_space_size_; } |
| 1186 int ReservedSemiSpaceSize() { return reserved_semispace_size_; } | |
| 1187 int InitialSemiSpaceSize() { return initial_semispace_size_; } | 1182 int InitialSemiSpaceSize() { return initial_semispace_size_; } |
| 1188 intptr_t MaxOldGenerationSize() { return max_old_generation_size_; } | 1183 intptr_t MaxOldGenerationSize() { return max_old_generation_size_; } |
| 1189 intptr_t MaxExecutableSize() { return max_executable_size_; } | 1184 intptr_t MaxExecutableSize() { return max_executable_size_; } |
| 1190 | 1185 |
| 1191 // Returns the capacity of the heap in bytes w/o growing. Heap grows when | 1186 // Returns the capacity of the heap in bytes w/o growing. Heap grows when |
| 1192 // more spaces are needed until it reaches the limit. | 1187 // more spaces are needed until it reaches the limit. |
| 1193 intptr_t Capacity(); | 1188 intptr_t Capacity(); |
| 1194 | 1189 |
| 1195 // Returns the amount of memory currently committed for the heap. | 1190 // Returns the amount of memory currently committed for the heap. |
| 1196 intptr_t CommittedMemory(); | 1191 intptr_t CommittedMemory(); |
| (...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1988 // Caches the amount of external memory registered at the last global gc. | 1983 // Caches the amount of external memory registered at the last global gc. |
| 1989 int64_t amount_of_external_allocated_memory_at_last_global_gc_; | 1984 int64_t amount_of_external_allocated_memory_at_last_global_gc_; |
| 1990 | 1985 |
| 1991 // This can be calculated directly from a pointer to the heap; however, it is | 1986 // This can be calculated directly from a pointer to the heap; however, it is |
| 1992 // more expedient to get at the isolate directly from within Heap methods. | 1987 // more expedient to get at the isolate directly from within Heap methods. |
| 1993 Isolate* isolate_; | 1988 Isolate* isolate_; |
| 1994 | 1989 |
| 1995 Object* roots_[kRootListLength]; | 1990 Object* roots_[kRootListLength]; |
| 1996 | 1991 |
| 1997 size_t code_range_size_; | 1992 size_t code_range_size_; |
| 1998 int reserved_semispace_size_; | |
| 1999 int max_semi_space_size_; | 1993 int max_semi_space_size_; |
| 2000 int initial_semispace_size_; | 1994 int initial_semispace_size_; |
| 2001 int target_semispace_size_; | |
| 2002 intptr_t max_old_generation_size_; | 1995 intptr_t max_old_generation_size_; |
| 2003 intptr_t initial_old_generation_size_; | 1996 intptr_t initial_old_generation_size_; |
| 2004 bool old_generation_size_configured_; | 1997 bool old_generation_size_configured_; |
| 2005 intptr_t max_executable_size_; | 1998 intptr_t max_executable_size_; |
| 2006 intptr_t maximum_committed_; | 1999 intptr_t maximum_committed_; |
| 2007 | 2000 |
| 2008 // For keeping track of how much data has survived | 2001 // For keeping track of how much data has survived |
| 2009 // scavenge since last new space expansion. | 2002 // scavenge since last new space expansion. |
| 2010 intptr_t survived_since_last_expansion_; | 2003 intptr_t survived_since_last_expansion_; |
| 2011 | 2004 |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2659 friend class LargeObjectSpace; | 2652 friend class LargeObjectSpace; |
| 2660 friend class NewSpace; | 2653 friend class NewSpace; |
| 2661 friend class PagedSpace; | 2654 friend class PagedSpace; |
| 2662 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2655 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
| 2663 }; | 2656 }; |
| 2664 | 2657 |
| 2665 } // namespace internal | 2658 } // namespace internal |
| 2666 } // namespace v8 | 2659 } // namespace v8 |
| 2667 | 2660 |
| 2668 #endif // V8_HEAP_HEAP_H_ | 2661 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |