| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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/spaces.h" | 5 #include "src/heap/spaces.h" |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/base/platform/platform.h" | 8 #include "src/base/platform/platform.h" |
| 9 #include "src/base/platform/semaphore.h" | 9 #include "src/base/platform/semaphore.h" |
| 10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 } | 349 } |
| 350 | 350 |
| 351 class MemoryAllocator::Unmapper::UnmapFreeMemoryTask : public v8::Task { | 351 class MemoryAllocator::Unmapper::UnmapFreeMemoryTask : public v8::Task { |
| 352 public: | 352 public: |
| 353 explicit UnmapFreeMemoryTask(Unmapper* unmapper) : unmapper_(unmapper) {} | 353 explicit UnmapFreeMemoryTask(Unmapper* unmapper) : unmapper_(unmapper) {} |
| 354 | 354 |
| 355 private: | 355 private: |
| 356 // v8::Task overrides. | 356 // v8::Task overrides. |
| 357 void Run() override { | 357 void Run() override { |
| 358 unmapper_->PerformFreeMemoryOnQueuedChunks(); | 358 unmapper_->PerformFreeMemoryOnQueuedChunks(); |
| 359 unmapper_->pending_unmapping_tasks_semaphore_.Signal( | 359 unmapper_->pending_unmapping_tasks_semaphore_.Signal(); |
| 360 "Unmapper::UnmapFreeMemoryTask::Run"); | |
| 361 } | 360 } |
| 362 | 361 |
| 363 Unmapper* unmapper_; | 362 Unmapper* unmapper_; |
| 364 DISALLOW_COPY_AND_ASSIGN(UnmapFreeMemoryTask); | 363 DISALLOW_COPY_AND_ASSIGN(UnmapFreeMemoryTask); |
| 365 }; | 364 }; |
| 366 | 365 |
| 367 void MemoryAllocator::Unmapper::FreeQueuedChunks() { | 366 void MemoryAllocator::Unmapper::FreeQueuedChunks() { |
| 368 if (FLAG_concurrent_sweeping) { | 367 if (FLAG_concurrent_sweeping) { |
| 369 V8::GetCurrentPlatform()->CallOnBackgroundThread( | 368 V8::GetCurrentPlatform()->CallOnBackgroundThread( |
| 370 new UnmapFreeMemoryTask(this), v8::Platform::kShortRunningTask); | 369 new UnmapFreeMemoryTask(this), v8::Platform::kShortRunningTask); |
| (...skipping 2855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3226 object->ShortPrint(); | 3225 object->ShortPrint(); |
| 3227 PrintF("\n"); | 3226 PrintF("\n"); |
| 3228 } | 3227 } |
| 3229 printf(" --------------------------------------\n"); | 3228 printf(" --------------------------------------\n"); |
| 3230 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3229 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
| 3231 } | 3230 } |
| 3232 | 3231 |
| 3233 #endif // DEBUG | 3232 #endif // DEBUG |
| 3234 } // namespace internal | 3233 } // namespace internal |
| 3235 } // namespace v8 | 3234 } // namespace v8 |
| OLD | NEW |