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 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1624 // and limit when the object we need to allocate is 256-2047 words in size. | 1624 // and limit when the object we need to allocate is 256-2047 words in size. |
1625 // These spaces are call large. | 1625 // These spaces are call large. |
1626 // At least 16384 words. This list is for objects of 2048 words or larger. | 1626 // At least 16384 words. This list is for objects of 2048 words or larger. |
1627 // Empty pages are added to this list. These spaces are called huge. | 1627 // Empty pages are added to this list. These spaces are called huge. |
1628 class FreeList { | 1628 class FreeList { |
1629 public: | 1629 public: |
1630 explicit FreeList(PagedSpace* owner); | 1630 explicit FreeList(PagedSpace* owner); |
1631 | 1631 |
1632 intptr_t Concatenate(FreeList* free_list); | 1632 intptr_t Concatenate(FreeList* free_list); |
1633 | 1633 |
1634 void Divide(FreeList** other_free_lists, int num, intptr_t limit); | |
Hannes Payer (out of office)
2015/09/23 07:26:03
This code should be mentioned in the CL descriptio
Hannes Payer (out of office)
2015/09/23 07:26:03
Add a description what divide is doing.
Michael Lippautz
2015/09/23 07:40:50
Done.
Michael Lippautz
2015/09/23 07:40:50
Done.
| |
1635 | |
1634 // Clear the free list. | 1636 // Clear the free list. |
1635 void Reset(); | 1637 void Reset(); |
1636 | 1638 |
1637 // Return the number of bytes available on the free list. | 1639 // Return the number of bytes available on the free list. |
1638 intptr_t available() { | 1640 intptr_t available() { |
1639 return small_list_.available() + medium_list_.available() + | 1641 return small_list_.available() + medium_list_.available() + |
1640 large_list_.available() + huge_list_.available(); | 1642 large_list_.available() + huge_list_.available(); |
1641 } | 1643 } |
1642 | 1644 |
1643 // Place a node on the free list. The block of size 'size_in_bytes' | 1645 // Place a node on the free list. The block of size 'size_in_bytes' |
(...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2977 count = 0; | 2979 count = 0; |
2978 } | 2980 } |
2979 // Must be small, since an iteration is used for lookup. | 2981 // Must be small, since an iteration is used for lookup. |
2980 static const int kMaxComments = 64; | 2982 static const int kMaxComments = 64; |
2981 }; | 2983 }; |
2982 #endif | 2984 #endif |
2983 } | 2985 } |
2984 } // namespace v8::internal | 2986 } // namespace v8::internal |
2985 | 2987 |
2986 #endif // V8_HEAP_SPACES_H_ | 2988 #endif // V8_HEAP_SPACES_H_ |
OLD | NEW |