OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 reserved_semispace_size_(8 * (kPointerSize / 4) * MB), | 74 reserved_semispace_size_(8 * (kPointerSize / 4) * MB), |
75 max_semispace_size_(8 * (kPointerSize / 4) * MB), | 75 max_semispace_size_(8 * (kPointerSize / 4) * MB), |
76 initial_semispace_size_(Page::kPageSize), | 76 initial_semispace_size_(Page::kPageSize), |
77 max_old_generation_size_(700ul * (kPointerSize / 4) * MB), | 77 max_old_generation_size_(700ul * (kPointerSize / 4) * MB), |
78 max_executable_size_(256ul * (kPointerSize / 4) * MB), | 78 max_executable_size_(256ul * (kPointerSize / 4) * MB), |
79 // Variables set based on semispace_size_ and old_generation_size_ in | 79 // Variables set based on semispace_size_ and old_generation_size_ in |
80 // ConfigureHeap (survived_since_last_expansion_, external_allocation_limit_) | 80 // ConfigureHeap (survived_since_last_expansion_, external_allocation_limit_) |
81 // Will be 4 * reserved_semispace_size_ to ensure that young | 81 // Will be 4 * reserved_semispace_size_ to ensure that young |
82 // generation can be aligned to its size. | 82 // generation can be aligned to its size. |
83 maximum_committed_(0), | 83 maximum_committed_(0), |
84 old_generation_growing_factor_(4), | |
84 survived_since_last_expansion_(0), | 85 survived_since_last_expansion_(0), |
85 sweep_generation_(0), | 86 sweep_generation_(0), |
86 always_allocate_scope_depth_(0), | 87 always_allocate_scope_depth_(0), |
87 linear_allocation_scope_depth_(0), | 88 linear_allocation_scope_depth_(0), |
88 contexts_disposed_(0), | 89 contexts_disposed_(0), |
89 global_ic_age_(0), | 90 global_ic_age_(0), |
90 flush_monomorphic_ics_(false), | 91 flush_monomorphic_ics_(false), |
91 scan_on_scavenge_pages_(0), | 92 scan_on_scavenge_pages_(0), |
92 new_space_(this), | 93 new_space_(this), |
93 old_pointer_space_(NULL), | 94 old_pointer_space_(NULL), |
(...skipping 5851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5945 Page::kPageSize)); | 5946 Page::kPageSize)); |
5946 | 5947 |
5947 // We rely on being able to allocate new arrays in paged spaces. | 5948 // We rely on being able to allocate new arrays in paged spaces. |
5948 ASSERT(Page::kMaxRegularHeapObjectSize >= | 5949 ASSERT(Page::kMaxRegularHeapObjectSize >= |
5949 (JSArray::kSize + | 5950 (JSArray::kSize + |
5950 FixedArray::SizeFor(JSObject::kInitialMaxFastElementArray) + | 5951 FixedArray::SizeFor(JSObject::kInitialMaxFastElementArray) + |
5951 AllocationMemento::kSize)); | 5952 AllocationMemento::kSize)); |
5952 | 5953 |
5953 code_range_size_ = code_range_size; | 5954 code_range_size_ = code_range_size; |
5954 | 5955 |
5956 // We set the old generation growing factor to 2 to grow the heap slower on | |
5957 // low memory devices. | |
5958 if (max_old_generation_size_ <= 256 * MB) { | |
Michael Starzinger
2014/04/15 12:11:50
I personally am fine with hard-coding this constan
rmcilroy
2014/04/15 12:43:01
I'm fine with this being hard-coded as well, but c
Hannes Payer (out of office)
2014/04/16 07:53:01
Done.
Hannes Payer (out of office)
2014/04/16 07:53:01
Done.
| |
5959 old_generation_growing_factor_ = 2; | |
5960 } | |
5961 | |
5955 configured_ = true; | 5962 configured_ = true; |
5956 return true; | 5963 return true; |
5957 } | 5964 } |
5958 | 5965 |
5959 | 5966 |
5960 bool Heap::ConfigureHeapDefault() { | 5967 bool Heap::ConfigureHeapDefault() { |
5961 return ConfigureHeap(static_cast<intptr_t>(FLAG_max_new_space_size / 2) * KB, | 5968 return ConfigureHeap(static_cast<intptr_t>(FLAG_max_new_space_size / 2) * KB, |
5962 static_cast<intptr_t>(FLAG_max_old_space_size) * MB, | 5969 static_cast<intptr_t>(FLAG_max_old_space_size) * MB, |
5963 static_cast<intptr_t>(FLAG_max_executable_size) * MB, | 5970 static_cast<intptr_t>(FLAG_max_executable_size) * MB, |
5964 static_cast<intptr_t>(0)); | 5971 static_cast<intptr_t>(0)); |
(...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7356 static_cast<int>(object_sizes_last_time_[index])); | 7363 static_cast<int>(object_sizes_last_time_[index])); |
7357 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 7364 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
7358 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7365 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
7359 | 7366 |
7360 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7367 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
7361 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7368 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
7362 ClearObjectStats(); | 7369 ClearObjectStats(); |
7363 } | 7370 } |
7364 | 7371 |
7365 } } // namespace v8::internal | 7372 } } // namespace v8::internal |
OLD | NEW |