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/once.h" | 10 #include "src/base/once.h" |
10 #include "src/base/utils/random-number-generator.h" | 11 #include "src/base/utils/random-number-generator.h" |
11 #include "src/bootstrapper.h" | 12 #include "src/bootstrapper.h" |
12 #include "src/codegen.h" | 13 #include "src/codegen.h" |
13 #include "src/compilation-cache.h" | 14 #include "src/compilation-cache.h" |
14 #include "src/conversions.h" | 15 #include "src/conversions.h" |
15 #include "src/cpu-profiler.h" | 16 #include "src/cpu-profiler.h" |
16 #include "src/debug.h" | 17 #include "src/debug.h" |
17 #include "src/deoptimizer.h" | 18 #include "src/deoptimizer.h" |
18 #include "src/global-handles.h" | 19 #include "src/global-handles.h" |
(...skipping 4828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4847 } | 4848 } |
4848 | 4849 |
4849 // The max executable size must be less than or equal to the max old | 4850 // The max executable size must be less than or equal to the max old |
4850 // generation size. | 4851 // generation size. |
4851 if (max_executable_size_ > max_old_generation_size_) { | 4852 if (max_executable_size_ > max_old_generation_size_) { |
4852 max_executable_size_ = max_old_generation_size_; | 4853 max_executable_size_ = max_old_generation_size_; |
4853 } | 4854 } |
4854 | 4855 |
4855 // The new space size must be a power of two to support single-bit testing | 4856 // The new space size must be a power of two to support single-bit testing |
4856 // for containment. | 4857 // for containment. |
4857 max_semi_space_size_ = RoundUpToPowerOf2(max_semi_space_size_); | 4858 max_semi_space_size_ = |
4858 reserved_semispace_size_ = RoundUpToPowerOf2(reserved_semispace_size_); | 4859 base::bits::RoundUpToPowerOfTwo32(max_semi_space_size_); |
| 4860 reserved_semispace_size_ = |
| 4861 base::bits::RoundUpToPowerOfTwo32(reserved_semispace_size_); |
4859 | 4862 |
4860 if (FLAG_min_semi_space_size > 0) { | 4863 if (FLAG_min_semi_space_size > 0) { |
4861 int initial_semispace_size = FLAG_min_semi_space_size * MB; | 4864 int initial_semispace_size = FLAG_min_semi_space_size * MB; |
4862 if (initial_semispace_size > max_semi_space_size_) { | 4865 if (initial_semispace_size > max_semi_space_size_) { |
4863 initial_semispace_size_ = max_semi_space_size_; | 4866 initial_semispace_size_ = max_semi_space_size_; |
4864 if (FLAG_trace_gc) { | 4867 if (FLAG_trace_gc) { |
4865 PrintPID( | 4868 PrintPID( |
4866 "Min semi-space size cannot be more than the maximum" | 4869 "Min semi-space size cannot be more than the maximum" |
4867 "semi-space size of %d MB\n", | 4870 "semi-space size of %d MB\n", |
4868 max_semi_space_size_); | 4871 max_semi_space_size_); |
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6120 static_cast<int>(object_sizes_last_time_[index])); | 6123 static_cast<int>(object_sizes_last_time_[index])); |
6121 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6124 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6122 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6125 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6123 | 6126 |
6124 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6127 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6125 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6128 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6126 ClearObjectStats(); | 6129 ClearObjectStats(); |
6127 } | 6130 } |
6128 } | 6131 } |
6129 } // namespace v8::internal | 6132 } // namespace v8::internal |
OLD | NEW |