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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 for (auto it = delayed_chunks.begin(); it != delayed_chunks.end(); ++it) { | 391 for (auto it = delayed_chunks.begin(); it != delayed_chunks.end(); ++it) { |
392 AddMemoryChunkSafe<kRegular>(*it); | 392 AddMemoryChunkSafe<kRegular>(*it); |
393 } | 393 } |
394 } | 394 } |
395 | 395 |
396 bool MemoryAllocator::CanFreeMemoryChunk(MemoryChunk* chunk) { | 396 bool MemoryAllocator::CanFreeMemoryChunk(MemoryChunk* chunk) { |
397 MarkCompactCollector* mc = isolate_->heap()->mark_compact_collector(); | 397 MarkCompactCollector* mc = isolate_->heap()->mark_compact_collector(); |
398 // We cannot free memory chunks in new space while the sweeper is running | 398 // We cannot free memory chunks in new space while the sweeper is running |
399 // since a sweeper thread might be stuck right before trying to lock the | 399 // since a sweeper thread might be stuck right before trying to lock the |
400 // corresponding page. | 400 // corresponding page. |
401 return !chunk->InNewSpace() || (mc == nullptr) || | 401 return !chunk->InNewSpace() || (mc == nullptr) || !FLAG_concurrent_sweeping || |
402 mc->sweeper().IsSweepingCompleted(); | 402 mc->sweeper().IsSweepingCompleted(); |
403 } | 403 } |
404 | 404 |
405 bool MemoryAllocator::CommitMemory(Address base, size_t size, | 405 bool MemoryAllocator::CommitMemory(Address base, size_t size, |
406 Executability executable) { | 406 Executability executable) { |
407 if (!base::VirtualMemory::CommitRegion(base, size, | 407 if (!base::VirtualMemory::CommitRegion(base, size, |
408 executable == EXECUTABLE)) { | 408 executable == EXECUTABLE)) { |
409 return false; | 409 return false; |
410 } | 410 } |
411 UpdateAllocatedSpaceLimits(base, base + size); | 411 UpdateAllocatedSpaceLimits(base, base + size); |
(...skipping 2823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3235 object->ShortPrint(); | 3235 object->ShortPrint(); |
3236 PrintF("\n"); | 3236 PrintF("\n"); |
3237 } | 3237 } |
3238 printf(" --------------------------------------\n"); | 3238 printf(" --------------------------------------\n"); |
3239 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3239 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
3240 } | 3240 } |
3241 | 3241 |
3242 #endif // DEBUG | 3242 #endif // DEBUG |
3243 } // namespace internal | 3243 } // namespace internal |
3244 } // namespace v8 | 3244 } // namespace v8 |
OLD | NEW |