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/heap/heap.h" | 5 #include "src/heap/heap.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/ast/context-slot-cache.h" | 9 #include "src/ast/context-slot-cache.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 : external_memory_(0), | 74 : external_memory_(0), |
75 external_memory_limit_(kExternalAllocationSoftLimit), | 75 external_memory_limit_(kExternalAllocationSoftLimit), |
76 external_memory_at_last_mark_compact_(0), | 76 external_memory_at_last_mark_compact_(0), |
77 isolate_(nullptr), | 77 isolate_(nullptr), |
78 code_range_size_(0), | 78 code_range_size_(0), |
79 // semispace_size_ should be a power of 2 and old_generation_size_ should | 79 // semispace_size_ should be a power of 2 and old_generation_size_ should |
80 // be a multiple of Page::kPageSize. | 80 // be a multiple of Page::kPageSize. |
81 max_semi_space_size_(8 * (kPointerSize / 4) * MB), | 81 max_semi_space_size_(8 * (kPointerSize / 4) * MB), |
82 initial_semispace_size_(MB), | 82 initial_semispace_size_(MB), |
83 max_old_generation_size_(700ul * (kPointerSize / 4) * MB), | 83 max_old_generation_size_(700ul * (kPointerSize / 4) * MB), |
| 84 initial_max_old_generation_size_(max_old_generation_size_), |
84 initial_old_generation_size_(max_old_generation_size_ / | 85 initial_old_generation_size_(max_old_generation_size_ / |
85 kInitalOldGenerationLimitFactor), | 86 kInitalOldGenerationLimitFactor), |
86 old_generation_size_configured_(false), | 87 old_generation_size_configured_(false), |
87 max_executable_size_(256ul * (kPointerSize / 4) * MB), | 88 max_executable_size_(256ul * (kPointerSize / 4) * MB), |
88 // Variables set based on semispace_size_ and old_generation_size_ in | 89 // Variables set based on semispace_size_ and old_generation_size_ in |
89 // ConfigureHeap. | 90 // ConfigureHeap. |
90 // Will be 4 * reserved_semispace_size_ to ensure that young | 91 // Will be 4 * reserved_semispace_size_ to ensure that young |
91 // generation can be aligned to its size. | 92 // generation can be aligned to its size. |
92 maximum_committed_(0), | 93 maximum_committed_(0), |
93 survived_since_last_expansion_(0), | 94 survived_since_last_expansion_(0), |
(...skipping 4954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5048 } | 5049 } |
5049 | 5050 |
5050 initial_semispace_size_ = Min(initial_semispace_size_, max_semi_space_size_); | 5051 initial_semispace_size_ = Min(initial_semispace_size_, max_semi_space_size_); |
5051 | 5052 |
5052 if (FLAG_semi_space_growth_factor < 2) { | 5053 if (FLAG_semi_space_growth_factor < 2) { |
5053 FLAG_semi_space_growth_factor = 2; | 5054 FLAG_semi_space_growth_factor = 2; |
5054 } | 5055 } |
5055 | 5056 |
5056 // The old generation is paged and needs at least one page for each space. | 5057 // The old generation is paged and needs at least one page for each space. |
5057 int paged_space_count = LAST_PAGED_SPACE - FIRST_PAGED_SPACE + 1; | 5058 int paged_space_count = LAST_PAGED_SPACE - FIRST_PAGED_SPACE + 1; |
5058 max_old_generation_size_ = | 5059 initial_max_old_generation_size_ = max_old_generation_size_ = |
5059 Max(static_cast<size_t>(paged_space_count * Page::kPageSize), | 5060 Max(static_cast<size_t>(paged_space_count * Page::kPageSize), |
5060 max_old_generation_size_); | 5061 max_old_generation_size_); |
5061 | 5062 |
5062 // The max executable size must be less than or equal to the max old | 5063 // The max executable size must be less than or equal to the max old |
5063 // generation size. | 5064 // generation size. |
5064 if (max_executable_size_ > max_old_generation_size_) { | 5065 if (max_executable_size_ > max_old_generation_size_) { |
5065 max_executable_size_ = max_old_generation_size_; | 5066 max_executable_size_ = max_old_generation_size_; |
5066 } | 5067 } |
5067 | 5068 |
5068 if (FLAG_initial_old_space_size > 0) { | 5069 if (FLAG_initial_old_space_size > 0) { |
(...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6499 } | 6500 } |
6500 | 6501 |
6501 | 6502 |
6502 // static | 6503 // static |
6503 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6504 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6504 return StaticVisitorBase::GetVisitorId(map); | 6505 return StaticVisitorBase::GetVisitorId(map); |
6505 } | 6506 } |
6506 | 6507 |
6507 } // namespace internal | 6508 } // namespace internal |
6508 } // namespace v8 | 6509 } // namespace v8 |
OLD | NEW |