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/v8.h" | 5 #include "src/v8.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/once.h" | 9 #include "src/base/once.h" |
10 #include "src/base/utils/random-number-generator.h" | 10 #include "src/base/utils/random-number-generator.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 #ifdef DEBUG | 92 #ifdef DEBUG |
93 allocation_timeout_(0), | 93 allocation_timeout_(0), |
94 #endif // DEBUG | 94 #endif // DEBUG |
95 old_generation_allocation_limit_(kMinimumOldGenerationAllocationLimit), | 95 old_generation_allocation_limit_(kMinimumOldGenerationAllocationLimit), |
96 old_gen_exhausted_(false), | 96 old_gen_exhausted_(false), |
97 inline_allocation_disabled_(false), | 97 inline_allocation_disabled_(false), |
98 store_buffer_rebuilder_(store_buffer()), | 98 store_buffer_rebuilder_(store_buffer()), |
99 hidden_string_(NULL), | 99 hidden_string_(NULL), |
100 gc_safe_size_of_old_object_(NULL), | 100 gc_safe_size_of_old_object_(NULL), |
101 total_regexp_code_generated_(0), | 101 total_regexp_code_generated_(0), |
102 tracer_(NULL), | 102 tracer_(this), |
103 high_survival_rate_period_length_(0), | 103 high_survival_rate_period_length_(0), |
104 promoted_objects_size_(0), | 104 promoted_objects_size_(0), |
105 promotion_rate_(0), | 105 promotion_rate_(0), |
106 semi_space_copied_object_size_(0), | 106 semi_space_copied_object_size_(0), |
107 semi_space_copied_rate_(0), | 107 semi_space_copied_rate_(0), |
108 nodes_died_in_new_space_(0), | 108 nodes_died_in_new_space_(0), |
109 nodes_copied_in_new_space_(0), | 109 nodes_copied_in_new_space_(0), |
110 nodes_promoted_(0), | 110 nodes_promoted_(0), |
111 maximum_size_scavenges_(0), | 111 maximum_size_scavenges_(0), |
112 max_gc_pause_(0.0), | 112 max_gc_pause_(0.0), |
113 total_gc_time_ms_(0.0), | 113 total_gc_time_ms_(0.0), |
114 max_alive_after_gc_(0), | 114 max_alive_after_gc_(0), |
115 min_in_mutator_(kMaxInt), | 115 min_in_mutator_(kMaxInt), |
116 alive_after_last_gc_(0), | 116 alive_after_last_gc_(0), |
117 last_gc_end_timestamp_(0.0), | 117 last_gc_end_timestamp_(base::OS::TimeCurrentMillis()), |
118 marking_time_(0.0), | 118 marking_time_(0.0), |
119 sweeping_time_(0.0), | 119 sweeping_time_(0.0), |
120 mark_compact_collector_(this), | 120 mark_compact_collector_(this), |
121 store_buffer_(this), | 121 store_buffer_(this), |
122 marking_(this), | 122 marking_(this), |
123 incremental_marking_(this), | 123 incremental_marking_(this), |
124 number_idle_notifications_(0), | 124 number_idle_notifications_(0), |
125 last_idle_notification_gc_count_(0), | 125 last_idle_notification_gc_count_(0), |
126 last_idle_notification_gc_count_init_(false), | 126 last_idle_notification_gc_count_init_(false), |
127 mark_sweeps_since_idle_round_started_(0), | 127 mark_sweeps_since_idle_round_started_(0), |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 if (FLAG_trace_incremental_marking) { | 833 if (FLAG_trace_incremental_marking) { |
834 PrintF("[IncrementalMarking] Delaying MarkSweep.\n"); | 834 PrintF("[IncrementalMarking] Delaying MarkSweep.\n"); |
835 } | 835 } |
836 collector = SCAVENGER; | 836 collector = SCAVENGER; |
837 collector_reason = "incremental marking delaying mark-sweep"; | 837 collector_reason = "incremental marking delaying mark-sweep"; |
838 } | 838 } |
839 } | 839 } |
840 | 840 |
841 bool next_gc_likely_to_collect_more = false; | 841 bool next_gc_likely_to_collect_more = false; |
842 | 842 |
843 { GCTracer tracer(this, collector, gc_reason, collector_reason); | 843 { tracer()->start(collector, gc_reason, collector_reason); |
844 ASSERT(AllowHeapAllocation::IsAllowed()); | 844 ASSERT(AllowHeapAllocation::IsAllowed()); |
845 DisallowHeapAllocation no_allocation_during_gc; | 845 DisallowHeapAllocation no_allocation_during_gc; |
846 GarbageCollectionPrologue(); | 846 GarbageCollectionPrologue(); |
847 | 847 |
848 { | 848 { |
849 HistogramTimerScope histogram_timer_scope( | 849 HistogramTimerScope histogram_timer_scope( |
850 (collector == SCAVENGER) ? isolate_->counters()->gc_scavenger() | 850 (collector == SCAVENGER) ? isolate_->counters()->gc_scavenger() |
851 : isolate_->counters()->gc_compactor()); | 851 : isolate_->counters()->gc_compactor()); |
852 next_gc_likely_to_collect_more = | 852 next_gc_likely_to_collect_more = |
853 PerformGarbageCollection(collector, &tracer, gc_callback_flags); | 853 PerformGarbageCollection(collector, gc_callback_flags); |
854 } | 854 } |
855 | 855 |
856 GarbageCollectionEpilogue(); | 856 GarbageCollectionEpilogue(); |
| 857 tracer()->stop(); |
857 } | 858 } |
858 | 859 |
859 // Start incremental marking for the next cycle. The heap snapshot | 860 // Start incremental marking for the next cycle. The heap snapshot |
860 // generator needs incremental marking to stay off after it aborted. | 861 // generator needs incremental marking to stay off after it aborted. |
861 if (!mark_compact_collector()->abort_incremental_marking() && | 862 if (!mark_compact_collector()->abort_incremental_marking() && |
862 incremental_marking()->IsStopped() && | 863 incremental_marking()->IsStopped() && |
863 incremental_marking()->WorthActivating() && | 864 incremental_marking()->WorthActivating() && |
864 NextGCIsLikelyToBeFull()) { | 865 NextGCIsLikelyToBeFull()) { |
865 incremental_marking()->Start(); | 866 incremental_marking()->Start(); |
866 } | 867 } |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 | 1049 |
1049 if (survival_rate > kYoungSurvivalRateHighThreshold) { | 1050 if (survival_rate > kYoungSurvivalRateHighThreshold) { |
1050 high_survival_rate_period_length_++; | 1051 high_survival_rate_period_length_++; |
1051 } else { | 1052 } else { |
1052 high_survival_rate_period_length_ = 0; | 1053 high_survival_rate_period_length_ = 0; |
1053 } | 1054 } |
1054 } | 1055 } |
1055 | 1056 |
1056 bool Heap::PerformGarbageCollection( | 1057 bool Heap::PerformGarbageCollection( |
1057 GarbageCollector collector, | 1058 GarbageCollector collector, |
1058 GCTracer* tracer, | |
1059 const v8::GCCallbackFlags gc_callback_flags) { | 1059 const v8::GCCallbackFlags gc_callback_flags) { |
1060 int freed_global_handles = 0; | 1060 int freed_global_handles = 0; |
1061 | 1061 |
1062 if (collector != SCAVENGER) { | 1062 if (collector != SCAVENGER) { |
1063 PROFILE(isolate_, CodeMovingGCEvent()); | 1063 PROFILE(isolate_, CodeMovingGCEvent()); |
1064 } | 1064 } |
1065 | 1065 |
1066 #ifdef VERIFY_HEAP | 1066 #ifdef VERIFY_HEAP |
1067 if (FLAG_verify_heap) { | 1067 if (FLAG_verify_heap) { |
1068 VerifyStringTable(this); | 1068 VerifyStringTable(this); |
1069 } | 1069 } |
1070 #endif | 1070 #endif |
1071 | 1071 |
1072 GCType gc_type = | 1072 GCType gc_type = |
1073 collector == MARK_COMPACTOR ? kGCTypeMarkSweepCompact : kGCTypeScavenge; | 1073 collector == MARK_COMPACTOR ? kGCTypeMarkSweepCompact : kGCTypeScavenge; |
1074 | 1074 |
1075 { GCCallbacksScope scope(this); | 1075 { GCCallbacksScope scope(this); |
1076 if (scope.CheckReenter()) { | 1076 if (scope.CheckReenter()) { |
1077 AllowHeapAllocation allow_allocation; | 1077 AllowHeapAllocation allow_allocation; |
1078 GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL); | 1078 GCTracer::Scope scope(tracer(), GCTracer::Scope::EXTERNAL); |
1079 VMState<EXTERNAL> state(isolate_); | 1079 VMState<EXTERNAL> state(isolate_); |
1080 HandleScope handle_scope(isolate_); | 1080 HandleScope handle_scope(isolate_); |
1081 CallGCPrologueCallbacks(gc_type, kNoGCCallbackFlags); | 1081 CallGCPrologueCallbacks(gc_type, kNoGCCallbackFlags); |
1082 } | 1082 } |
1083 } | 1083 } |
1084 | 1084 |
1085 EnsureFromSpaceIsCommitted(); | 1085 EnsureFromSpaceIsCommitted(); |
1086 | 1086 |
1087 int start_new_space_size = Heap::new_space()->SizeAsInt(); | 1087 int start_new_space_size = Heap::new_space()->SizeAsInt(); |
1088 | 1088 |
1089 if (IsHighSurvivalRate()) { | 1089 if (IsHighSurvivalRate()) { |
1090 // We speed up the incremental marker if it is running so that it | 1090 // We speed up the incremental marker if it is running so that it |
1091 // does not fall behind the rate of promotion, which would cause a | 1091 // does not fall behind the rate of promotion, which would cause a |
1092 // constantly growing old space. | 1092 // constantly growing old space. |
1093 incremental_marking()->NotifyOfHighPromotionRate(); | 1093 incremental_marking()->NotifyOfHighPromotionRate(); |
1094 } | 1094 } |
1095 | 1095 |
1096 if (collector == MARK_COMPACTOR) { | 1096 if (collector == MARK_COMPACTOR) { |
1097 // Perform mark-sweep with optional compaction. | 1097 // Perform mark-sweep with optional compaction. |
1098 MarkCompact(tracer); | 1098 MarkCompact(); |
1099 sweep_generation_++; | 1099 sweep_generation_++; |
1100 // Temporarily set the limit for case when PostGarbageCollectionProcessing | 1100 // Temporarily set the limit for case when PostGarbageCollectionProcessing |
1101 // allocates and triggers GC. The real limit is set at after | 1101 // allocates and triggers GC. The real limit is set at after |
1102 // PostGarbageCollectionProcessing. | 1102 // PostGarbageCollectionProcessing. |
1103 old_generation_allocation_limit_ = | 1103 old_generation_allocation_limit_ = |
1104 OldGenerationAllocationLimit(PromotedSpaceSizeOfObjects(), 0); | 1104 OldGenerationAllocationLimit(PromotedSpaceSizeOfObjects(), 0); |
1105 old_gen_exhausted_ = false; | 1105 old_gen_exhausted_ = false; |
1106 } else { | 1106 } else { |
1107 tracer_ = tracer; | |
1108 Scavenge(); | 1107 Scavenge(); |
1109 tracer_ = NULL; | |
1110 } | 1108 } |
1111 | 1109 |
1112 UpdateSurvivalStatistics(start_new_space_size); | 1110 UpdateSurvivalStatistics(start_new_space_size); |
1113 | 1111 |
1114 isolate_->counters()->objs_since_last_young()->Set(0); | 1112 isolate_->counters()->objs_since_last_young()->Set(0); |
1115 | 1113 |
1116 // Callbacks that fire after this point might trigger nested GCs and | 1114 // Callbacks that fire after this point might trigger nested GCs and |
1117 // restart incremental marking, the assertion can't be moved down. | 1115 // restart incremental marking, the assertion can't be moved down. |
1118 ASSERT(collector == SCAVENGER || incremental_marking()->IsStopped()); | 1116 ASSERT(collector == SCAVENGER || incremental_marking()->IsStopped()); |
1119 | 1117 |
1120 gc_post_processing_depth_++; | 1118 gc_post_processing_depth_++; |
1121 { AllowHeapAllocation allow_allocation; | 1119 { AllowHeapAllocation allow_allocation; |
1122 GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL); | 1120 GCTracer::Scope scope(tracer(), GCTracer::Scope::EXTERNAL); |
1123 freed_global_handles = | 1121 freed_global_handles = |
1124 isolate_->global_handles()->PostGarbageCollectionProcessing(collector); | 1122 isolate_->global_handles()->PostGarbageCollectionProcessing(collector); |
1125 } | 1123 } |
1126 gc_post_processing_depth_--; | 1124 gc_post_processing_depth_--; |
1127 | 1125 |
1128 isolate_->eternal_handles()->PostGarbageCollectionProcessing(this); | 1126 isolate_->eternal_handles()->PostGarbageCollectionProcessing(this); |
1129 | 1127 |
1130 // Update relocatables. | 1128 // Update relocatables. |
1131 Relocatable::PostGarbageCollectionProcessing(isolate_); | 1129 Relocatable::PostGarbageCollectionProcessing(isolate_); |
1132 | 1130 |
1133 if (collector == MARK_COMPACTOR) { | 1131 if (collector == MARK_COMPACTOR) { |
1134 // Register the amount of external allocated memory. | 1132 // Register the amount of external allocated memory. |
1135 amount_of_external_allocated_memory_at_last_global_gc_ = | 1133 amount_of_external_allocated_memory_at_last_global_gc_ = |
1136 amount_of_external_allocated_memory_; | 1134 amount_of_external_allocated_memory_; |
1137 old_generation_allocation_limit_ = | 1135 old_generation_allocation_limit_ = |
1138 OldGenerationAllocationLimit(PromotedSpaceSizeOfObjects(), | 1136 OldGenerationAllocationLimit(PromotedSpaceSizeOfObjects(), |
1139 freed_global_handles); | 1137 freed_global_handles); |
1140 } | 1138 } |
1141 | 1139 |
1142 { GCCallbacksScope scope(this); | 1140 { GCCallbacksScope scope(this); |
1143 if (scope.CheckReenter()) { | 1141 if (scope.CheckReenter()) { |
1144 AllowHeapAllocation allow_allocation; | 1142 AllowHeapAllocation allow_allocation; |
1145 GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL); | 1143 GCTracer::Scope scope(tracer(), GCTracer::Scope::EXTERNAL); |
1146 VMState<EXTERNAL> state(isolate_); | 1144 VMState<EXTERNAL> state(isolate_); |
1147 HandleScope handle_scope(isolate_); | 1145 HandleScope handle_scope(isolate_); |
1148 CallGCEpilogueCallbacks(gc_type, gc_callback_flags); | 1146 CallGCEpilogueCallbacks(gc_type, gc_callback_flags); |
1149 } | 1147 } |
1150 } | 1148 } |
1151 | 1149 |
1152 #ifdef VERIFY_HEAP | 1150 #ifdef VERIFY_HEAP |
1153 if (FLAG_verify_heap) { | 1151 if (FLAG_verify_heap) { |
1154 VerifyStringTable(this); | 1152 VerifyStringTable(this); |
1155 } | 1153 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1188 } else { | 1186 } else { |
1189 v8::Isolate* isolate = reinterpret_cast<v8::Isolate*>(this->isolate()); | 1187 v8::Isolate* isolate = reinterpret_cast<v8::Isolate*>(this->isolate()); |
1190 gc_epilogue_callbacks_[i].callback( | 1188 gc_epilogue_callbacks_[i].callback( |
1191 isolate, gc_type, gc_callback_flags); | 1189 isolate, gc_type, gc_callback_flags); |
1192 } | 1190 } |
1193 } | 1191 } |
1194 } | 1192 } |
1195 } | 1193 } |
1196 | 1194 |
1197 | 1195 |
1198 void Heap::MarkCompact(GCTracer* tracer) { | 1196 void Heap::MarkCompact() { |
1199 gc_state_ = MARK_COMPACT; | 1197 gc_state_ = MARK_COMPACT; |
1200 LOG(isolate_, ResourceEvent("markcompact", "begin")); | 1198 LOG(isolate_, ResourceEvent("markcompact", "begin")); |
1201 | 1199 |
1202 uint64_t size_of_objects_before_gc = SizeOfObjects(); | 1200 uint64_t size_of_objects_before_gc = SizeOfObjects(); |
1203 | 1201 |
1204 mark_compact_collector_.Prepare(tracer); | 1202 mark_compact_collector_.Prepare(); |
1205 | 1203 |
1206 ms_count_++; | 1204 ms_count_++; |
1207 | 1205 |
1208 MarkCompactPrologue(); | 1206 MarkCompactPrologue(); |
1209 | 1207 |
1210 mark_compact_collector_.CollectGarbage(); | 1208 mark_compact_collector_.CollectGarbage(); |
1211 | 1209 |
1212 LOG(isolate_, ResourceEvent("markcompact", "end")); | 1210 LOG(isolate_, ResourceEvent("markcompact", "end")); |
1213 | 1211 |
1214 gc_state_ = NOT_IN_GC; | 1212 gc_state_ = NOT_IN_GC; |
(...skipping 4738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5953 return holes_size; | 5951 return holes_size; |
5954 } | 5952 } |
5955 | 5953 |
5956 | 5954 |
5957 void Heap::UpdateGCStatistics(double start_time, | 5955 void Heap::UpdateGCStatistics(double start_time, |
5958 double end_time, | 5956 double end_time, |
5959 double spent_in_mutator, | 5957 double spent_in_mutator, |
5960 double marking_time) { | 5958 double marking_time) { |
5961 double duration = end_time - start_time; | 5959 double duration = end_time - start_time; |
5962 alive_after_last_gc_ = SizeOfObjects(); | 5960 alive_after_last_gc_ = SizeOfObjects(); |
5963 bool first_gc = (last_gc_end_timestamp_ == 0); | |
5964 last_gc_end_timestamp_ = end_time; | 5961 last_gc_end_timestamp_ = end_time; |
5965 | 5962 |
5966 if (FLAG_print_cumulative_gc_stat) { | 5963 if (FLAG_print_cumulative_gc_stat) { |
5967 total_gc_time_ms_ += duration; | 5964 total_gc_time_ms_ += duration; |
5968 max_gc_pause_ = Max(max_gc_pause_, duration); | 5965 max_gc_pause_ = Max(max_gc_pause_, duration); |
5969 max_alive_after_gc_ = Max(max_alive_after_gc_, alive_after_last_gc_); | 5966 max_alive_after_gc_ = Max(max_alive_after_gc_, alive_after_last_gc_); |
5970 if (!first_gc) | 5967 min_in_mutator_ = Min(min_in_mutator_, spent_in_mutator); |
5971 min_in_mutator_ = Min(min_in_mutator_, spent_in_mutator); | |
5972 } else if (FLAG_trace_gc_verbose) { | 5968 } else if (FLAG_trace_gc_verbose) { |
5973 total_gc_time_ms_ += duration; | 5969 total_gc_time_ms_ += duration; |
5974 } | 5970 } |
5975 | 5971 |
5976 marking_time_ += marking_time; | 5972 marking_time_ += marking_time; |
5977 } | 5973 } |
5978 | 5974 |
5979 | 5975 |
5980 GCTracer::GCTracer(Heap* heap, | 5976 GCTracer::GCTracer(Heap* heap) |
5981 GarbageCollector collector, | |
5982 const char* gc_reason, | |
5983 const char* collector_reason) | |
5984 : start_time_(0.0), | 5977 : start_time_(0.0), |
5985 end_time_(0.0), | 5978 end_time_(0.0), |
5986 start_object_size_(0), | 5979 start_object_size_(0), |
5987 end_object_size_(0), | 5980 end_object_size_(0), |
5988 start_memory_size_(0), | 5981 start_memory_size_(0), |
5989 end_memory_size_(0), | 5982 end_memory_size_(0), |
5990 collector_(collector), | 5983 in_free_list_or_wasted_before_gc_(0), |
5991 allocated_since_last_gc_(0), | 5984 allocated_since_last_gc_(0), |
5992 spent_in_mutator_(0), | 5985 spent_in_mutator_(0), |
| 5986 steps_count_(0), |
| 5987 steps_took_(0.0), |
| 5988 longest_step_(0.0), |
| 5989 steps_count_since_last_gc_(0), |
| 5990 steps_took_since_last_gc_(0.0), |
5993 heap_(heap), | 5991 heap_(heap), |
5994 gc_reason_(gc_reason), | 5992 gc_reason_(NULL), |
5995 collector_reason_(collector_reason) { | 5993 collector_reason_(NULL) { |
| 5994 for (int i = 0; i < Scope::NUMBER_OF_SCOPES; i++) { |
| 5995 scopes_[i] = 0; |
| 5996 } |
| 5997 } |
| 5998 |
| 5999 |
| 6000 void GCTracer::start(GarbageCollector collector, |
| 6001 const char* gc_reason, |
| 6002 const char* collector_reason) { |
5996 if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return; | 6003 if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return; |
5997 | 6004 |
| 6005 collector_ = collector; |
| 6006 gc_reason_ = gc_reason; |
| 6007 collector_reason_ = collector_reason; |
| 6008 |
5998 start_time_ = base::OS::TimeCurrentMillis(); | 6009 start_time_ = base::OS::TimeCurrentMillis(); |
5999 start_object_size_ = heap_->SizeOfObjects(); | 6010 start_object_size_ = heap_->SizeOfObjects(); |
6000 start_memory_size_ = heap_->isolate()->memory_allocator()->Size(); | 6011 start_memory_size_ = heap_->isolate()->memory_allocator()->Size(); |
6001 | 6012 |
6002 for (int i = 0; i < Scope::NUMBER_OF_SCOPES; i++) { | 6013 for (int i = 0; i < Scope::NUMBER_OF_SCOPES; i++) { |
6003 scopes_[i] = 0; | 6014 scopes_[i] = 0; |
6004 } | 6015 } |
6005 | 6016 |
6006 in_free_list_or_wasted_before_gc_ = CountTotalHolesSize(heap); | 6017 in_free_list_or_wasted_before_gc_ = CountTotalHolesSize(heap_); |
6007 | 6018 |
6008 allocated_since_last_gc_ = | 6019 allocated_since_last_gc_ = |
6009 heap_->SizeOfObjects() - heap_->alive_after_last_gc_; | 6020 heap_->SizeOfObjects() - heap_->alive_after_last_gc_; |
6010 | 6021 |
6011 if (heap_->last_gc_end_timestamp_ > 0) { | 6022 spent_in_mutator_ = Max(start_time_ - heap_->last_gc_end_timestamp_, 0.0); |
6012 spent_in_mutator_ = Max(start_time_ - heap_->last_gc_end_timestamp_, 0.0); | |
6013 } | |
6014 | 6023 |
6015 steps_count_ = heap_->incremental_marking()->steps_count(); | 6024 steps_count_ = heap_->incremental_marking()->steps_count(); |
6016 steps_took_ = heap_->incremental_marking()->steps_took(); | 6025 steps_took_ = heap_->incremental_marking()->steps_took(); |
6017 longest_step_ = heap_->incremental_marking()->longest_step(); | 6026 longest_step_ = heap_->incremental_marking()->longest_step(); |
6018 steps_count_since_last_gc_ = | 6027 steps_count_since_last_gc_ = |
6019 heap_->incremental_marking()->steps_count_since_last_gc(); | 6028 heap_->incremental_marking()->steps_count_since_last_gc(); |
6020 steps_took_since_last_gc_ = | 6029 steps_took_since_last_gc_ = |
6021 heap_->incremental_marking()->steps_took_since_last_gc(); | 6030 heap_->incremental_marking()->steps_took_since_last_gc(); |
6022 } | 6031 } |
6023 | 6032 |
6024 | 6033 |
6025 GCTracer::~GCTracer() { | 6034 void GCTracer::stop() { |
6026 if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return; | 6035 if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return; |
6027 | 6036 |
6028 end_time_ = base::OS::TimeCurrentMillis(); | 6037 end_time_ = base::OS::TimeCurrentMillis(); |
6029 end_object_size_ = heap_->SizeOfObjects(); | 6038 end_object_size_ = heap_->SizeOfObjects(); |
6030 end_memory_size_ = heap_->isolate()->memory_allocator()->Size(); | 6039 end_memory_size_ = heap_->isolate()->memory_allocator()->Size(); |
6031 | 6040 |
6032 heap_->UpdateGCStatistics(start_time_, | 6041 heap_->UpdateGCStatistics(start_time_, |
6033 end_time_, | 6042 end_time_, |
6034 spent_in_mutator_, | 6043 spent_in_mutator_, |
6035 scopes_[Scope::MC_MARK]); | 6044 scopes_[Scope::MC_MARK]); |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6426 static_cast<int>(object_sizes_last_time_[index])); | 6435 static_cast<int>(object_sizes_last_time_[index])); |
6427 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6436 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6428 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6437 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6429 | 6438 |
6430 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6439 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6431 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6440 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6432 ClearObjectStats(); | 6441 ClearObjectStats(); |
6433 } | 6442 } |
6434 | 6443 |
6435 } } // namespace v8::internal | 6444 } } // namespace v8::internal |
OLD | NEW |