| 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 4050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4061 static_cast<int>(p->area_end() - free_start)); | 4061 static_cast<int>(p->area_end() - free_start)); |
| 4062 max_freed_bytes = Max(freed_bytes, max_freed_bytes); | 4062 max_freed_bytes = Max(freed_bytes, max_freed_bytes); |
| 4063 } | 4063 } |
| 4064 | 4064 |
| 4065 p->ResetLiveBytes(); | 4065 p->ResetLiveBytes(); |
| 4066 return max_freed_bytes; | 4066 return max_freed_bytes; |
| 4067 } | 4067 } |
| 4068 | 4068 |
| 4069 | 4069 |
| 4070 int MarkCompactCollector::SweepInParallel(PagedSpace* space, | 4070 int MarkCompactCollector::SweepInParallel(PagedSpace* space, |
| 4071 int required_freed_bytes) { | 4071 intptr_t required_freed_bytes) { |
| 4072 PageIterator it(space); | 4072 PageIterator it(space); |
| 4073 FreeList* free_list = space == heap()->old_pointer_space() | 4073 FreeList* free_list = space == heap()->old_pointer_space() |
| 4074 ? free_list_old_pointer_space_.get() | 4074 ? free_list_old_pointer_space_.get() |
| 4075 : free_list_old_data_space_.get(); | 4075 : free_list_old_data_space_.get(); |
| 4076 FreeList private_free_list(space); | 4076 FreeList private_free_list(space); |
| 4077 int max_freed = 0; | 4077 intptr_t max_freed = 0; |
| 4078 int max_freed_overall = 0; | 4078 intptr_t max_freed_overall = 0; |
| 4079 while (it.has_next()) { | 4079 while (it.has_next()) { |
| 4080 Page* p = it.next(); | 4080 Page* p = it.next(); |
| 4081 | 4081 |
| 4082 if (p->TryParallelSweeping()) { | 4082 if (p->TryParallelSweeping()) { |
| 4083 max_freed = SweepConservatively<SWEEP_IN_PARALLEL>( | 4083 max_freed = SweepConservatively<SWEEP_IN_PARALLEL>( |
| 4084 space, &private_free_list, p); | 4084 space, &private_free_list, p); |
| 4085 free_list->Concatenate(&private_free_list); | 4085 free_list->Concatenate(&private_free_list); |
| 4086 if (required_freed_bytes > 0 && max_freed >= required_freed_bytes) { | 4086 if (required_freed_bytes > 0 && max_freed >= required_freed_bytes) { |
| 4087 return max_freed; | 4087 return max_freed; |
| 4088 } | 4088 } |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4505 while (buffer != NULL) { | 4505 while (buffer != NULL) { |
| 4506 SlotsBuffer* next_buffer = buffer->next(); | 4506 SlotsBuffer* next_buffer = buffer->next(); |
| 4507 DeallocateBuffer(buffer); | 4507 DeallocateBuffer(buffer); |
| 4508 buffer = next_buffer; | 4508 buffer = next_buffer; |
| 4509 } | 4509 } |
| 4510 *buffer_address = NULL; | 4510 *buffer_address = NULL; |
| 4511 } | 4511 } |
| 4512 | 4512 |
| 4513 | 4513 |
| 4514 } } // namespace v8::internal | 4514 } } // namespace v8::internal |
| OLD | NEW |