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"); |
360 } | 361 } |
361 | 362 |
362 Unmapper* unmapper_; | 363 Unmapper* unmapper_; |
363 DISALLOW_COPY_AND_ASSIGN(UnmapFreeMemoryTask); | 364 DISALLOW_COPY_AND_ASSIGN(UnmapFreeMemoryTask); |
364 }; | 365 }; |
365 | 366 |
366 void MemoryAllocator::Unmapper::FreeQueuedChunks() { | 367 void MemoryAllocator::Unmapper::FreeQueuedChunks() { |
367 if (FLAG_concurrent_sweeping) { | 368 if (FLAG_concurrent_sweeping) { |
368 V8::GetCurrentPlatform()->CallOnBackgroundThread( | 369 V8::GetCurrentPlatform()->CallOnBackgroundThread( |
369 new UnmapFreeMemoryTask(this), v8::Platform::kShortRunningTask); | 370 new UnmapFreeMemoryTask(this), v8::Platform::kShortRunningTask); |
(...skipping 2851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3221 object->ShortPrint(); | 3222 object->ShortPrint(); |
3222 PrintF("\n"); | 3223 PrintF("\n"); |
3223 } | 3224 } |
3224 printf(" --------------------------------------\n"); | 3225 printf(" --------------------------------------\n"); |
3225 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3226 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
3226 } | 3227 } |
3227 | 3228 |
3228 #endif // DEBUG | 3229 #endif // DEBUG |
3229 } // namespace internal | 3230 } // namespace internal |
3230 } // namespace v8 | 3231 } // namespace v8 |
OLD | NEW |