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 3929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3940 | 3940 |
3941 | 3941 |
3942 template<MarkCompactCollector::SweepingParallelism mode> | 3942 template<MarkCompactCollector::SweepingParallelism mode> |
3943 static intptr_t Free(PagedSpace* space, | 3943 static intptr_t Free(PagedSpace* space, |
3944 FreeList* free_list, | 3944 FreeList* free_list, |
3945 Address start, | 3945 Address start, |
3946 int size) { | 3946 int size) { |
3947 if (mode == MarkCompactCollector::SWEEP_ON_MAIN_THREAD) { | 3947 if (mode == MarkCompactCollector::SWEEP_ON_MAIN_THREAD) { |
3948 return space->Free(start, size); | 3948 return space->Free(start, size); |
3949 } else { | 3949 } else { |
| 3950 // TODO(hpayer): account for wasted bytes in concurrent sweeping too. |
3950 return size - free_list->Free(start, size); | 3951 return size - free_list->Free(start, size); |
3951 } | 3952 } |
3952 } | 3953 } |
3953 | 3954 |
3954 | 3955 |
3955 // Force instantiation of templatized SweepConservatively method for | 3956 // Force instantiation of templatized SweepConservatively method for |
3956 // SWEEP_ON_MAIN_THREAD mode. | 3957 // SWEEP_ON_MAIN_THREAD mode. |
3957 template intptr_t MarkCompactCollector:: | 3958 template intptr_t MarkCompactCollector:: |
3958 SweepConservatively<MarkCompactCollector::SWEEP_ON_MAIN_THREAD>( | 3959 SweepConservatively<MarkCompactCollector::SWEEP_ON_MAIN_THREAD>( |
3959 PagedSpace*, FreeList*, Page*); | 3960 PagedSpace*, FreeList*, Page*); |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4495 while (buffer != NULL) { | 4496 while (buffer != NULL) { |
4496 SlotsBuffer* next_buffer = buffer->next(); | 4497 SlotsBuffer* next_buffer = buffer->next(); |
4497 DeallocateBuffer(buffer); | 4498 DeallocateBuffer(buffer); |
4498 buffer = next_buffer; | 4499 buffer = next_buffer; |
4499 } | 4500 } |
4500 *buffer_address = NULL; | 4501 *buffer_address = NULL; |
4501 } | 4502 } |
4502 | 4503 |
4503 | 4504 |
4504 } } // namespace v8::internal | 4505 } } // namespace v8::internal |
OLD | NEW |