| 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 "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #include "accessors.h" | 7 #include "accessors.h" |
| 8 #include "api.h" | 8 #include "api.h" |
| 9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
| 10 #include "codegen.h" | 10 #include "codegen.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 reserved_semispace_size_(8 * (kPointerSize / 4) * MB), | 51 reserved_semispace_size_(8 * (kPointerSize / 4) * MB), |
| 52 max_semi_space_size_(8 * (kPointerSize / 4) * MB), | 52 max_semi_space_size_(8 * (kPointerSize / 4) * MB), |
| 53 initial_semispace_size_(Page::kPageSize), | 53 initial_semispace_size_(Page::kPageSize), |
| 54 max_old_generation_size_(700ul * (kPointerSize / 4) * MB), | 54 max_old_generation_size_(700ul * (kPointerSize / 4) * MB), |
| 55 max_executable_size_(256ul * (kPointerSize / 4) * MB), | 55 max_executable_size_(256ul * (kPointerSize / 4) * MB), |
| 56 // Variables set based on semispace_size_ and old_generation_size_ in | 56 // Variables set based on semispace_size_ and old_generation_size_ in |
| 57 // ConfigureHeap (survived_since_last_expansion_, external_allocation_limit_) | 57 // ConfigureHeap (survived_since_last_expansion_, external_allocation_limit_) |
| 58 // Will be 4 * reserved_semispace_size_ to ensure that young | 58 // Will be 4 * reserved_semispace_size_ to ensure that young |
| 59 // generation can be aligned to its size. | 59 // generation can be aligned to its size. |
| 60 maximum_committed_(0), | 60 maximum_committed_(0), |
| 61 old_space_growing_factor_(4), | |
| 62 survived_since_last_expansion_(0), | 61 survived_since_last_expansion_(0), |
| 63 sweep_generation_(0), | 62 sweep_generation_(0), |
| 64 always_allocate_scope_depth_(0), | 63 always_allocate_scope_depth_(0), |
| 65 linear_allocation_scope_depth_(0), | 64 linear_allocation_scope_depth_(0), |
| 66 contexts_disposed_(0), | 65 contexts_disposed_(0), |
| 67 global_ic_age_(0), | 66 global_ic_age_(0), |
| 68 flush_monomorphic_ics_(false), | 67 flush_monomorphic_ics_(false), |
| 69 scan_on_scavenge_pages_(0), | 68 scan_on_scavenge_pages_(0), |
| 70 new_space_(this), | 69 new_space_(this), |
| 71 old_pointer_space_(NULL), | 70 old_pointer_space_(NULL), |
| (...skipping 4926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4998 max_old_generation_size_); | 4997 max_old_generation_size_); |
| 4999 | 4998 |
| 5000 // We rely on being able to allocate new arrays in paged spaces. | 4999 // We rely on being able to allocate new arrays in paged spaces. |
| 5001 ASSERT(Page::kMaxRegularHeapObjectSize >= | 5000 ASSERT(Page::kMaxRegularHeapObjectSize >= |
| 5002 (JSArray::kSize + | 5001 (JSArray::kSize + |
| 5003 FixedArray::SizeFor(JSObject::kInitialMaxFastElementArray) + | 5002 FixedArray::SizeFor(JSObject::kInitialMaxFastElementArray) + |
| 5004 AllocationMemento::kSize)); | 5003 AllocationMemento::kSize)); |
| 5005 | 5004 |
| 5006 code_range_size_ = code_range_size * MB; | 5005 code_range_size_ = code_range_size * MB; |
| 5007 | 5006 |
| 5008 // We set the old generation growing factor to 2 to grow the heap slower on | |
| 5009 // memory-constrained devices. | |
| 5010 if (max_old_generation_size_ <= kMaxOldSpaceSizeMediumMemoryDevice) { | |
| 5011 old_space_growing_factor_ = 2; | |
| 5012 } | |
| 5013 | |
| 5014 configured_ = true; | 5007 configured_ = true; |
| 5015 return true; | 5008 return true; |
| 5016 } | 5009 } |
| 5017 | 5010 |
| 5018 | 5011 |
| 5019 bool Heap::ConfigureHeapDefault() { | 5012 bool Heap::ConfigureHeapDefault() { |
| 5020 return ConfigureHeap(0, 0, 0, 0); | 5013 return ConfigureHeap(0, 0, 0, 0); |
| 5021 } | 5014 } |
| 5022 | 5015 |
| 5023 | 5016 |
| (...skipping 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6421 static_cast<int>(object_sizes_last_time_[index])); | 6414 static_cast<int>(object_sizes_last_time_[index])); |
| 6422 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6415 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
| 6423 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6416 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
| 6424 | 6417 |
| 6425 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6418 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
| 6426 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6419 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
| 6427 ClearObjectStats(); | 6420 ClearObjectStats(); |
| 6428 } | 6421 } |
| 6429 | 6422 |
| 6430 } } // namespace v8::internal | 6423 } } // namespace v8::internal |
| OLD | NEW |