OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/base/atomicops.h" | 7 #include "src/base/atomicops.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/compilation-cache.h" | 9 #include "src/compilation-cache.h" |
10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2035 } | 2035 } |
2036 *cells = 0; | 2036 *cells = 0; |
2037 } | 2037 } |
2038 return survivors_size; | 2038 return survivors_size; |
2039 } | 2039 } |
2040 | 2040 |
2041 | 2041 |
2042 static void DiscoverGreyObjectsInSpace(Heap* heap, | 2042 static void DiscoverGreyObjectsInSpace(Heap* heap, |
2043 MarkingDeque* marking_deque, | 2043 MarkingDeque* marking_deque, |
2044 PagedSpace* space) { | 2044 PagedSpace* space) { |
2045 if (!space->was_swept_conservatively()) { | 2045 PageIterator it(space); |
2046 HeapObjectIterator it(space); | 2046 while (it.has_next()) { |
2047 DiscoverGreyObjectsWithIterator(heap, marking_deque, &it); | 2047 Page* p = it.next(); |
2048 } else { | 2048 DiscoverGreyObjectsOnPage(marking_deque, p); |
2049 PageIterator it(space); | 2049 if (marking_deque->IsFull()) return; |
2050 while (it.has_next()) { | |
2051 Page* p = it.next(); | |
2052 DiscoverGreyObjectsOnPage(marking_deque, p); | |
2053 if (marking_deque->IsFull()) return; | |
2054 } | |
2055 } | 2050 } |
2056 } | 2051 } |
2057 | 2052 |
2058 | 2053 |
2059 static void DiscoverGreyObjectsInNewSpace(Heap* heap, | 2054 static void DiscoverGreyObjectsInNewSpace(Heap* heap, |
2060 MarkingDeque* marking_deque) { | 2055 MarkingDeque* marking_deque) { |
2061 NewSpace* space = heap->new_space(); | 2056 NewSpace* space = heap->new_space(); |
2062 NewSpacePageIterator it(space->bottom(), space->top()); | 2057 NewSpacePageIterator it(space->bottom(), space->top()); |
2063 while (it.has_next()) { | 2058 while (it.has_next()) { |
2064 NewSpacePage* page = it.next(); | 2059 NewSpacePage* page = it.next(); |
(...skipping 2400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4465 while (buffer != NULL) { | 4460 while (buffer != NULL) { |
4466 SlotsBuffer* next_buffer = buffer->next(); | 4461 SlotsBuffer* next_buffer = buffer->next(); |
4467 DeallocateBuffer(buffer); | 4462 DeallocateBuffer(buffer); |
4468 buffer = next_buffer; | 4463 buffer = next_buffer; |
4469 } | 4464 } |
4470 *buffer_address = NULL; | 4465 *buffer_address = NULL; |
4471 } | 4466 } |
4472 | 4467 |
4473 | 4468 |
4474 } } // namespace v8::internal | 4469 } } // namespace v8::internal |
OLD | NEW |