blob: 4bae0a4495dd0d77f9f733490e367074addb8a83 [file] [log] [blame]
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001// Copyright 2014 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Ben Murdochb8a8cc12014-11-26 15:28:44 +00005#include "src/heap/gc-tracer.h"
6
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00007#include "src/counters.h"
8#include "src/heap/heap-inl.h"
9#include "src/isolate.h"
10
Ben Murdochb8a8cc12014-11-26 15:28:44 +000011namespace v8 {
12namespace internal {
13
14static intptr_t CountTotalHolesSize(Heap* heap) {
15 intptr_t holes_size = 0;
16 OldSpaces spaces(heap);
17 for (OldSpace* space = spaces.next(); space != NULL; space = spaces.next()) {
18 holes_size += space->Waste() + space->Available();
19 }
20 return holes_size;
21}
22
23
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000024GCTracer::Scope::Scope(GCTracer* tracer, ScopeId scope)
25 : tracer_(tracer), scope_(scope) {
26 start_time_ = tracer_->heap_->MonotonicallyIncreasingTimeInMs();
Ben Murdochda12d292016-06-02 14:46:10 +010027 // TODO(cbruni): remove once we fully moved to a trace-based system.
28 if (FLAG_runtime_call_stats) {
Ben Murdochc5610432016-08-08 18:44:38 +010029 RuntimeCallStats::Enter(tracer_->heap_->isolate(), &timer_,
30 &RuntimeCallStats::GC);
Ben Murdochda12d292016-06-02 14:46:10 +010031 }
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000032}
33
34
35GCTracer::Scope::~Scope() {
36 DCHECK(scope_ < NUMBER_OF_SCOPES); // scope_ is unsigned.
37 tracer_->current_.scopes[scope_] +=
38 tracer_->heap_->MonotonicallyIncreasingTimeInMs() - start_time_;
Ben Murdochda12d292016-06-02 14:46:10 +010039 // TODO(cbruni): remove once we fully moved to a trace-based system.
40 if (FLAG_runtime_call_stats) {
Ben Murdochc5610432016-08-08 18:44:38 +010041 RuntimeCallStats::Leave(tracer_->heap_->isolate(), &timer_);
Ben Murdochda12d292016-06-02 14:46:10 +010042 }
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000043}
44
Ben Murdochda12d292016-06-02 14:46:10 +010045const char* GCTracer::Scope::Name(ScopeId id) {
46#define CASE(scope) \
47 case Scope::scope: \
48 return "V8.GC_" #scope;
49 switch (id) {
50 TRACER_SCOPES(CASE)
51 case Scope::NUMBER_OF_SCOPES:
52 break;
53 }
54#undef CASE
55 return "(unknown)";
Ben Murdochb8a8cc12014-11-26 15:28:44 +000056}
57
Ben Murdochb8a8cc12014-11-26 15:28:44 +000058GCTracer::Event::Event(Type type, const char* gc_reason,
59 const char* collector_reason)
60 : type(type),
61 gc_reason(gc_reason),
62 collector_reason(collector_reason),
63 start_time(0.0),
64 end_time(0.0),
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000065 reduce_memory(false),
Ben Murdochb8a8cc12014-11-26 15:28:44 +000066 start_object_size(0),
67 end_object_size(0),
68 start_memory_size(0),
69 end_memory_size(0),
70 start_holes_size(0),
71 end_holes_size(0),
72 cumulative_incremental_marking_steps(0),
73 incremental_marking_steps(0),
74 cumulative_incremental_marking_bytes(0),
75 incremental_marking_bytes(0),
76 cumulative_incremental_marking_duration(0.0),
77 incremental_marking_duration(0.0),
78 cumulative_pure_incremental_marking_duration(0.0),
79 pure_incremental_marking_duration(0.0),
80 longest_incremental_marking_step(0.0) {
81 for (int i = 0; i < Scope::NUMBER_OF_SCOPES; i++) {
82 scopes[i] = 0;
83 }
84}
85
86
87const char* GCTracer::Event::TypeName(bool short_name) const {
88 switch (type) {
89 case SCAVENGER:
90 if (short_name) {
91 return "s";
92 } else {
93 return "Scavenge";
94 }
95 case MARK_COMPACTOR:
Emily Bernierd0a1eb72015-03-24 16:35:39 -040096 case INCREMENTAL_MARK_COMPACTOR:
Ben Murdochb8a8cc12014-11-26 15:28:44 +000097 if (short_name) {
98 return "ms";
99 } else {
100 return "Mark-sweep";
101 }
102 case START:
103 if (short_name) {
104 return "st";
105 } else {
106 return "Start";
107 }
108 }
109 return "Unknown Event Type";
110}
111
112
113GCTracer::GCTracer(Heap* heap)
114 : heap_(heap),
115 cumulative_incremental_marking_steps_(0),
116 cumulative_incremental_marking_bytes_(0),
117 cumulative_incremental_marking_duration_(0.0),
118 cumulative_pure_incremental_marking_duration_(0.0),
119 longest_incremental_marking_step_(0.0),
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000120 cumulative_incremental_marking_finalization_steps_(0),
121 cumulative_incremental_marking_finalization_duration_(0.0),
122 longest_incremental_marking_finalization_step_(0.0),
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000123 cumulative_marking_duration_(0.0),
124 cumulative_sweeping_duration_(0.0),
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000125 allocation_time_ms_(0.0),
126 new_space_allocation_counter_bytes_(0),
127 old_generation_allocation_counter_bytes_(0),
128 allocation_duration_since_gc_(0.0),
129 new_space_allocation_in_bytes_since_gc_(0),
130 old_generation_allocation_in_bytes_since_gc_(0),
131 combined_mark_compact_speed_cache_(0.0),
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400132 start_counter_(0) {
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000133 current_ = Event(Event::START, NULL, NULL);
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000134 current_.end_time = heap_->MonotonicallyIncreasingTimeInMs();
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400135 previous_ = previous_incremental_mark_compactor_event_ = current_;
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000136}
137
138
139void GCTracer::Start(GarbageCollector collector, const char* gc_reason,
140 const char* collector_reason) {
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400141 start_counter_++;
142 if (start_counter_ != 1) return;
143
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000144 previous_ = current_;
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000145 double start_time = heap_->MonotonicallyIncreasingTimeInMs();
146 SampleAllocation(start_time, heap_->NewSpaceAllocationCounter(),
147 heap_->OldGenerationAllocationCounter());
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400148 if (current_.type == Event::INCREMENTAL_MARK_COMPACTOR)
149 previous_incremental_mark_compactor_event_ = current_;
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000150
151 if (collector == SCAVENGER) {
152 current_ = Event(Event::SCAVENGER, gc_reason, collector_reason);
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400153 } else if (collector == MARK_COMPACTOR) {
154 if (heap_->incremental_marking()->WasActivated()) {
155 current_ =
156 Event(Event::INCREMENTAL_MARK_COMPACTOR, gc_reason, collector_reason);
157 } else {
158 current_ = Event(Event::MARK_COMPACTOR, gc_reason, collector_reason);
159 }
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000160 }
161
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000162 current_.reduce_memory = heap_->ShouldReduceMemory();
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000163 current_.start_time = start_time;
164 current_.start_object_size = heap_->SizeOfObjects();
Ben Murdochc5610432016-08-08 18:44:38 +0100165 current_.start_memory_size = heap_->memory_allocator()->Size();
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000166 current_.start_holes_size = CountTotalHolesSize(heap_);
167 current_.new_space_object_size =
168 heap_->new_space()->top() - heap_->new_space()->bottom();
169
170 current_.cumulative_incremental_marking_steps =
171 cumulative_incremental_marking_steps_;
172 current_.cumulative_incremental_marking_bytes =
173 cumulative_incremental_marking_bytes_;
174 current_.cumulative_incremental_marking_duration =
175 cumulative_incremental_marking_duration_;
176 current_.cumulative_pure_incremental_marking_duration =
177 cumulative_pure_incremental_marking_duration_;
178 current_.longest_incremental_marking_step = longest_incremental_marking_step_;
179
180 for (int i = 0; i < Scope::NUMBER_OF_SCOPES; i++) {
181 current_.scopes[i] = 0;
182 }
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000183 int committed_memory = static_cast<int>(heap_->CommittedMemory() / KB);
184 int used_memory = static_cast<int>(current_.start_object_size / KB);
185 heap_->isolate()->counters()->aggregated_memory_heap_committed()->AddSample(
186 start_time, committed_memory);
187 heap_->isolate()->counters()->aggregated_memory_heap_used()->AddSample(
188 start_time, used_memory);
Ben Murdochda12d292016-06-02 14:46:10 +0100189 // TODO(cbruni): remove once we fully moved to a trace-based system.
190 if (FLAG_runtime_call_stats) {
Ben Murdochc5610432016-08-08 18:44:38 +0100191 RuntimeCallStats::Enter(heap_->isolate(), &timer_, &RuntimeCallStats::GC);
Ben Murdochda12d292016-06-02 14:46:10 +0100192 }
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000193}
194
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400195void GCTracer::Stop(GarbageCollector collector) {
196 start_counter_--;
197 if (start_counter_ != 0) {
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000198 Output("[Finished reentrant %s during %s.]\n",
199 collector == SCAVENGER ? "Scavenge" : "Mark-sweep",
200 current_.TypeName(false));
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400201 return;
202 }
203
204 DCHECK(start_counter_ >= 0);
205 DCHECK((collector == SCAVENGER && current_.type == Event::SCAVENGER) ||
206 (collector == MARK_COMPACTOR &&
207 (current_.type == Event::MARK_COMPACTOR ||
208 current_.type == Event::INCREMENTAL_MARK_COMPACTOR)));
209
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000210 current_.end_time = heap_->MonotonicallyIncreasingTimeInMs();
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000211 current_.end_object_size = heap_->SizeOfObjects();
Ben Murdochc5610432016-08-08 18:44:38 +0100212 current_.end_memory_size = heap_->memory_allocator()->Size();
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000213 current_.end_holes_size = CountTotalHolesSize(heap_);
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000214 current_.survived_new_space_object_size = heap_->SurvivedNewSpaceObjectSize();
215
216 AddAllocation(current_.end_time);
217
218 int committed_memory = static_cast<int>(heap_->CommittedMemory() / KB);
219 int used_memory = static_cast<int>(current_.end_object_size / KB);
220 heap_->isolate()->counters()->aggregated_memory_heap_committed()->AddSample(
221 current_.end_time, committed_memory);
222 heap_->isolate()->counters()->aggregated_memory_heap_used()->AddSample(
223 current_.end_time, used_memory);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000224
Ben Murdochda12d292016-06-02 14:46:10 +0100225 double duration = current_.end_time - current_.start_time;
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000226 if (current_.type == Event::SCAVENGER) {
227 current_.incremental_marking_steps =
228 current_.cumulative_incremental_marking_steps -
229 previous_.cumulative_incremental_marking_steps;
230 current_.incremental_marking_bytes =
231 current_.cumulative_incremental_marking_bytes -
232 previous_.cumulative_incremental_marking_bytes;
233 current_.incremental_marking_duration =
234 current_.cumulative_incremental_marking_duration -
235 previous_.cumulative_incremental_marking_duration;
236 current_.pure_incremental_marking_duration =
237 current_.cumulative_pure_incremental_marking_duration -
238 previous_.cumulative_pure_incremental_marking_duration;
Ben Murdochda12d292016-06-02 14:46:10 +0100239 recorded_scavenges_total_.Push(
240 MakeBytesAndDuration(current_.new_space_object_size, duration));
241 recorded_scavenges_survived_.Push(MakeBytesAndDuration(
242 current_.survived_new_space_object_size, duration));
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400243 } else if (current_.type == Event::INCREMENTAL_MARK_COMPACTOR) {
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000244 current_.incremental_marking_steps =
245 current_.cumulative_incremental_marking_steps -
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400246 previous_incremental_mark_compactor_event_
247 .cumulative_incremental_marking_steps;
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000248 current_.incremental_marking_bytes =
249 current_.cumulative_incremental_marking_bytes -
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400250 previous_incremental_mark_compactor_event_
251 .cumulative_incremental_marking_bytes;
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000252 current_.incremental_marking_duration =
253 current_.cumulative_incremental_marking_duration -
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400254 previous_incremental_mark_compactor_event_
255 .cumulative_incremental_marking_duration;
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000256 current_.pure_incremental_marking_duration =
257 current_.cumulative_pure_incremental_marking_duration -
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400258 previous_incremental_mark_compactor_event_
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000259 .cumulative_pure_incremental_marking_duration;
260 longest_incremental_marking_step_ = 0.0;
Ben Murdochda12d292016-06-02 14:46:10 +0100261 recorded_incremental_marking_steps_.Push(
262 MakeBytesAndDuration(current_.incremental_marking_bytes,
263 current_.pure_incremental_marking_duration));
264 recorded_incremental_mark_compacts_.Push(
265 MakeBytesAndDuration(current_.start_object_size, duration));
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000266 combined_mark_compact_speed_cache_ = 0.0;
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400267 } else {
268 DCHECK(current_.incremental_marking_bytes == 0);
269 DCHECK(current_.incremental_marking_duration == 0);
270 DCHECK(current_.pure_incremental_marking_duration == 0);
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000271 longest_incremental_marking_step_ = 0.0;
Ben Murdochda12d292016-06-02 14:46:10 +0100272 recorded_mark_compacts_.Push(
273 MakeBytesAndDuration(current_.start_object_size, duration));
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000274 combined_mark_compact_speed_cache_ = 0.0;
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000275 }
276
277 // TODO(ernstm): move the code below out of GCTracer.
278
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000279 double spent_in_mutator = Max(current_.start_time - previous_.end_time, 0.0);
280
281 heap_->UpdateCumulativeGCStatistics(duration, spent_in_mutator,
282 current_.scopes[Scope::MC_MARK]);
283
284 if (current_.type == Event::SCAVENGER && FLAG_trace_gc_ignore_scavenger)
285 return;
286
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000287 if (FLAG_trace_gc_nvp)
288 PrintNVP();
289 else
290 Print();
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000291
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000292 if (FLAG_trace_gc) {
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000293 heap_->PrintShortHeapStatistics();
294 }
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000295
296 longest_incremental_marking_finalization_step_ = 0.0;
297 cumulative_incremental_marking_finalization_steps_ = 0;
298 cumulative_incremental_marking_finalization_duration_ = 0.0;
Ben Murdochda12d292016-06-02 14:46:10 +0100299 // TODO(cbruni): remove once we fully moved to a trace-based system.
300 if (FLAG_runtime_call_stats) {
Ben Murdochc5610432016-08-08 18:44:38 +0100301 RuntimeCallStats::Leave(heap_->isolate(), &timer_);
Ben Murdochda12d292016-06-02 14:46:10 +0100302 }
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000303}
304
305
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000306void GCTracer::SampleAllocation(double current_ms,
307 size_t new_space_counter_bytes,
308 size_t old_generation_counter_bytes) {
309 if (allocation_time_ms_ == 0) {
310 // It is the first sample.
311 allocation_time_ms_ = current_ms;
312 new_space_allocation_counter_bytes_ = new_space_counter_bytes;
313 old_generation_allocation_counter_bytes_ = old_generation_counter_bytes;
314 return;
315 }
316 // This assumes that counters are unsigned integers so that the subtraction
317 // below works even if the new counter is less then the old counter.
318 size_t new_space_allocated_bytes =
319 new_space_counter_bytes - new_space_allocation_counter_bytes_;
320 size_t old_generation_allocated_bytes =
321 old_generation_counter_bytes - old_generation_allocation_counter_bytes_;
322 double duration = current_ms - allocation_time_ms_;
323 allocation_time_ms_ = current_ms;
324 new_space_allocation_counter_bytes_ = new_space_counter_bytes;
325 old_generation_allocation_counter_bytes_ = old_generation_counter_bytes;
326 allocation_duration_since_gc_ += duration;
327 new_space_allocation_in_bytes_since_gc_ += new_space_allocated_bytes;
328 old_generation_allocation_in_bytes_since_gc_ +=
329 old_generation_allocated_bytes;
330}
331
332
333void GCTracer::AddAllocation(double current_ms) {
334 allocation_time_ms_ = current_ms;
Ben Murdochda12d292016-06-02 14:46:10 +0100335 if (allocation_duration_since_gc_ > 0) {
336 recorded_new_generation_allocations_.Push(
337 MakeBytesAndDuration(new_space_allocation_in_bytes_since_gc_,
338 allocation_duration_since_gc_));
339 recorded_old_generation_allocations_.Push(
340 MakeBytesAndDuration(old_generation_allocation_in_bytes_since_gc_,
341 allocation_duration_since_gc_));
342 }
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000343 allocation_duration_since_gc_ = 0;
344 new_space_allocation_in_bytes_since_gc_ = 0;
345 old_generation_allocation_in_bytes_since_gc_ = 0;
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000346}
347
348
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400349void GCTracer::AddContextDisposalTime(double time) {
Ben Murdochda12d292016-06-02 14:46:10 +0100350 recorded_context_disposal_times_.Push(time);
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400351}
352
353
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000354void GCTracer::AddCompactionEvent(double duration,
355 intptr_t live_bytes_compacted) {
Ben Murdochda12d292016-06-02 14:46:10 +0100356 recorded_compactions_.Push(
357 MakeBytesAndDuration(live_bytes_compacted, duration));
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000358}
359
360
361void GCTracer::AddSurvivalRatio(double promotion_ratio) {
Ben Murdochda12d292016-06-02 14:46:10 +0100362 recorded_survival_ratios_.Push(promotion_ratio);
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400363}
364
365
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000366void GCTracer::AddIncrementalMarkingStep(double duration, intptr_t bytes) {
367 cumulative_incremental_marking_steps_++;
368 cumulative_incremental_marking_bytes_ += bytes;
369 cumulative_incremental_marking_duration_ += duration;
370 longest_incremental_marking_step_ =
371 Max(longest_incremental_marking_step_, duration);
372 cumulative_marking_duration_ += duration;
373 if (bytes > 0) {
374 cumulative_pure_incremental_marking_duration_ += duration;
375 }
376}
377
378
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000379void GCTracer::AddIncrementalMarkingFinalizationStep(double duration) {
380 cumulative_incremental_marking_finalization_steps_++;
381 cumulative_incremental_marking_finalization_duration_ += duration;
382 longest_incremental_marking_finalization_step_ =
383 Max(longest_incremental_marking_finalization_step_, duration);
384}
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000385
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000386
387void GCTracer::Output(const char* format, ...) const {
388 if (FLAG_trace_gc) {
389 va_list arguments;
390 va_start(arguments, format);
391 base::OS::VPrint(format, arguments);
392 va_end(arguments);
393 }
394
395 const int kBufferSize = 256;
396 char raw_buffer[kBufferSize];
397 Vector<char> buffer(raw_buffer, kBufferSize);
398 va_list arguments2;
399 va_start(arguments2, format);
400 VSNPrintF(buffer, format, arguments2);
401 va_end(arguments2);
402
403 heap_->AddToRingBuffer(buffer.start());
404}
405
406
407void GCTracer::Print() const {
408 if (FLAG_trace_gc) {
Ben Murdochc5610432016-08-08 18:44:38 +0100409 PrintIsolate(heap_->isolate(), "%s", "");
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000410 }
411 Output("%8.0f ms: ", heap_->isolate()->time_millis_since_init());
412
413 Output("%s %.1f (%.1f) -> %.1f (%.1f) MB, ", current_.TypeName(false),
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000414 static_cast<double>(current_.start_object_size) / MB,
415 static_cast<double>(current_.start_memory_size) / MB,
416 static_cast<double>(current_.end_object_size) / MB,
417 static_cast<double>(current_.end_memory_size) / MB);
418
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000419 double duration = current_.end_time - current_.start_time;
Ben Murdochda12d292016-06-02 14:46:10 +0100420 Output("%.1f / %.1f ms", duration, TotalExternalTime());
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000421
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000422 if (current_.type == Event::SCAVENGER) {
423 if (current_.incremental_marking_steps > 0) {
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000424 Output(" (+ %.1f ms in %d steps since last GC)",
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000425 current_.incremental_marking_duration,
426 current_.incremental_marking_steps);
427 }
428 } else {
429 if (current_.incremental_marking_steps > 0) {
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000430 Output(
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000431 " (+ %.1f ms in %d steps since start of marking, "
432 "biggest step %.1f ms)",
433 current_.incremental_marking_duration,
434 current_.incremental_marking_steps,
435 current_.longest_incremental_marking_step);
436 }
437 }
438
439 if (current_.gc_reason != NULL) {
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000440 Output(" [%s]", current_.gc_reason);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000441 }
442
443 if (current_.collector_reason != NULL) {
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000444 Output(" [%s]", current_.collector_reason);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000445 }
446
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000447 Output(".\n");
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000448}
449
450
451void GCTracer::PrintNVP() const {
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000452 double duration = current_.end_time - current_.start_time;
453 double spent_in_mutator = current_.start_time - previous_.end_time;
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000454 intptr_t allocated_since_last_gc =
455 current_.start_object_size - previous_.end_object_size;
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000456
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000457 switch (current_.type) {
458 case Event::SCAVENGER:
459 PrintIsolate(heap_->isolate(),
460 "%8.0f ms: "
461 "pause=%.1f "
462 "mutator=%.1f "
463 "gc=%s "
464 "reduce_memory=%d "
465 "scavenge=%.2f "
466 "old_new=%.2f "
467 "weak=%.2f "
468 "roots=%.2f "
469 "code=%.2f "
470 "semispace=%.2f "
471 "object_groups=%.2f "
Ben Murdochda12d292016-06-02 14:46:10 +0100472 "external_prologue=%.2f "
473 "external_epilogue=%.2f "
474 "external_weak_global_handles=%.2f "
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000475 "steps_count=%d "
476 "steps_took=%.1f "
Ben Murdochda12d292016-06-02 14:46:10 +0100477 "scavenge_throughput=%.f "
Ben Murdochc5610432016-08-08 18:44:38 +0100478 "total_size_before=%" V8PRIdPTR
479 " "
480 "total_size_after=%" V8PRIdPTR
481 " "
482 "holes_size_before=%" V8PRIdPTR
483 " "
484 "holes_size_after=%" V8PRIdPTR
485 " "
486 "allocated=%" V8PRIdPTR
487 " "
488 "promoted=%" V8PRIdPTR
489 " "
490 "semi_space_copied=%" V8PRIdPTR
491 " "
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000492 "nodes_died_in_new=%d "
493 "nodes_copied_in_new=%d "
494 "nodes_promoted=%d "
495 "promotion_ratio=%.1f%% "
496 "average_survival_ratio=%.1f%% "
497 "promotion_rate=%.1f%% "
498 "semi_space_copy_rate=%.1f%% "
Ben Murdochda12d292016-06-02 14:46:10 +0100499 "new_space_allocation_throughput=%.1f "
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000500 "context_disposal_rate=%.1f\n",
501 heap_->isolate()->time_millis_since_init(), duration,
502 spent_in_mutator, current_.TypeName(true),
503 current_.reduce_memory,
504 current_.scopes[Scope::SCAVENGER_SCAVENGE],
505 current_.scopes[Scope::SCAVENGER_OLD_TO_NEW_POINTERS],
506 current_.scopes[Scope::SCAVENGER_WEAK],
507 current_.scopes[Scope::SCAVENGER_ROOTS],
508 current_.scopes[Scope::SCAVENGER_CODE_FLUSH_CANDIDATES],
509 current_.scopes[Scope::SCAVENGER_SEMISPACE],
510 current_.scopes[Scope::SCAVENGER_OBJECT_GROUPS],
Ben Murdochda12d292016-06-02 14:46:10 +0100511 current_.scopes[Scope::SCAVENGER_EXTERNAL_PROLOGUE],
512 current_.scopes[Scope::SCAVENGER_EXTERNAL_EPILOGUE],
513 current_.scopes[Scope::EXTERNAL_WEAK_GLOBAL_HANDLES],
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000514 current_.incremental_marking_steps,
515 current_.incremental_marking_duration,
516 ScavengeSpeedInBytesPerMillisecond(),
517 current_.start_object_size, current_.end_object_size,
518 current_.start_holes_size, current_.end_holes_size,
519 allocated_since_last_gc, heap_->promoted_objects_size(),
520 heap_->semi_space_copied_object_size(),
521 heap_->nodes_died_in_new_space_,
522 heap_->nodes_copied_in_new_space_, heap_->nodes_promoted_,
523 heap_->promotion_ratio_, AverageSurvivalRatio(),
524 heap_->promotion_rate_, heap_->semi_space_copied_rate_,
525 NewSpaceAllocationThroughputInBytesPerMillisecond(),
526 ContextDisposalRateInMilliseconds());
527 break;
528 case Event::MARK_COMPACTOR:
529 case Event::INCREMENTAL_MARK_COMPACTOR:
530 PrintIsolate(
531 heap_->isolate(),
532 "%8.0f ms: "
533 "pause=%.1f "
534 "mutator=%.1f "
535 "gc=%s "
536 "reduce_memory=%d "
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000537 "clear=%1.f "
538 "clear.code_flush=%.1f "
539 "clear.dependent_code=%.1f "
540 "clear.global_handles=%.1f "
541 "clear.maps=%.1f "
542 "clear.slots_buffer=%.1f "
543 "clear.store_buffer=%.1f "
544 "clear.string_table=%.1f "
545 "clear.weak_cells=%.1f "
546 "clear.weak_collections=%.1f "
547 "clear.weak_lists=%.1f "
548 "evacuate=%.1f "
549 "evacuate.candidates=%.1f "
550 "evacuate.clean_up=%.1f "
Ben Murdochda12d292016-06-02 14:46:10 +0100551 "evacuate.copy=%.1f "
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000552 "evacuate.update_pointers=%.1f "
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000553 "evacuate.update_pointers.to_evacuated=%.1f "
554 "evacuate.update_pointers.to_new=%.1f "
555 "evacuate.update_pointers.weak=%.1f "
Ben Murdochda12d292016-06-02 14:46:10 +0100556 "external.mc_prologue=%.1f "
557 "external.mc_epilogue=%.1f "
558 "external.mc_incremental_prologue=%.1f "
559 "external.mc_incremental_epilogue=%.1f "
560 "external.weak_global_handles=%.1f "
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000561 "finish=%.1f "
562 "mark=%.1f "
563 "mark.finish_incremental=%.1f "
564 "mark.prepare_code_flush=%.1f "
565 "mark.roots=%.1f "
566 "mark.weak_closure=%.1f "
Ben Murdochda12d292016-06-02 14:46:10 +0100567 "mark.weak_closure.ephemeral=%.1f "
568 "mark.weak_closure.weak_handles=%.1f "
569 "mark.weak_closure.weak_roots=%.1f "
570 "mark.weak_closure.harmony=%.1f "
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000571 "sweep=%.1f "
572 "sweep.code=%.1f "
573 "sweep.map=%.1f "
574 "sweep.old=%.1f "
575 "incremental_finalize=%.1f "
576 "steps_count=%d "
577 "steps_took=%.1f "
578 "longest_step=%.1f "
579 "finalization_steps_count=%d "
580 "finalization_steps_took=%.1f "
581 "finalization_longest_step=%.1f "
Ben Murdochda12d292016-06-02 14:46:10 +0100582 "incremental_marking_throughput=%.f "
Ben Murdochc5610432016-08-08 18:44:38 +0100583 "total_size_before=%" V8PRIdPTR
584 " "
585 "total_size_after=%" V8PRIdPTR
586 " "
587 "holes_size_before=%" V8PRIdPTR
588 " "
589 "holes_size_after=%" V8PRIdPTR
590 " "
591 "allocated=%" V8PRIdPTR
592 " "
593 "promoted=%" V8PRIdPTR
594 " "
595 "semi_space_copied=%" V8PRIdPTR
596 " "
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000597 "nodes_died_in_new=%d "
598 "nodes_copied_in_new=%d "
599 "nodes_promoted=%d "
600 "promotion_ratio=%.1f%% "
601 "average_survival_ratio=%.1f%% "
602 "promotion_rate=%.1f%% "
603 "semi_space_copy_rate=%.1f%% "
Ben Murdochda12d292016-06-02 14:46:10 +0100604 "new_space_allocation_throughput=%.1f "
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000605 "context_disposal_rate=%.1f "
Ben Murdochda12d292016-06-02 14:46:10 +0100606 "compaction_speed=%.f\n",
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000607 heap_->isolate()->time_millis_since_init(), duration,
608 spent_in_mutator, current_.TypeName(true), current_.reduce_memory,
Ben Murdochda12d292016-06-02 14:46:10 +0100609 current_.scopes[Scope::MC_CLEAR],
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000610 current_.scopes[Scope::MC_CLEAR_CODE_FLUSH],
611 current_.scopes[Scope::MC_CLEAR_DEPENDENT_CODE],
612 current_.scopes[Scope::MC_CLEAR_GLOBAL_HANDLES],
613 current_.scopes[Scope::MC_CLEAR_MAPS],
614 current_.scopes[Scope::MC_CLEAR_SLOTS_BUFFER],
615 current_.scopes[Scope::MC_CLEAR_STORE_BUFFER],
616 current_.scopes[Scope::MC_CLEAR_STRING_TABLE],
617 current_.scopes[Scope::MC_CLEAR_WEAK_CELLS],
618 current_.scopes[Scope::MC_CLEAR_WEAK_COLLECTIONS],
619 current_.scopes[Scope::MC_CLEAR_WEAK_LISTS],
620 current_.scopes[Scope::MC_EVACUATE],
621 current_.scopes[Scope::MC_EVACUATE_CANDIDATES],
622 current_.scopes[Scope::MC_EVACUATE_CLEAN_UP],
Ben Murdochda12d292016-06-02 14:46:10 +0100623 current_.scopes[Scope::MC_EVACUATE_COPY],
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000624 current_.scopes[Scope::MC_EVACUATE_UPDATE_POINTERS],
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000625 current_.scopes[Scope::MC_EVACUATE_UPDATE_POINTERS_TO_EVACUATED],
626 current_.scopes[Scope::MC_EVACUATE_UPDATE_POINTERS_TO_NEW],
627 current_.scopes[Scope::MC_EVACUATE_UPDATE_POINTERS_WEAK],
Ben Murdochda12d292016-06-02 14:46:10 +0100628 current_.scopes[Scope::MC_EXTERNAL_PROLOGUE],
629 current_.scopes[Scope::MC_EXTERNAL_EPILOGUE],
630 current_.scopes[Scope::MC_INCREMENTAL_EXTERNAL_PROLOGUE],
631 current_.scopes[Scope::MC_INCREMENTAL_EXTERNAL_EPILOGUE],
632 current_.scopes[Scope::EXTERNAL_WEAK_GLOBAL_HANDLES],
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000633 current_.scopes[Scope::MC_FINISH], current_.scopes[Scope::MC_MARK],
634 current_.scopes[Scope::MC_MARK_FINISH_INCREMENTAL],
635 current_.scopes[Scope::MC_MARK_PREPARE_CODE_FLUSH],
636 current_.scopes[Scope::MC_MARK_ROOTS],
637 current_.scopes[Scope::MC_MARK_WEAK_CLOSURE],
Ben Murdochda12d292016-06-02 14:46:10 +0100638 current_.scopes[Scope::MC_MARK_WEAK_CLOSURE_EPHEMERAL],
639 current_.scopes[Scope::MC_MARK_WEAK_CLOSURE_WEAK_HANDLES],
640 current_.scopes[Scope::MC_MARK_WEAK_CLOSURE_WEAK_ROOTS],
641 current_.scopes[Scope::MC_MARK_WEAK_CLOSURE_HARMONY],
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000642 current_.scopes[Scope::MC_SWEEP],
643 current_.scopes[Scope::MC_SWEEP_CODE],
644 current_.scopes[Scope::MC_SWEEP_MAP],
645 current_.scopes[Scope::MC_SWEEP_OLD],
646 current_.scopes[Scope::MC_INCREMENTAL_FINALIZE],
647 current_.incremental_marking_steps,
648 current_.incremental_marking_duration,
649 current_.longest_incremental_marking_step,
650 cumulative_incremental_marking_finalization_steps_,
651 cumulative_incremental_marking_finalization_duration_,
652 longest_incremental_marking_finalization_step_,
653 IncrementalMarkingSpeedInBytesPerMillisecond(),
654 current_.start_object_size, current_.end_object_size,
655 current_.start_holes_size, current_.end_holes_size,
656 allocated_since_last_gc, heap_->promoted_objects_size(),
657 heap_->semi_space_copied_object_size(),
658 heap_->nodes_died_in_new_space_, heap_->nodes_copied_in_new_space_,
659 heap_->nodes_promoted_, heap_->promotion_ratio_,
660 AverageSurvivalRatio(), heap_->promotion_rate_,
661 heap_->semi_space_copied_rate_,
662 NewSpaceAllocationThroughputInBytesPerMillisecond(),
663 ContextDisposalRateInMilliseconds(),
664 CompactionSpeedInBytesPerMillisecond());
665 break;
666 case Event::START:
667 break;
668 default:
669 UNREACHABLE();
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000670 }
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000671}
672
Ben Murdochda12d292016-06-02 14:46:10 +0100673double GCTracer::AverageSpeed(const RingBuffer<BytesAndDuration>& buffer,
674 const BytesAndDuration& initial, double time_ms) {
675 BytesAndDuration sum = buffer.Sum(
676 [time_ms](BytesAndDuration a, BytesAndDuration b) {
677 if (time_ms != 0 && a.second >= time_ms) return a;
678 return std::make_pair(a.first + b.first, a.second + b.second);
679 },
680 initial);
681 uint64_t bytes = sum.first;
682 double durations = sum.second;
683 if (durations == 0.0) return 0;
684 double speed = bytes / durations;
685 const int max_speed = 1024 * MB;
686 const int min_speed = 1;
687 if (speed >= max_speed) return max_speed;
688 if (speed <= min_speed) return min_speed;
689 return speed;
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000690}
691
Ben Murdochda12d292016-06-02 14:46:10 +0100692double GCTracer::AverageSpeed(const RingBuffer<BytesAndDuration>& buffer) {
693 return AverageSpeed(buffer, MakeBytesAndDuration(0, 0), 0);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000694}
695
Ben Murdochda12d292016-06-02 14:46:10 +0100696double GCTracer::IncrementalMarkingSpeedInBytesPerMillisecond() const {
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000697 if (cumulative_incremental_marking_duration_ == 0.0) return 0;
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000698 // We haven't completed an entire round of incremental marking, yet.
699 // Use data from GCTracer instead of data from event buffers.
Ben Murdochda12d292016-06-02 14:46:10 +0100700 if (recorded_incremental_marking_steps_.Count() == 0) {
701 return cumulative_incremental_marking_bytes_ /
702 cumulative_pure_incremental_marking_duration_;
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000703 }
Ben Murdochda12d292016-06-02 14:46:10 +0100704 return AverageSpeed(recorded_incremental_marking_steps_);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000705}
706
Ben Murdochda12d292016-06-02 14:46:10 +0100707double GCTracer::ScavengeSpeedInBytesPerMillisecond(
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000708 ScavengeSpeedMode mode) const {
Ben Murdochda12d292016-06-02 14:46:10 +0100709 if (mode == kForAllObjects) {
710 return AverageSpeed(recorded_scavenges_total_);
711 } else {
712 return AverageSpeed(recorded_scavenges_survived_);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000713 }
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000714}
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000715
Ben Murdochda12d292016-06-02 14:46:10 +0100716double GCTracer::CompactionSpeedInBytesPerMillisecond() const {
717 return AverageSpeed(recorded_compactions_);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000718}
719
Ben Murdochda12d292016-06-02 14:46:10 +0100720double GCTracer::MarkCompactSpeedInBytesPerMillisecond() const {
721 return AverageSpeed(recorded_mark_compacts_);
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400722}
723
Ben Murdochda12d292016-06-02 14:46:10 +0100724double GCTracer::FinalIncrementalMarkCompactSpeedInBytesPerMillisecond() const {
725 return AverageSpeed(recorded_incremental_mark_compacts_);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000726}
727
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000728double GCTracer::CombinedMarkCompactSpeedInBytesPerMillisecond() {
729 if (combined_mark_compact_speed_cache_ > 0)
730 return combined_mark_compact_speed_cache_;
731 const double kMinimumMarkingSpeed = 0.5;
Ben Murdochda12d292016-06-02 14:46:10 +0100732 double speed1 = IncrementalMarkingSpeedInBytesPerMillisecond();
733 double speed2 = FinalIncrementalMarkCompactSpeedInBytesPerMillisecond();
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000734 if (speed1 < kMinimumMarkingSpeed || speed2 < kMinimumMarkingSpeed) {
735 // No data for the incremental marking speed.
736 // Return the non-incremental mark-compact speed.
737 combined_mark_compact_speed_cache_ =
Ben Murdochda12d292016-06-02 14:46:10 +0100738 MarkCompactSpeedInBytesPerMillisecond();
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000739 } else {
740 // Combine the speed of incremental step and the speed of the final step.
741 // 1 / (1 / speed1 + 1 / speed2) = speed1 * speed2 / (speed1 + speed2).
742 combined_mark_compact_speed_cache_ = speed1 * speed2 / (speed1 + speed2);
743 }
744 return combined_mark_compact_speed_cache_;
745}
746
Ben Murdochda12d292016-06-02 14:46:10 +0100747double GCTracer::NewSpaceAllocationThroughputInBytesPerMillisecond(
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000748 double time_ms) const {
749 size_t bytes = new_space_allocation_in_bytes_since_gc_;
750 double durations = allocation_duration_since_gc_;
Ben Murdochda12d292016-06-02 14:46:10 +0100751 return AverageSpeed(recorded_new_generation_allocations_,
752 MakeBytesAndDuration(bytes, durations), time_ms);
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000753}
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000754
Ben Murdochda12d292016-06-02 14:46:10 +0100755double GCTracer::OldGenerationAllocationThroughputInBytesPerMillisecond(
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000756 double time_ms) const {
757 size_t bytes = old_generation_allocation_in_bytes_since_gc_;
758 double durations = allocation_duration_since_gc_;
Ben Murdochda12d292016-06-02 14:46:10 +0100759 return AverageSpeed(recorded_old_generation_allocations_,
760 MakeBytesAndDuration(bytes, durations), time_ms);
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000761}
762
Ben Murdochda12d292016-06-02 14:46:10 +0100763double GCTracer::AllocationThroughputInBytesPerMillisecond(
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000764 double time_ms) const {
765 return NewSpaceAllocationThroughputInBytesPerMillisecond(time_ms) +
766 OldGenerationAllocationThroughputInBytesPerMillisecond(time_ms);
767}
768
Ben Murdochda12d292016-06-02 14:46:10 +0100769double GCTracer::CurrentAllocationThroughputInBytesPerMillisecond() const {
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000770 return AllocationThroughputInBytesPerMillisecond(kThroughputTimeFrameMs);
771}
772
Ben Murdochda12d292016-06-02 14:46:10 +0100773double GCTracer::CurrentOldGenerationAllocationThroughputInBytesPerMillisecond()
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000774 const {
775 return OldGenerationAllocationThroughputInBytesPerMillisecond(
776 kThroughputTimeFrameMs);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000777}
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400778
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400779double GCTracer::ContextDisposalRateInMilliseconds() const {
Ben Murdochda12d292016-06-02 14:46:10 +0100780 if (recorded_context_disposal_times_.Count() <
781 recorded_context_disposal_times_.kSize)
782 return 0.0;
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000783 double begin = heap_->MonotonicallyIncreasingTimeInMs();
Ben Murdochda12d292016-06-02 14:46:10 +0100784 double end = recorded_context_disposal_times_.Sum(
785 [](double a, double b) { return b; }, 0.0);
786 return (begin - end) / recorded_context_disposal_times_.Count();
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400787}
788
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000789double GCTracer::AverageSurvivalRatio() const {
Ben Murdochda12d292016-06-02 14:46:10 +0100790 if (recorded_survival_ratios_.Count() == 0) return 0.0;
791 double sum = recorded_survival_ratios_.Sum(
792 [](double a, double b) { return a + b; }, 0.0);
793 return sum / recorded_survival_ratios_.Count();
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400794}
795
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400796bool GCTracer::SurvivalEventsRecorded() const {
Ben Murdochda12d292016-06-02 14:46:10 +0100797 return recorded_survival_ratios_.Count() > 0;
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400798}
799
Ben Murdochda12d292016-06-02 14:46:10 +0100800void GCTracer::ResetSurvivalEvents() { recorded_survival_ratios_.Reset(); }
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000801} // namespace internal
802} // namespace v8