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 5022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5033 target_semispace_size_ = max_semi_space_size_; | 5033 target_semispace_size_ = max_semi_space_size_; |
5034 if (FLAG_trace_gc) { | 5034 if (FLAG_trace_gc) { |
5035 PrintPID( | 5035 PrintPID( |
5036 "Target semi-space size cannot be less than the maximum " | 5036 "Target semi-space size cannot be less than the maximum " |
5037 "semi-space size of %d MB\n", | 5037 "semi-space size of %d MB\n", |
5038 max_semi_space_size_ / MB); | 5038 max_semi_space_size_ / MB); |
5039 } | 5039 } |
5040 } else { | 5040 } else { |
5041 target_semispace_size_ = target_semispace_size; | 5041 target_semispace_size_ = target_semispace_size; |
5042 } | 5042 } |
5043 } else { | |
5044 target_semispace_size_ = max_semi_space_size_; | |
5045 } | 5043 } |
5046 | 5044 |
| 5045 target_semispace_size_ = Max(initial_semispace_size_, target_semispace_size_); |
5047 | 5046 |
5048 // The old generation is paged and needs at least one page for each space. | 5047 // The old generation is paged and needs at least one page for each space. |
5049 int paged_space_count = LAST_PAGED_SPACE - FIRST_PAGED_SPACE + 1; | 5048 int paged_space_count = LAST_PAGED_SPACE - FIRST_PAGED_SPACE + 1; |
5050 max_old_generation_size_ = | 5049 max_old_generation_size_ = |
5051 Max(static_cast<intptr_t>(paged_space_count * Page::kPageSize), | 5050 Max(static_cast<intptr_t>(paged_space_count * Page::kPageSize), |
5052 max_old_generation_size_); | 5051 max_old_generation_size_); |
5053 | 5052 |
5054 // We rely on being able to allocate new arrays in paged spaces. | 5053 // We rely on being able to allocate new arrays in paged spaces. |
5055 DCHECK(Page::kMaxRegularHeapObjectSize >= | 5054 DCHECK(Page::kMaxRegularHeapObjectSize >= |
5056 (JSArray::kSize + | 5055 (JSArray::kSize + |
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6294 static_cast<int>(object_sizes_last_time_[index])); | 6293 static_cast<int>(object_sizes_last_time_[index])); |
6295 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6294 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6296 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6295 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6297 | 6296 |
6298 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6297 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6299 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6298 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6300 ClearObjectStats(); | 6299 ClearObjectStats(); |
6301 } | 6300 } |
6302 } | 6301 } |
6303 } // namespace v8::internal | 6302 } // namespace v8::internal |
OLD | NEW |