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/v8.h" | 5 #include "src/v8.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/once.h" | 9 #include "src/base/once.h" |
10 #include "src/base/utils/random-number-generator.h" | 10 #include "src/base/utils/random-number-generator.h" |
(...skipping 3284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3295 if (lo_space()->Contains(object)) return false; | 3295 if (lo_space()->Contains(object)) return false; |
3296 | 3296 |
3297 Page* page = Page::FromAddress(address); | 3297 Page* page = Page::FromAddress(address); |
3298 // We can move the object start if: | 3298 // We can move the object start if: |
3299 // (1) the object is not in old pointer or old data space, | 3299 // (1) the object is not in old pointer or old data space, |
3300 // (2) the page of the object was already swept, | 3300 // (2) the page of the object was already swept, |
3301 // (3) the page was already concurrently swept. This case is an optimization | 3301 // (3) the page was already concurrently swept. This case is an optimization |
3302 // for concurrent sweeping. The WasSwept predicate for concurrently swept | 3302 // for concurrent sweeping. The WasSwept predicate for concurrently swept |
3303 // pages is set after sweeping all pages. | 3303 // pages is set after sweeping all pages. |
3304 return (!is_in_old_pointer_space && !is_in_old_data_space) || | 3304 return (!is_in_old_pointer_space && !is_in_old_data_space) || |
3305 page->WasSwept() || | 3305 page->WasSwept() || page->SweepingCompleted(); |
3306 (page->parallel_sweeping() <= MemoryChunk::SWEEPING_FINALIZE); | |
3307 } | 3306 } |
3308 | 3307 |
3309 | 3308 |
3310 void Heap::AdjustLiveBytes(Address address, int by, InvocationMode mode) { | 3309 void Heap::AdjustLiveBytes(Address address, int by, InvocationMode mode) { |
3311 if (incremental_marking()->IsMarking() && | 3310 if (incremental_marking()->IsMarking() && |
3312 Marking::IsBlack(Marking::MarkBitFrom(address))) { | 3311 Marking::IsBlack(Marking::MarkBitFrom(address))) { |
3313 if (mode == FROM_GC) { | 3312 if (mode == FROM_GC) { |
3314 MemoryChunk::IncrementLiveBytesFromGC(address, by); | 3313 MemoryChunk::IncrementLiveBytesFromGC(address, by); |
3315 } else { | 3314 } else { |
3316 MemoryChunk::IncrementLiveBytesFromMutator(address, by); | 3315 MemoryChunk::IncrementLiveBytesFromMutator(address, by); |
(...skipping 2913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6230 static_cast<int>(object_sizes_last_time_[index])); | 6229 static_cast<int>(object_sizes_last_time_[index])); |
6231 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6230 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6232 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6231 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6233 | 6232 |
6234 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6233 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6235 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6234 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6236 ClearObjectStats(); | 6235 ClearObjectStats(); |
6237 } | 6236 } |
6238 | 6237 |
6239 } } // namespace v8::internal | 6238 } } // namespace v8::internal |
OLD | NEW |