OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1447 delete mutex_; | 1447 delete mutex_; |
1448 } | 1448 } |
1449 | 1449 |
1450 intptr_t Concatenate(FreeListCategory* category); | 1450 intptr_t Concatenate(FreeListCategory* category); |
1451 | 1451 |
1452 void Reset(); | 1452 void Reset(); |
1453 | 1453 |
1454 void Free(FreeListNode* node, int size_in_bytes); | 1454 void Free(FreeListNode* node, int size_in_bytes); |
1455 | 1455 |
1456 FreeListNode* PickNodeFromList(int *node_size); | 1456 FreeListNode* PickNodeFromList(int *node_size); |
| 1457 FreeListNode* PickNodeFromList(int size_in_bytes, int *node_size); |
1457 | 1458 |
1458 intptr_t EvictFreeListItemsInList(Page* p); | 1459 intptr_t EvictFreeListItemsInList(Page* p); |
1459 | 1460 |
1460 void RepairFreeList(Heap* heap); | 1461 void RepairFreeList(Heap* heap); |
1461 | 1462 |
1462 FreeListNode** GetTopAddress() { return &top_; } | 1463 FreeListNode** GetTopAddress() { return &top_; } |
1463 FreeListNode* top() const { return top_; } | 1464 FreeListNode* top() const { return top_; } |
1464 void set_top(FreeListNode* top) { top_ = top; } | 1465 void set_top(FreeListNode* top) { top_ = top; } |
1465 | 1466 |
1466 FreeListNode** GetEndAddress() { return &end_; } | 1467 FreeListNode** GetEndAddress() { return &end_; } |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1813 bool CanExpand(); | 1814 bool CanExpand(); |
1814 | 1815 |
1815 // Returns the number of total pages in this space. | 1816 // Returns the number of total pages in this space. |
1816 int CountTotalPages(); | 1817 int CountTotalPages(); |
1817 | 1818 |
1818 // Return size of allocatable area on a page in this space. | 1819 // Return size of allocatable area on a page in this space. |
1819 inline int AreaSize() { | 1820 inline int AreaSize() { |
1820 return area_size_; | 1821 return area_size_; |
1821 } | 1822 } |
1822 | 1823 |
1823 bool ConstantAllocationSize() { | |
1824 return identity() == MAP_SPACE || identity() == CELL_SPACE || | |
1825 identity() == PROPERTY_CELL_SPACE; | |
1826 } | |
1827 | |
1828 protected: | 1824 protected: |
1829 FreeList* free_list() { return &free_list_; } | 1825 FreeList* free_list() { return &free_list_; } |
1830 | 1826 |
1831 int area_size_; | 1827 int area_size_; |
1832 | 1828 |
1833 // Maximum capacity of this space. | 1829 // Maximum capacity of this space. |
1834 intptr_t max_capacity_; | 1830 intptr_t max_capacity_; |
1835 | 1831 |
1836 intptr_t SizeOfFirstPage(); | 1832 intptr_t SizeOfFirstPage(); |
1837 | 1833 |
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2877 } | 2873 } |
2878 // Must be small, since an iteration is used for lookup. | 2874 // Must be small, since an iteration is used for lookup. |
2879 static const int kMaxComments = 64; | 2875 static const int kMaxComments = 64; |
2880 }; | 2876 }; |
2881 #endif | 2877 #endif |
2882 | 2878 |
2883 | 2879 |
2884 } } // namespace v8::internal | 2880 } } // namespace v8::internal |
2885 | 2881 |
2886 #endif // V8_SPACES_H_ | 2882 #endif // V8_SPACES_H_ |
OLD | NEW |