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 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1063 // The following methods are used to track raw C++ pointers to externally | 1063 // The following methods are used to track raw C++ pointers to externally |
1064 // allocated memory used as backing store in live array buffers. | 1064 // allocated memory used as backing store in live array buffers. |
1065 | 1065 |
1066 // A new ArrayBuffer was created with |data| as backing store. | 1066 // A new ArrayBuffer was created with |data| as backing store. |
1067 void RegisterNewArrayBuffer(bool in_new_space, void* data, size_t length); | 1067 void RegisterNewArrayBuffer(bool in_new_space, void* data, size_t length); |
1068 | 1068 |
1069 // The backing store |data| is no longer owned by V8. | 1069 // The backing store |data| is no longer owned by V8. |
1070 void UnregisterArrayBuffer(bool in_new_space, void* data); | 1070 void UnregisterArrayBuffer(bool in_new_space, void* data); |
1071 | 1071 |
1072 // A live ArrayBuffer was discovered during marking/scavenge. | 1072 // A live ArrayBuffer was discovered during marking/scavenge. |
1073 void RegisterLiveArrayBuffer(bool from_scavenge, void* data); | 1073 void RegisterLiveArrayBuffer(bool in_new_space, void* data); |
1074 | 1074 |
1075 // Frees all backing store pointers that weren't discovered in the previous | 1075 // Frees all backing store pointers that weren't discovered in the previous |
1076 // marking or scavenge phase. | 1076 // marking or scavenge phase. |
1077 void FreeDeadArrayBuffers(bool from_scavenge); | 1077 void FreeDeadArrayBuffers(bool from_scavenge); |
1078 | 1078 |
1079 // Prepare for a new scavenge phase. A new marking phase is implicitly | 1079 // Prepare for a new scavenge phase. A new marking phase is implicitly |
1080 // prepared by finishing the previous one. | 1080 // prepared by finishing the previous one. |
1081 void PrepareArrayBufferDiscoveryInNewSpace(); | 1081 void PrepareArrayBufferDiscoveryInNewSpace(); |
1082 | 1082 |
1083 // An ArrayBuffer moved from new space to old space. | 1083 // An ArrayBuffer moved from new space to old space. |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1783 void ResetAllAllocationSitesDependentCode(PretenureFlag flag); | 1783 void ResetAllAllocationSitesDependentCode(PretenureFlag flag); |
1784 | 1784 |
1785 // Evaluates local pretenuring for the old space and calls | 1785 // Evaluates local pretenuring for the old space and calls |
1786 // ResetAllTenuredAllocationSitesDependentCode if too many objects died in | 1786 // ResetAllTenuredAllocationSitesDependentCode if too many objects died in |
1787 // the old space. | 1787 // the old space. |
1788 void EvaluateOldSpaceLocalPretenuring(uint64_t size_of_objects_before_gc); | 1788 void EvaluateOldSpaceLocalPretenuring(uint64_t size_of_objects_before_gc); |
1789 | 1789 |
1790 // Called on heap tear-down. Frees all remaining ArrayBuffer backing stores. | 1790 // Called on heap tear-down. Frees all remaining ArrayBuffer backing stores. |
1791 void TearDownArrayBuffers(); | 1791 void TearDownArrayBuffers(); |
1792 | 1792 |
1793 // These correspond to the non-Helper versions. | |
1794 void RegisterNewArrayBufferHelper(std::map<void*, size_t>& live_buffers, | |
1795 void* data, size_t length); | |
1796 void UnregisterArrayBufferHelper( | |
1797 std::map<void*, size_t>& live_buffers, | |
1798 std::map<void*, size_t>& not_yet_discovered_buffers, void* data); | |
1799 void RegisterLiveArrayBufferHelper( | |
1800 std::map<void*, size_t>& not_yet_discovered_buffers, void* data); | |
1801 size_t FreeDeadArrayBuffersHelper( | |
1802 Isolate* isolate, std::map<void*, size_t>& live_buffers, | |
1803 std::map<void*, size_t>& not_yet_discovered_buffers); | |
1804 void TearDownArrayBuffersHelper( | |
1805 Isolate* isolate, std::map<void*, size_t>& live_buffers, | |
1806 std::map<void*, size_t>& not_yet_discovered_buffers); | |
1807 | |
1808 // Record statistics before and after garbage collection. | 1793 // Record statistics before and after garbage collection. |
1809 void ReportStatisticsBeforeGC(); | 1794 void ReportStatisticsBeforeGC(); |
1810 void ReportStatisticsAfterGC(); | 1795 void ReportStatisticsAfterGC(); |
1811 | 1796 |
1812 // Creates and installs the full-sized number string cache. | 1797 // Creates and installs the full-sized number string cache. |
1813 int FullSizeNumberStringCacheLength(); | 1798 int FullSizeNumberStringCacheLength(); |
1814 // Flush the number to string cache. | 1799 // Flush the number to string cache. |
1815 void FlushNumberStringCache(); | 1800 void FlushNumberStringCache(); |
1816 | 1801 |
1817 // Sets used allocation sites entries to undefined. | 1802 // Sets used allocation sites entries to undefined. |
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2794 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2779 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2795 | 2780 |
2796 private: | 2781 private: |
2797 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2782 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2798 }; | 2783 }; |
2799 #endif // DEBUG | 2784 #endif // DEBUG |
2800 } | 2785 } |
2801 } // namespace v8::internal | 2786 } // namespace v8::internal |
2802 | 2787 |
2803 #endif // V8_HEAP_HEAP_H_ | 2788 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |