| 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/heap/heap.h" | 5 #include "src/heap/heap.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api.h" | 8 #include "src/api.h" |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
| (...skipping 5943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5954 next = chunk->next_chunk(); | 5954 next = chunk->next_chunk(); |
| 5955 chunk->SetFlag(MemoryChunk::ABOUT_TO_BE_FREED); | 5955 chunk->SetFlag(MemoryChunk::ABOUT_TO_BE_FREED); |
| 5956 } | 5956 } |
| 5957 store_buffer()->Compact(); | 5957 store_buffer()->Compact(); |
| 5958 store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); | 5958 store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); |
| 5959 } | 5959 } |
| 5960 | 5960 |
| 5961 | 5961 |
| 5962 void Heap::FreeQueuedChunks() { | 5962 void Heap::FreeQueuedChunks() { |
| 5963 if (chunks_queued_for_free_ != NULL) { | 5963 if (chunks_queued_for_free_ != NULL) { |
| 5964 V8::GetCurrentPlatform()->CallOnBackgroundThread( | 5964 if (FLAG_concurrent_sweeping) { |
| 5965 new UnmapFreeMemoryTask(this, chunks_queued_for_free_), | 5965 V8::GetCurrentPlatform()->CallOnBackgroundThread( |
| 5966 v8::Platform::kShortRunningTask); | 5966 new UnmapFreeMemoryTask(this, chunks_queued_for_free_), |
| 5967 v8::Platform::kShortRunningTask); |
| 5968 } else { |
| 5969 FreeQueuedChunks(chunks_queued_for_free_); |
| 5970 pending_unmapping_tasks_semaphore_.Signal(); |
| 5971 } |
| 5967 chunks_queued_for_free_ = NULL; | 5972 chunks_queued_for_free_ = NULL; |
| 5968 } else { | 5973 } else { |
| 5969 // If we do not have anything to unmap, we just signal the semaphore | 5974 // If we do not have anything to unmap, we just signal the semaphore |
| 5970 // that we are done. | 5975 // that we are done. |
| 5971 pending_unmapping_tasks_semaphore_.Signal(); | 5976 pending_unmapping_tasks_semaphore_.Signal(); |
| 5972 } | 5977 } |
| 5973 concurrent_unmapping_tasks_active_++; | 5978 concurrent_unmapping_tasks_active_++; |
| 5974 } | 5979 } |
| 5975 | 5980 |
| 5976 | 5981 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6084 } | 6089 } |
| 6085 | 6090 |
| 6086 | 6091 |
| 6087 // static | 6092 // static |
| 6088 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6093 int Heap::GetStaticVisitorIdForMap(Map* map) { |
| 6089 return StaticVisitorBase::GetVisitorId(map); | 6094 return StaticVisitorBase::GetVisitorId(map); |
| 6090 } | 6095 } |
| 6091 | 6096 |
| 6092 } // namespace internal | 6097 } // namespace internal |
| 6093 } // namespace v8 | 6098 } // namespace v8 |
| OLD | NEW |