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 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1288 intptr_t MaxExecutableSize() { return max_executable_size_; } | 1288 intptr_t MaxExecutableSize() { return max_executable_size_; } |
1289 | 1289 |
1290 // Returns the capacity of the heap in bytes w/o growing. Heap grows when | 1290 // Returns the capacity of the heap in bytes w/o growing. Heap grows when |
1291 // more spaces are needed until it reaches the limit. | 1291 // more spaces are needed until it reaches the limit. |
1292 intptr_t Capacity(); | 1292 intptr_t Capacity(); |
1293 | 1293 |
1294 // Returns the capacity of the old generation. | 1294 // Returns the capacity of the old generation. |
1295 intptr_t OldGenerationCapacity(); | 1295 intptr_t OldGenerationCapacity(); |
1296 | 1296 |
1297 // Returns the amount of memory currently committed for the heap. | 1297 // Returns the amount of memory currently committed for the heap. |
1298 intptr_t CommittedMemory(); | 1298 size_t CommittedMemory(); |
1299 | 1299 |
1300 // Returns the amount of memory currently committed for the old space. | 1300 // Returns the amount of memory currently committed for the old space. |
1301 intptr_t CommittedOldGenerationMemory(); | 1301 size_t CommittedOldGenerationMemory(); |
1302 | 1302 |
1303 // Returns the amount of executable memory currently committed for the heap. | 1303 // Returns the amount of executable memory currently committed for the heap. |
1304 intptr_t CommittedMemoryExecutable(); | 1304 size_t CommittedMemoryExecutable(); |
1305 | 1305 |
1306 // Returns the amount of phyical memory currently committed for the heap. | 1306 // Returns the amount of phyical memory currently committed for the heap. |
1307 size_t CommittedPhysicalMemory(); | 1307 size_t CommittedPhysicalMemory(); |
1308 | 1308 |
1309 // Returns the maximum amount of memory ever committed for the heap. | 1309 // Returns the maximum amount of memory ever committed for the heap. |
1310 intptr_t MaximumCommittedMemory() { return maximum_committed_; } | 1310 size_t MaximumCommittedMemory() { return maximum_committed_; } |
1311 | 1311 |
1312 // Updates the maximum committed memory for the heap. Should be called | 1312 // Updates the maximum committed memory for the heap. Should be called |
1313 // whenever a space grows. | 1313 // whenever a space grows. |
1314 void UpdateMaximumCommitted(); | 1314 void UpdateMaximumCommitted(); |
1315 | 1315 |
1316 // Returns the available bytes in space w/o growing. | 1316 // Returns the available bytes in space w/o growing. |
1317 // Heap doesn't guarantee that it can allocate an object that requires | 1317 // Heap doesn't guarantee that it can allocate an object that requires |
1318 // all available bytes. Check MaxHeapObjectSize() instead. | 1318 // all available bytes. Check MaxHeapObjectSize() instead. |
1319 intptr_t Available(); | 1319 intptr_t Available(); |
1320 | 1320 |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2081 | 2081 |
2082 Object* roots_[kRootListLength]; | 2082 Object* roots_[kRootListLength]; |
2083 | 2083 |
2084 size_t code_range_size_; | 2084 size_t code_range_size_; |
2085 int max_semi_space_size_; | 2085 int max_semi_space_size_; |
2086 int initial_semispace_size_; | 2086 int initial_semispace_size_; |
2087 intptr_t max_old_generation_size_; | 2087 intptr_t max_old_generation_size_; |
2088 intptr_t initial_old_generation_size_; | 2088 intptr_t initial_old_generation_size_; |
2089 bool old_generation_size_configured_; | 2089 bool old_generation_size_configured_; |
2090 intptr_t max_executable_size_; | 2090 intptr_t max_executable_size_; |
2091 intptr_t maximum_committed_; | 2091 size_t maximum_committed_; |
2092 | 2092 |
2093 // For keeping track of how much data has survived | 2093 // For keeping track of how much data has survived |
2094 // scavenge since last new space expansion. | 2094 // scavenge since last new space expansion. |
2095 intptr_t survived_since_last_expansion_; | 2095 intptr_t survived_since_last_expansion_; |
2096 | 2096 |
2097 // ... and since the last scavenge. | 2097 // ... and since the last scavenge. |
2098 intptr_t survived_last_scavenge_; | 2098 intptr_t survived_last_scavenge_; |
2099 | 2099 |
2100 // This is not the depth of nested AlwaysAllocateScope's but rather a single | 2100 // This is not the depth of nested AlwaysAllocateScope's but rather a single |
2101 // count, as scopes can be acquired from multiple tasks (read: threads). | 2101 // count, as scopes can be acquired from multiple tasks (read: threads). |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2610 friend class LargeObjectSpace; | 2610 friend class LargeObjectSpace; |
2611 friend class NewSpace; | 2611 friend class NewSpace; |
2612 friend class PagedSpace; | 2612 friend class PagedSpace; |
2613 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2613 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
2614 }; | 2614 }; |
2615 | 2615 |
2616 } // namespace internal | 2616 } // namespace internal |
2617 } // namespace v8 | 2617 } // namespace v8 |
2618 | 2618 |
2619 #endif // V8_HEAP_HEAP_H_ | 2619 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |