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 1919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1930 | 1930 |
1931 | 1931 |
1932 void FreeListCategory::Reset() { | 1932 void FreeListCategory::Reset() { |
1933 top_ = NULL; | 1933 top_ = NULL; |
1934 end_ = NULL; | 1934 end_ = NULL; |
1935 available_ = 0; | 1935 available_ = 0; |
1936 } | 1936 } |
1937 | 1937 |
1938 | 1938 |
1939 intptr_t FreeListCategory::CountFreeListItemsInList(Page* p) { | 1939 intptr_t FreeListCategory::CountFreeListItemsInList(Page* p) { |
1940 intptr_t sum = 0; | 1940 int sum = 0; |
1941 FreeListNode* n = top_; | 1941 FreeListNode* n = top_; |
1942 while (n != NULL) { | 1942 while (n != NULL) { |
1943 if (Page::FromAddress(n->address()) == p) { | 1943 if (Page::FromAddress(n->address()) == p) { |
1944 FreeSpace* free_space = reinterpret_cast<FreeSpace*>(n); | 1944 FreeSpace* free_space = reinterpret_cast<FreeSpace*>(n); |
1945 sum += free_space->Size(); | 1945 sum += free_space->Size(); |
1946 } | 1946 } |
1947 n = n->next(); | 1947 n = n->next(); |
1948 } | 1948 } |
1949 return sum; | 1949 return sum; |
1950 } | 1950 } |
1951 | 1951 |
1952 | 1952 |
1953 intptr_t FreeListCategory::EvictFreeListItemsInList(Page* p) { | 1953 intptr_t FreeListCategory::EvictFreeListItemsInList(Page* p) { |
1954 intptr_t sum = 0; | 1954 int sum = 0; |
1955 FreeListNode** n = &top_; | 1955 FreeListNode** n = &top_; |
1956 while (*n != NULL) { | 1956 while (*n != NULL) { |
1957 if (Page::FromAddress((*n)->address()) == p) { | 1957 if (Page::FromAddress((*n)->address()) == p) { |
1958 FreeSpace* free_space = reinterpret_cast<FreeSpace*>(*n); | 1958 FreeSpace* free_space = reinterpret_cast<FreeSpace*>(*n); |
1959 sum += free_space->Size(); | 1959 sum += free_space->Size(); |
1960 *n = (*n)->next(); | 1960 *n = (*n)->next(); |
1961 } else { | 1961 } else { |
1962 n = (*n)->next_address(); | 1962 n = (*n)->next_address(); |
1963 } | 1963 } |
1964 } | 1964 } |
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2985 object->ShortPrint(); | 2985 object->ShortPrint(); |
2986 PrintF("\n"); | 2986 PrintF("\n"); |
2987 } | 2987 } |
2988 printf(" --------------------------------------\n"); | 2988 printf(" --------------------------------------\n"); |
2989 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 2989 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
2990 } | 2990 } |
2991 | 2991 |
2992 #endif // DEBUG | 2992 #endif // DEBUG |
2993 | 2993 |
2994 } } // namespace v8::internal | 2994 } } // namespace v8::internal |
OLD | NEW |