OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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_SPACES_H_ | 5 #ifndef V8_HEAP_SPACES_H_ |
6 #define V8_HEAP_SPACES_H_ | 6 #define V8_HEAP_SPACES_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/atomic-utils.h" | 9 #include "src/atomic-utils.h" |
10 #include "src/base/atomicops.h" | 10 #include "src/base/atomicops.h" |
(...skipping 2583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2594 return from_space_.MaximumCommittedMemory() + | 2594 return from_space_.MaximumCommittedMemory() + |
2595 to_space_.MaximumCommittedMemory(); | 2595 to_space_.MaximumCommittedMemory(); |
2596 } | 2596 } |
2597 | 2597 |
2598 // Approximate amount of physical memory committed for this space. | 2598 // Approximate amount of physical memory committed for this space. |
2599 size_t CommittedPhysicalMemory() override; | 2599 size_t CommittedPhysicalMemory() override; |
2600 | 2600 |
2601 // Return the available bytes without growing. | 2601 // Return the available bytes without growing. |
2602 intptr_t Available() override { return Capacity() - Size(); } | 2602 intptr_t Available() override { return Capacity() - Size(); } |
2603 | 2603 |
2604 inline size_t AllocatedSinceLastGC(); | 2604 V8_INLINE size_t AllocatedSinceLastGC(); |
2605 | 2605 |
2606 void ReplaceWithEmptyPage(Page* page) { | 2606 void ReplaceWithEmptyPage(Page* page) { |
2607 // This method is called after flipping the semispace. | 2607 // This method is called after flipping the semispace. |
2608 DCHECK(page->InFromSpace()); | 2608 DCHECK(page->InFromSpace()); |
2609 from_space_.ReplaceWithEmptyPage(page); | 2609 from_space_.ReplaceWithEmptyPage(page); |
2610 } | 2610 } |
2611 | 2611 |
2612 // Return the maximum capacity of a semispace. | 2612 // Return the maximum capacity of a semispace. |
2613 int MaximumCapacity() { | 2613 int MaximumCapacity() { |
2614 DCHECK(to_space_.maximum_capacity() == from_space_.maximum_capacity()); | 2614 DCHECK(to_space_.maximum_capacity() == from_space_.maximum_capacity()); |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3038 count = 0; | 3038 count = 0; |
3039 } | 3039 } |
3040 // Must be small, since an iteration is used for lookup. | 3040 // Must be small, since an iteration is used for lookup. |
3041 static const int kMaxComments = 64; | 3041 static const int kMaxComments = 64; |
3042 }; | 3042 }; |
3043 #endif | 3043 #endif |
3044 } // namespace internal | 3044 } // namespace internal |
3045 } // namespace v8 | 3045 } // namespace v8 |
3046 | 3046 |
3047 #endif // V8_HEAP_SPACES_H_ | 3047 #endif // V8_HEAP_SPACES_H_ |
OLD | NEW |