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/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 4946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4957 } | 4957 } |
4958 if (FLAG_max_executable_size > 0) { | 4958 if (FLAG_max_executable_size > 0) { |
4959 max_executable_size_ = FLAG_max_executable_size * MB; | 4959 max_executable_size_ = FLAG_max_executable_size * MB; |
4960 } | 4960 } |
4961 | 4961 |
4962 if (FLAG_stress_compaction) { | 4962 if (FLAG_stress_compaction) { |
4963 // This will cause more frequent GCs when stressing. | 4963 // This will cause more frequent GCs when stressing. |
4964 max_semi_space_size_ = Page::kPageSize; | 4964 max_semi_space_size_ = Page::kPageSize; |
4965 } | 4965 } |
4966 | 4966 |
4967 if (Snapshot::HaveASnapshotToStartFrom()) { | 4967 if (Snapshot::IsEnabled()) { |
4968 // If we are using a snapshot we always reserve the default amount | 4968 // If we are using a snapshot we always reserve the default amount |
4969 // of memory for each semispace because code in the snapshot has | 4969 // of memory for each semispace because code in the snapshot has |
4970 // write-barrier code that relies on the size and alignment of new | 4970 // write-barrier code that relies on the size and alignment of new |
4971 // space. We therefore cannot use a larger max semispace size | 4971 // space. We therefore cannot use a larger max semispace size |
4972 // than the default reserved semispace size. | 4972 // than the default reserved semispace size. |
4973 if (max_semi_space_size_ > reserved_semispace_size_) { | 4973 if (max_semi_space_size_ > reserved_semispace_size_) { |
4974 max_semi_space_size_ = reserved_semispace_size_; | 4974 max_semi_space_size_ = reserved_semispace_size_; |
4975 if (FLAG_trace_gc) { | 4975 if (FLAG_trace_gc) { |
4976 PrintPID("Max semi-space size cannot be more than %d kbytes\n", | 4976 PrintPID("Max semi-space size cannot be more than %d kbytes\n", |
4977 reserved_semispace_size_ >> 10); | 4977 reserved_semispace_size_ >> 10); |
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6430 static_cast<int>(object_sizes_last_time_[index])); | 6430 static_cast<int>(object_sizes_last_time_[index])); |
6431 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6431 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6432 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6432 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6433 | 6433 |
6434 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6434 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6435 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6435 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6436 ClearObjectStats(); | 6436 ClearObjectStats(); |
6437 } | 6437 } |
6438 | 6438 |
6439 } } // namespace v8::internal | 6439 } } // namespace v8::internal |
OLD | NEW |