| 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/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 kInitalOldGenerationLimitFactor), | 64 kInitalOldGenerationLimitFactor), |
| 65 old_generation_size_configured_(false), | 65 old_generation_size_configured_(false), |
| 66 max_executable_size_(256ul * (kPointerSize / 4) * MB), | 66 max_executable_size_(256ul * (kPointerSize / 4) * MB), |
| 67 // Variables set based on semispace_size_ and old_generation_size_ in | 67 // Variables set based on semispace_size_ and old_generation_size_ in |
| 68 // ConfigureHeap. | 68 // ConfigureHeap. |
| 69 // Will be 4 * reserved_semispace_size_ to ensure that young | 69 // Will be 4 * reserved_semispace_size_ to ensure that young |
| 70 // generation can be aligned to its size. | 70 // generation can be aligned to its size. |
| 71 maximum_committed_(0), | 71 maximum_committed_(0), |
| 72 survived_since_last_expansion_(0), | 72 survived_since_last_expansion_(0), |
| 73 survived_last_scavenge_(0), | 73 survived_last_scavenge_(0), |
| 74 sweep_generation_(0), | |
| 75 always_allocate_scope_depth_(0), | 74 always_allocate_scope_depth_(0), |
| 76 contexts_disposed_(0), | 75 contexts_disposed_(0), |
| 77 global_ic_age_(0), | 76 global_ic_age_(0), |
| 78 scan_on_scavenge_pages_(0), | 77 scan_on_scavenge_pages_(0), |
| 79 new_space_(this), | 78 new_space_(this), |
| 80 old_space_(NULL), | 79 old_space_(NULL), |
| 81 code_space_(NULL), | 80 code_space_(NULL), |
| 82 map_space_(NULL), | 81 map_space_(NULL), |
| 83 lo_space_(NULL), | 82 lo_space_(NULL), |
| 84 gc_state_(NOT_IN_GC), | 83 gc_state_(NOT_IN_GC), |
| (...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1201 // We speed up the incremental marker if it is running so that it | 1200 // We speed up the incremental marker if it is running so that it |
| 1202 // does not fall behind the rate of promotion, which would cause a | 1201 // does not fall behind the rate of promotion, which would cause a |
| 1203 // constantly growing old space. | 1202 // constantly growing old space. |
| 1204 incremental_marking()->NotifyOfHighPromotionRate(); | 1203 incremental_marking()->NotifyOfHighPromotionRate(); |
| 1205 } | 1204 } |
| 1206 | 1205 |
| 1207 if (collector == MARK_COMPACTOR) { | 1206 if (collector == MARK_COMPACTOR) { |
| 1208 UpdateOldGenerationAllocationCounter(); | 1207 UpdateOldGenerationAllocationCounter(); |
| 1209 // Perform mark-sweep with optional compaction. | 1208 // Perform mark-sweep with optional compaction. |
| 1210 MarkCompact(); | 1209 MarkCompact(); |
| 1211 sweep_generation_++; | |
| 1212 old_gen_exhausted_ = false; | 1210 old_gen_exhausted_ = false; |
| 1213 old_generation_size_configured_ = true; | 1211 old_generation_size_configured_ = true; |
| 1214 // This should be updated before PostGarbageCollectionProcessing, which can | 1212 // This should be updated before PostGarbageCollectionProcessing, which can |
| 1215 // cause another GC. Take into account the objects promoted during GC. | 1213 // cause another GC. Take into account the objects promoted during GC. |
| 1216 old_generation_allocation_counter_ += | 1214 old_generation_allocation_counter_ += |
| 1217 static_cast<size_t>(promoted_objects_size_); | 1215 static_cast<size_t>(promoted_objects_size_); |
| 1218 old_generation_size_at_last_gc_ = PromotedSpaceSizeOfObjects(); | 1216 old_generation_size_at_last_gc_ = PromotedSpaceSizeOfObjects(); |
| 1219 } else { | 1217 } else { |
| 1220 Scavenge(); | 1218 Scavenge(); |
| 1221 } | 1219 } |
| (...skipping 5681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6903 *object_type = "CODE_TYPE"; \ | 6901 *object_type = "CODE_TYPE"; \ |
| 6904 *object_sub_type = "CODE_AGE/" #name; \ | 6902 *object_sub_type = "CODE_AGE/" #name; \ |
| 6905 return true; | 6903 return true; |
| 6906 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6904 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
| 6907 #undef COMPARE_AND_RETURN_NAME | 6905 #undef COMPARE_AND_RETURN_NAME |
| 6908 } | 6906 } |
| 6909 return false; | 6907 return false; |
| 6910 } | 6908 } |
| 6911 } // namespace internal | 6909 } // namespace internal |
| 6912 } // namespace v8 | 6910 } // namespace v8 |
| OLD | NEW |