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 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1072 // does not fall behind the rate of promotion, which would cause a | 1072 // does not fall behind the rate of promotion, which would cause a |
1073 // constantly growing old space. | 1073 // constantly growing old space. |
1074 incremental_marking()->NotifyOfHighPromotionRate(); | 1074 incremental_marking()->NotifyOfHighPromotionRate(); |
1075 } | 1075 } |
1076 | 1076 |
1077 if (collector == MARK_COMPACTOR) { | 1077 if (collector == MARK_COMPACTOR) { |
1078 // Perform mark-sweep with optional compaction. | 1078 // Perform mark-sweep with optional compaction. |
1079 MarkCompact(tracer); | 1079 MarkCompact(tracer); |
1080 sweep_generation_++; | 1080 sweep_generation_++; |
1081 | 1081 |
1082 UpdateSurvivalRateTrend(start_new_space_size); | |
1083 | |
1084 size_of_old_gen_at_last_old_space_gc_ = PromotedSpaceSizeOfObjects(); | 1082 size_of_old_gen_at_last_old_space_gc_ = PromotedSpaceSizeOfObjects(); |
1085 | 1083 |
1086 old_generation_allocation_limit_ = | 1084 old_generation_allocation_limit_ = |
1087 OldGenerationAllocationLimit(size_of_old_gen_at_last_old_space_gc_); | 1085 OldGenerationAllocationLimit(size_of_old_gen_at_last_old_space_gc_); |
1088 | 1086 |
1089 old_gen_exhausted_ = false; | 1087 old_gen_exhausted_ = false; |
1090 } else { | 1088 } else { |
1091 tracer_ = tracer; | 1089 tracer_ = tracer; |
1092 Scavenge(); | 1090 Scavenge(); |
1093 tracer_ = NULL; | 1091 tracer_ = NULL; |
| 1092 } |
1094 | 1093 |
1095 UpdateSurvivalRateTrend(start_new_space_size); | 1094 UpdateSurvivalRateTrend(start_new_space_size); |
1096 } | |
1097 | 1095 |
1098 if (!new_space_high_promotion_mode_active_ && | 1096 if (!new_space_high_promotion_mode_active_ && |
1099 new_space_.Capacity() == new_space_.MaximumCapacity() && | 1097 new_space_.Capacity() == new_space_.MaximumCapacity() && |
1100 IsStableOrIncreasingSurvivalTrend() && | 1098 IsStableOrIncreasingSurvivalTrend() && |
1101 IsHighSurvivalRate()) { | 1099 IsHighSurvivalRate()) { |
1102 // Stable high survival rates even though young generation is at | 1100 // Stable high survival rates even though young generation is at |
1103 // maximum capacity indicates that most objects will be promoted. | 1101 // maximum capacity indicates that most objects will be promoted. |
1104 // To decrease scavenger pauses and final mark-sweep pauses, we | 1102 // To decrease scavenger pauses and final mark-sweep pauses, we |
1105 // have to limit maximal capacity of the young generation. | 1103 // have to limit maximal capacity of the young generation. |
1106 SetNewSpaceHighPromotionModeActive(true); | 1104 SetNewSpaceHighPromotionModeActive(true); |
(...skipping 5065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6172 PrintF("total_size_after=%" V8_PTR_PREFIX "d ", heap_->SizeOfObjects()); | 6170 PrintF("total_size_after=%" V8_PTR_PREFIX "d ", heap_->SizeOfObjects()); |
6173 PrintF("holes_size_before=%" V8_PTR_PREFIX "d ", | 6171 PrintF("holes_size_before=%" V8_PTR_PREFIX "d ", |
6174 in_free_list_or_wasted_before_gc_); | 6172 in_free_list_or_wasted_before_gc_); |
6175 PrintF("holes_size_after=%" V8_PTR_PREFIX "d ", CountTotalHolesSize(heap_)); | 6173 PrintF("holes_size_after=%" V8_PTR_PREFIX "d ", CountTotalHolesSize(heap_)); |
6176 | 6174 |
6177 PrintF("allocated=%" V8_PTR_PREFIX "d ", allocated_since_last_gc_); | 6175 PrintF("allocated=%" V8_PTR_PREFIX "d ", allocated_since_last_gc_); |
6178 PrintF("promoted=%" V8_PTR_PREFIX "d ", promoted_objects_size_); | 6176 PrintF("promoted=%" V8_PTR_PREFIX "d ", promoted_objects_size_); |
6179 PrintF("nodes_died_in_new=%d ", nodes_died_in_new_space_); | 6177 PrintF("nodes_died_in_new=%d ", nodes_died_in_new_space_); |
6180 PrintF("nodes_copied_in_new=%d ", nodes_copied_in_new_space_); | 6178 PrintF("nodes_copied_in_new=%d ", nodes_copied_in_new_space_); |
6181 PrintF("nodes_promoted=%d ", nodes_promoted_); | 6179 PrintF("nodes_promoted=%d ", nodes_promoted_); |
| 6180 PrintF("survived=%.1f%% ", heap_->survival_rate_); |
6182 | 6181 |
6183 if (collector_ == SCAVENGER) { | 6182 if (collector_ == SCAVENGER) { |
6184 PrintF("stepscount=%d ", steps_count_since_last_gc_); | 6183 PrintF("stepscount=%d ", steps_count_since_last_gc_); |
6185 PrintF("stepstook=%.1f ", steps_took_since_last_gc_); | 6184 PrintF("stepstook=%.1f ", steps_took_since_last_gc_); |
6186 } else { | 6185 } else { |
6187 PrintF("stepscount=%d ", steps_count_); | 6186 PrintF("stepscount=%d ", steps_count_); |
6188 PrintF("stepstook=%.1f ", steps_took_); | 6187 PrintF("stepstook=%.1f ", steps_took_); |
6189 PrintF("longeststep=%.1f ", longest_step_); | 6188 PrintF("longeststep=%.1f ", longest_step_); |
6190 } | 6189 } |
6191 | 6190 |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6465 static_cast<int>(object_sizes_last_time_[index])); | 6464 static_cast<int>(object_sizes_last_time_[index])); |
6466 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6465 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6467 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6466 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6468 | 6467 |
6469 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6468 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6470 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6469 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6471 ClearObjectStats(); | 6470 ClearObjectStats(); |
6472 } | 6471 } |
6473 | 6472 |
6474 } } // namespace v8::internal | 6473 } } // namespace v8::internal |
OLD | NEW |