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 5177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5188 } | 5188 } |
5189 if (FLAG_max_executable_size > 0) { | 5189 if (FLAG_max_executable_size > 0) { |
5190 max_executable_size_ = static_cast<intptr_t>(FLAG_max_executable_size) * MB; | 5190 max_executable_size_ = static_cast<intptr_t>(FLAG_max_executable_size) * MB; |
5191 } | 5191 } |
5192 | 5192 |
5193 if (FLAG_stress_compaction) { | 5193 if (FLAG_stress_compaction) { |
5194 // This will cause more frequent GCs when stressing. | 5194 // This will cause more frequent GCs when stressing. |
5195 max_semi_space_size_ = Page::kPageSize; | 5195 max_semi_space_size_ = Page::kPageSize; |
5196 } | 5196 } |
5197 | 5197 |
5198 if (Snapshot::HaveASnapshotToStartFrom()) { | 5198 if (isolate()->snapshot_available()) { |
5199 // If we are using a snapshot we always reserve the default amount | 5199 // If we are using a snapshot we always reserve the default amount |
5200 // of memory for each semispace because code in the snapshot has | 5200 // of memory for each semispace because code in the snapshot has |
5201 // write-barrier code that relies on the size and alignment of new | 5201 // write-barrier code that relies on the size and alignment of new |
5202 // space. We therefore cannot use a larger max semispace size | 5202 // space. We therefore cannot use a larger max semispace size |
5203 // than the default reserved semispace size. | 5203 // than the default reserved semispace size. |
5204 if (max_semi_space_size_ > reserved_semispace_size_) { | 5204 if (max_semi_space_size_ > reserved_semispace_size_) { |
5205 max_semi_space_size_ = reserved_semispace_size_; | 5205 max_semi_space_size_ = reserved_semispace_size_; |
5206 if (FLAG_trace_gc) { | 5206 if (FLAG_trace_gc) { |
5207 PrintPID("Max semi-space size cannot be more than %d kbytes\n", | 5207 PrintPID("Max semi-space size cannot be more than %d kbytes\n", |
5208 reserved_semispace_size_ >> 10); | 5208 reserved_semispace_size_ >> 10); |
(...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6522 static_cast<int>(object_sizes_last_time_[index])); | 6522 static_cast<int>(object_sizes_last_time_[index])); |
6523 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6523 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6524 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6524 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6525 | 6525 |
6526 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6526 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6527 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6527 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6528 ClearObjectStats(); | 6528 ClearObjectStats(); |
6529 } | 6529 } |
6530 } | 6530 } |
6531 } // namespace v8::internal | 6531 } // namespace v8::internal |
OLD | NEW |