| 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 4916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4927 // checking of the sync flag in the snapshot would fail. | 4927 // checking of the sync flag in the snapshot would fail. |
| 4928 } | 4928 } |
| 4929 | 4929 |
| 4930 | 4930 |
| 4931 // TODO(1236194): Since the heap size is configurable on the command line | 4931 // TODO(1236194): Since the heap size is configurable on the command line |
| 4932 // and through the API, we should gracefully handle the case that the heap | 4932 // and through the API, we should gracefully handle the case that the heap |
| 4933 // size is not big enough to fit all the initial objects. | 4933 // size is not big enough to fit all the initial objects. |
| 4934 bool Heap::ConfigureHeap(int max_semi_space_size, | 4934 bool Heap::ConfigureHeap(int max_semi_space_size, |
| 4935 int max_old_space_size, | 4935 int max_old_space_size, |
| 4936 int max_executable_size, | 4936 int max_executable_size, |
| 4937 int code_range_size) { | 4937 size_t code_range_size) { |
| 4938 if (HasBeenSetUp()) return false; | 4938 if (HasBeenSetUp()) return false; |
| 4939 | 4939 |
| 4940 // Overwrite default configuration. | 4940 // Overwrite default configuration. |
| 4941 if (max_semi_space_size > 0) { | 4941 if (max_semi_space_size > 0) { |
| 4942 max_semi_space_size_ = max_semi_space_size * MB; | 4942 max_semi_space_size_ = max_semi_space_size * MB; |
| 4943 } | 4943 } |
| 4944 if (max_old_space_size > 0) { | 4944 if (max_old_space_size > 0) { |
| 4945 max_old_generation_size_ = max_old_space_size * MB; | 4945 max_old_generation_size_ = max_old_space_size * MB; |
| 4946 } | 4946 } |
| 4947 if (max_executable_size > 0) { | 4947 if (max_executable_size > 0) { |
| (...skipping 1482 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 |