| 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 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 | 881 |
| 882 // Checks whether the given object is allowed to be migrated from it's | 882 // Checks whether the given object is allowed to be migrated from it's |
| 883 // current space into the given destination space. Used for debugging. | 883 // current space into the given destination space. Used for debugging. |
| 884 inline bool AllowedToBeMigrated(HeapObject* object, AllocationSpace dest); | 884 inline bool AllowedToBeMigrated(HeapObject* object, AllocationSpace dest); |
| 885 | 885 |
| 886 void CheckHandleCount(); | 886 void CheckHandleCount(); |
| 887 | 887 |
| 888 // Number of "runtime allocations" done so far. | 888 // Number of "runtime allocations" done so far. |
| 889 uint32_t allocations_count() { return allocations_count_; } | 889 uint32_t allocations_count() { return allocations_count_; } |
| 890 | 890 |
| 891 // Returns deterministic "time" value in ms. Works only with | |
| 892 // FLAG_verify_predictable. | |
| 893 double synthetic_time() { return allocations_count() / 2.0; } | |
| 894 | |
| 895 // Print short heap statistics. | 891 // Print short heap statistics. |
| 896 void PrintShortHeapStatistics(); | 892 void PrintShortHeapStatistics(); |
| 897 | 893 |
| 898 inline HeapState gc_state() { return gc_state_; } | 894 inline HeapState gc_state() { return gc_state_; } |
| 899 | 895 |
| 900 inline bool IsInGCPostProcessing() { return gc_post_processing_depth_ > 0; } | 896 inline bool IsInGCPostProcessing() { return gc_post_processing_depth_ > 0; } |
| 901 | 897 |
| 902 // If an object has an AllocationMemento trailing it, return it, otherwise | 898 // If an object has an AllocationMemento trailing it, return it, otherwise |
| 903 // return NULL; | 899 // return NULL; |
| 904 inline AllocationMemento* FindAllocationMemento(HeapObject* object); | 900 inline AllocationMemento* FindAllocationMemento(HeapObject* object); |
| (...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2156 | 2152 |
| 2157 // Returns the amount of external memory registered since last global gc. | 2153 // Returns the amount of external memory registered since last global gc. |
| 2158 int64_t PromotedExternalMemorySize(); | 2154 int64_t PromotedExternalMemorySize(); |
| 2159 | 2155 |
| 2160 // How many "runtime allocations" happened. | 2156 // How many "runtime allocations" happened. |
| 2161 uint32_t allocations_count_; | 2157 uint32_t allocations_count_; |
| 2162 | 2158 |
| 2163 // Running hash over allocations performed. | 2159 // Running hash over allocations performed. |
| 2164 uint32_t raw_allocations_hash_; | 2160 uint32_t raw_allocations_hash_; |
| 2165 | 2161 |
| 2166 // Countdown counter, dumps allocation hash when 0. | |
| 2167 uint32_t dump_allocations_hash_countdown_; | |
| 2168 | |
| 2169 // How many mark-sweep collections happened. | 2162 // How many mark-sweep collections happened. |
| 2170 unsigned int ms_count_; | 2163 unsigned int ms_count_; |
| 2171 | 2164 |
| 2172 // How many gc happened. | 2165 // How many gc happened. |
| 2173 unsigned int gc_count_; | 2166 unsigned int gc_count_; |
| 2174 | 2167 |
| 2175 // For post mortem debugging. | 2168 // For post mortem debugging. |
| 2176 int remembered_unmapped_pages_index_; | 2169 int remembered_unmapped_pages_index_; |
| 2177 Address remembered_unmapped_pages_[kRememberedUnmappedPages]; | 2170 Address remembered_unmapped_pages_[kRememberedUnmappedPages]; |
| 2178 | 2171 |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2720 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2713 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
| 2721 | 2714 |
| 2722 private: | 2715 private: |
| 2723 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2716 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 2724 }; | 2717 }; |
| 2725 #endif // DEBUG | 2718 #endif // DEBUG |
| 2726 } // namespace internal | 2719 } // namespace internal |
| 2727 } // namespace v8 | 2720 } // namespace v8 |
| 2728 | 2721 |
| 2729 #endif // V8_HEAP_HEAP_H_ | 2722 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |