Chromium Code Reviews| 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 1840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1851 | 1851 |
| 1852 bool CanExpandOldGeneration(int size) { | 1852 bool CanExpandOldGeneration(int size) { |
| 1853 if (force_oom_) return false; | 1853 if (force_oom_) return false; |
| 1854 return (OldGenerationCapacity() + size) < MaxOldGenerationSize(); | 1854 return (OldGenerationCapacity() + size) < MaxOldGenerationSize(); |
| 1855 } | 1855 } |
| 1856 | 1856 |
| 1857 bool IsCloseToOutOfMemory(size_t slack) { | 1857 bool IsCloseToOutOfMemory(size_t slack) { |
| 1858 return OldGenerationCapacity() + slack >= MaxOldGenerationSize(); | 1858 return OldGenerationCapacity() + slack >= MaxOldGenerationSize(); |
| 1859 } | 1859 } |
| 1860 | 1860 |
| 1861 bool ShouldExpandOldGenerationOnAllocationFailure(); | 1861 bool ShouldExpandOldGenerationOnSlowAllocation(); |
|
ulan
2016/12/05 21:18:16
Renaming because I call this function before expan
| |
| 1862 | 1862 |
| 1863 enum class IncrementalMarkingLimit { kNoLimit, kSoftLimit, kHardLimit }; | 1863 enum class IncrementalMarkingLimit { kNoLimit, kSoftLimit, kHardLimit }; |
| 1864 IncrementalMarkingLimit IncrementalMarkingLimitReached(); | 1864 IncrementalMarkingLimit IncrementalMarkingLimitReached(); |
| 1865 | 1865 |
| 1866 // =========================================================================== | 1866 // =========================================================================== |
| 1867 // Idle notification. ======================================================== | 1867 // Idle notification. ======================================================== |
| 1868 // =========================================================================== | 1868 // =========================================================================== |
| 1869 | 1869 |
| 1870 bool RecentIdleNotificationHappened(); | 1870 bool RecentIdleNotificationHappened(); |
| 1871 void ScheduleIdleScavengeIfNeeded(int bytes_allocated); | 1871 void ScheduleIdleScavengeIfNeeded(int bytes_allocated); |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2645 friend class LargeObjectSpace; | 2645 friend class LargeObjectSpace; |
| 2646 friend class NewSpace; | 2646 friend class NewSpace; |
| 2647 friend class PagedSpace; | 2647 friend class PagedSpace; |
| 2648 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2648 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
| 2649 }; | 2649 }; |
| 2650 | 2650 |
| 2651 } // namespace internal | 2651 } // namespace internal |
| 2652 } // namespace v8 | 2652 } // namespace v8 |
| 2653 | 2653 |
| 2654 #endif // V8_HEAP_HEAP_H_ | 2654 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |