| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 gc_count_at_last_idle_gc_(0), | 135 gc_count_at_last_idle_gc_(0), |
| 136 full_codegen_bytes_generated_(0), | 136 full_codegen_bytes_generated_(0), |
| 137 crankshaft_codegen_bytes_generated_(0), | 137 crankshaft_codegen_bytes_generated_(0), |
| 138 gcs_since_last_deopt_(0), | 138 gcs_since_last_deopt_(0), |
| 139 allocation_sites_scratchpad_length_(0), | 139 allocation_sites_scratchpad_length_(0), |
| 140 promotion_queue_(this), | 140 promotion_queue_(this), |
| 141 configured_(false), | 141 configured_(false), |
| 142 external_string_table_(this), | 142 external_string_table_(this), |
| 143 chunks_queued_for_free_(NULL), | 143 chunks_queued_for_free_(NULL), |
| 144 gc_callbacks_depth_(0), | 144 gc_callbacks_depth_(0), |
| 145 deserialization_complete_(false) { | 145 deserialization_complete_(false), |
| 146 concurrent_sweeping_enabled_(false) { |
| 146 // Allow build-time customization of the max semispace size. Building | 147 // Allow build-time customization of the max semispace size. Building |
| 147 // V8 with snapshots and a non-default max semispace size is much | 148 // V8 with snapshots and a non-default max semispace size is much |
| 148 // easier if you can define it as part of the build environment. | 149 // easier if you can define it as part of the build environment. |
| 149 #if defined(V8_MAX_SEMISPACE_SIZE) | 150 #if defined(V8_MAX_SEMISPACE_SIZE) |
| 150 max_semi_space_size_ = reserved_semispace_size_ = V8_MAX_SEMISPACE_SIZE; | 151 max_semi_space_size_ = reserved_semispace_size_ = V8_MAX_SEMISPACE_SIZE; |
| 151 #endif | 152 #endif |
| 152 | 153 |
| 153 // Ensure old_generation_size_ is a multiple of kPageSize. | 154 // Ensure old_generation_size_ is a multiple of kPageSize. |
| 154 DCHECK(MB >= Page::kPageSize); | 155 DCHECK(MB >= Page::kPageSize); |
| 155 | 156 |
| (...skipping 5298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5454 // call Heap::TearDown() to release allocated memory. | 5455 // call Heap::TearDown() to release allocated memory. |
| 5455 // | 5456 // |
| 5456 // If the heap is not yet configured (e.g. through the API), configure it. | 5457 // If the heap is not yet configured (e.g. through the API), configure it. |
| 5457 // Configuration is based on the flags new-space-size (really the semispace | 5458 // Configuration is based on the flags new-space-size (really the semispace |
| 5458 // size) and old-space-size if set or the initial values of semispace_size_ | 5459 // size) and old-space-size if set or the initial values of semispace_size_ |
| 5459 // and old_generation_size_ otherwise. | 5460 // and old_generation_size_ otherwise. |
| 5460 if (!configured_) { | 5461 if (!configured_) { |
| 5461 if (!ConfigureHeapDefault()) return false; | 5462 if (!ConfigureHeapDefault()) return false; |
| 5462 } | 5463 } |
| 5463 | 5464 |
| 5465 concurrent_sweeping_enabled_ = |
| 5466 FLAG_concurrent_sweeping && isolate_->max_available_threads() > 1; |
| 5467 |
| 5464 base::CallOnce(&initialize_gc_once, &InitializeGCOnce); | 5468 base::CallOnce(&initialize_gc_once, &InitializeGCOnce); |
| 5465 | 5469 |
| 5466 MarkMapPointersAsEncoded(false); | 5470 MarkMapPointersAsEncoded(false); |
| 5467 | 5471 |
| 5468 // Set up memory allocator. | 5472 // Set up memory allocator. |
| 5469 if (!isolate_->memory_allocator()->SetUp(MaxReserved(), MaxExecutableSize())) | 5473 if (!isolate_->memory_allocator()->SetUp(MaxReserved(), MaxExecutableSize())) |
| 5470 return false; | 5474 return false; |
| 5471 | 5475 |
| 5472 // Set up new space. | 5476 // Set up new space. |
| 5473 if (!new_space_.SetUp(reserved_semispace_size_, max_semi_space_size_)) { | 5477 if (!new_space_.SetUp(reserved_semispace_size_, max_semi_space_size_)) { |
| (...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6545 static_cast<int>(object_sizes_last_time_[index])); | 6549 static_cast<int>(object_sizes_last_time_[index])); |
| 6546 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6550 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
| 6547 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6551 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
| 6548 | 6552 |
| 6549 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6553 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
| 6550 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6554 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
| 6551 ClearObjectStats(); | 6555 ClearObjectStats(); |
| 6552 } | 6556 } |
| 6553 } | 6557 } |
| 6554 } // namespace v8::internal | 6558 } // namespace v8::internal |
| OLD | NEW |