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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 } | 348 } |
349 | 349 |
350 class MemoryAllocator::Unmapper::UnmapFreeMemoryTask : public v8::Task { | 350 class MemoryAllocator::Unmapper::UnmapFreeMemoryTask : public v8::Task { |
351 public: | 351 public: |
352 explicit UnmapFreeMemoryTask(Unmapper* unmapper) : unmapper_(unmapper) {} | 352 explicit UnmapFreeMemoryTask(Unmapper* unmapper) : unmapper_(unmapper) {} |
353 | 353 |
354 private: | 354 private: |
355 // v8::Task overrides. | 355 // v8::Task overrides. |
356 void Run() override { | 356 void Run() override { |
357 unmapper_->PerformFreeMemoryOnQueuedChunks(); | 357 unmapper_->PerformFreeMemoryOnQueuedChunks(); |
358 unmapper_->pending_unmapping_tasks_semaphore_.Signal( | 358 unmapper_->pending_unmapping_tasks_semaphore_.Signal(); |
359 "Unmapper::UnmapFreeMemoryTask::Run"); | |
360 } | 359 } |
361 | 360 |
362 Unmapper* unmapper_; | 361 Unmapper* unmapper_; |
363 DISALLOW_COPY_AND_ASSIGN(UnmapFreeMemoryTask); | 362 DISALLOW_COPY_AND_ASSIGN(UnmapFreeMemoryTask); |
364 }; | 363 }; |
365 | 364 |
366 void MemoryAllocator::Unmapper::FreeQueuedChunks() { | 365 void MemoryAllocator::Unmapper::FreeQueuedChunks() { |
367 if (FLAG_concurrent_sweeping) { | 366 if (FLAG_concurrent_sweeping) { |
368 V8::GetCurrentPlatform()->CallOnBackgroundThread( | 367 V8::GetCurrentPlatform()->CallOnBackgroundThread( |
369 new UnmapFreeMemoryTask(this), v8::Platform::kShortRunningTask); | 368 new UnmapFreeMemoryTask(this), v8::Platform::kShortRunningTask); |
(...skipping 2851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3221 object->ShortPrint(); | 3220 object->ShortPrint(); |
3222 PrintF("\n"); | 3221 PrintF("\n"); |
3223 } | 3222 } |
3224 printf(" --------------------------------------\n"); | 3223 printf(" --------------------------------------\n"); |
3225 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3224 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
3226 } | 3225 } |
3227 | 3226 |
3228 #endif // DEBUG | 3227 #endif // DEBUG |
3229 } // namespace internal | 3228 } // namespace internal |
3230 } // namespace v8 | 3229 } // namespace v8 |
OLD | NEW |