| 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 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1569 // limit when the object we need to allocate is 1-31 words in size. These | 1569 // limit when the object we need to allocate is 1-31 words in size. These |
| 1570 // spaces are called small. | 1570 // spaces are called small. |
| 1571 // 256-2047 words: There is a list of spaces this large. It is used for top and | 1571 // 256-2047 words: There is a list of spaces this large. It is used for top and |
| 1572 // limit when the object we need to allocate is 32-255 words in size. These | 1572 // limit when the object we need to allocate is 32-255 words in size. These |
| 1573 // spaces are called medium. | 1573 // spaces are called medium. |
| 1574 // 1048-16383 words: There is a list of spaces this large. It is used for top | 1574 // 1048-16383 words: There is a list of spaces this large. It is used for top |
| 1575 // and limit when the object we need to allocate is 256-2047 words in size. | 1575 // and limit when the object we need to allocate is 256-2047 words in size. |
| 1576 // These spaces are call large. | 1576 // These spaces are call large. |
| 1577 // At least 16384 words. This list is for objects of 2048 words or larger. | 1577 // At least 16384 words. This list is for objects of 2048 words or larger. |
| 1578 // Empty pages are added to this list. These spaces are called huge. | 1578 // Empty pages are added to this list. These spaces are called huge. |
| 1579 class FreeList BASE_EMBEDDED { | 1579 class FreeList { |
| 1580 public: | 1580 public: |
| 1581 explicit FreeList(PagedSpace* owner); | 1581 explicit FreeList(PagedSpace* owner); |
| 1582 | 1582 |
| 1583 intptr_t Concatenate(FreeList* free_list); | 1583 intptr_t Concatenate(FreeList* free_list); |
| 1584 | 1584 |
| 1585 // Clear the free list. | 1585 // Clear the free list. |
| 1586 void Reset(); | 1586 void Reset(); |
| 1587 | 1587 |
| 1588 // Return the number of bytes available on the free list. | 1588 // Return the number of bytes available on the free list. |
| 1589 intptr_t available() { | 1589 intptr_t available() { |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1938 bool Expand(); | 1938 bool Expand(); |
| 1939 | 1939 |
| 1940 // Generic fast case allocation function that tries linear allocation at the | 1940 // Generic fast case allocation function that tries linear allocation at the |
| 1941 // address denoted by top in allocation_info_. | 1941 // address denoted by top in allocation_info_. |
| 1942 inline HeapObject* AllocateLinearly(int size_in_bytes); | 1942 inline HeapObject* AllocateLinearly(int size_in_bytes); |
| 1943 | 1943 |
| 1944 // Slow path of AllocateRaw. This function is space-dependent. | 1944 // Slow path of AllocateRaw. This function is space-dependent. |
| 1945 MUST_USE_RESULT virtual HeapObject* SlowAllocateRaw(int size_in_bytes); | 1945 MUST_USE_RESULT virtual HeapObject* SlowAllocateRaw(int size_in_bytes); |
| 1946 | 1946 |
| 1947 friend class PageIterator; | 1947 friend class PageIterator; |
| 1948 friend class SweeperThread; | 1948 friend class MarkCompactCollector; |
| 1949 }; | 1949 }; |
| 1950 | 1950 |
| 1951 | 1951 |
| 1952 class NumberAndSizeInfo BASE_EMBEDDED { | 1952 class NumberAndSizeInfo BASE_EMBEDDED { |
| 1953 public: | 1953 public: |
| 1954 NumberAndSizeInfo() : number_(0), bytes_(0) {} | 1954 NumberAndSizeInfo() : number_(0), bytes_(0) {} |
| 1955 | 1955 |
| 1956 int number() const { return number_; } | 1956 int number() const { return number_; } |
| 1957 void increment_number(int num) { number_ += num; } | 1957 void increment_number(int num) { number_ += num; } |
| 1958 | 1958 |
| (...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2923 } | 2923 } |
| 2924 // Must be small, since an iteration is used for lookup. | 2924 // Must be small, since an iteration is used for lookup. |
| 2925 static const int kMaxComments = 64; | 2925 static const int kMaxComments = 64; |
| 2926 }; | 2926 }; |
| 2927 #endif | 2927 #endif |
| 2928 | 2928 |
| 2929 | 2929 |
| 2930 } } // namespace v8::internal | 2930 } } // namespace v8::internal |
| 2931 | 2931 |
| 2932 #endif // V8_SPACES_H_ | 2932 #endif // V8_SPACES_H_ |
| OLD | NEW |