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/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 5252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5263 // call Heap::TearDown() to release allocated memory. | 5263 // call Heap::TearDown() to release allocated memory. |
5264 // | 5264 // |
5265 // If the heap is not yet configured (e.g. through the API), configure it. | 5265 // If the heap is not yet configured (e.g. through the API), configure it. |
5266 // Configuration is based on the flags new-space-size (really the semispace | 5266 // Configuration is based on the flags new-space-size (really the semispace |
5267 // size) and old-space-size if set or the initial values of semispace_size_ | 5267 // size) and old-space-size if set or the initial values of semispace_size_ |
5268 // and old_generation_size_ otherwise. | 5268 // and old_generation_size_ otherwise. |
5269 if (!configured_) { | 5269 if (!configured_) { |
5270 if (!ConfigureHeapDefault()) return false; | 5270 if (!ConfigureHeapDefault()) return false; |
5271 } | 5271 } |
5272 | 5272 |
5273 concurrent_sweeping_enabled_ = | 5273 concurrent_sweeping_enabled_ = FLAG_concurrent_sweeping; |
5274 FLAG_concurrent_sweeping && isolate_->max_available_threads() > 1; | |
5275 | 5274 |
5276 base::CallOnce(&initialize_gc_once, &InitializeGCOnce); | 5275 base::CallOnce(&initialize_gc_once, &InitializeGCOnce); |
5277 | 5276 |
5278 MarkMapPointersAsEncoded(false); | 5277 MarkMapPointersAsEncoded(false); |
5279 | 5278 |
5280 // Set up memory allocator. | 5279 // Set up memory allocator. |
5281 if (!isolate_->memory_allocator()->SetUp(MaxReserved(), MaxExecutableSize())) | 5280 if (!isolate_->memory_allocator()->SetUp(MaxReserved(), MaxExecutableSize())) |
5282 return false; | 5281 return false; |
5283 | 5282 |
5284 // Set up new space. | 5283 // Set up new space. |
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6310 static_cast<int>(object_sizes_last_time_[index])); | 6309 static_cast<int>(object_sizes_last_time_[index])); |
6311 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6310 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6312 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6311 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6313 | 6312 |
6314 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6313 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6315 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6314 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6316 ClearObjectStats(); | 6315 ClearObjectStats(); |
6317 } | 6316 } |
6318 } | 6317 } |
6319 } // namespace v8::internal | 6318 } // namespace v8::internal |
OLD | NEW |