OLD | NEW |
---|---|
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // 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 | 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/heap/gc-tracer.h" | 7 #include "src/heap/gc-tracer.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
96 if (collector == SCAVENGER) { | 96 if (collector == SCAVENGER) { |
97 current_ = Event(Event::SCAVENGER, gc_reason, collector_reason); | 97 current_ = Event(Event::SCAVENGER, gc_reason, collector_reason); |
98 } else { | 98 } else { |
99 current_ = Event(Event::MARK_COMPACTOR, gc_reason, collector_reason); | 99 current_ = Event(Event::MARK_COMPACTOR, gc_reason, collector_reason); |
100 } | 100 } |
101 | 101 |
102 current_.start_time = base::OS::TimeCurrentMillis(); | 102 current_.start_time = base::OS::TimeCurrentMillis(); |
103 current_.start_object_size = heap_->SizeOfObjects(); | 103 current_.start_object_size = heap_->SizeOfObjects(); |
104 current_.start_memory_size = heap_->isolate()->memory_allocator()->Size(); | 104 current_.start_memory_size = heap_->isolate()->memory_allocator()->Size(); |
105 current_.start_holes_size = CountTotalHolesSize(heap_); | 105 current_.start_holes_size = CountTotalHolesSize(heap_); |
106 current_.new_space_object_size = | |
107 heap_->new_space()->top() - heap_->new_space()->bottom(); | |
Hannes Payer (out of office)
2014/08/19 11:52:59
The question here is: What is the right size we ca
| |
106 | 108 |
107 current_.cumulative_incremental_marking_steps = | 109 current_.cumulative_incremental_marking_steps = |
108 cumulative_incremental_marking_steps_; | 110 cumulative_incremental_marking_steps_; |
109 current_.cumulative_incremental_marking_bytes = | 111 current_.cumulative_incremental_marking_bytes = |
110 cumulative_incremental_marking_bytes_; | 112 cumulative_incremental_marking_bytes_; |
111 current_.cumulative_incremental_marking_duration = | 113 current_.cumulative_incremental_marking_duration = |
112 cumulative_incremental_marking_duration_; | 114 cumulative_incremental_marking_duration_; |
113 current_.cumulative_pure_incremental_marking_duration = | 115 current_.cumulative_pure_incremental_marking_duration = |
114 cumulative_pure_incremental_marking_duration_; | 116 cumulative_pure_incremental_marking_duration_; |
115 current_.longest_incremental_marking_step = longest_incremental_marking_step_; | 117 current_.longest_incremental_marking_step = longest_incremental_marking_step_; |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
289 heap_->semi_space_copied_object_size_); | 291 heap_->semi_space_copied_object_size_); |
290 PrintF("nodes_died_in_new=%d ", heap_->nodes_died_in_new_space_); | 292 PrintF("nodes_died_in_new=%d ", heap_->nodes_died_in_new_space_); |
291 PrintF("nodes_copied_in_new=%d ", heap_->nodes_copied_in_new_space_); | 293 PrintF("nodes_copied_in_new=%d ", heap_->nodes_copied_in_new_space_); |
292 PrintF("nodes_promoted=%d ", heap_->nodes_promoted_); | 294 PrintF("nodes_promoted=%d ", heap_->nodes_promoted_); |
293 PrintF("promotion_rate=%.1f%% ", heap_->promotion_rate_); | 295 PrintF("promotion_rate=%.1f%% ", heap_->promotion_rate_); |
294 PrintF("semi_space_copy_rate=%.1f%% ", heap_->semi_space_copied_rate_); | 296 PrintF("semi_space_copy_rate=%.1f%% ", heap_->semi_space_copied_rate_); |
295 | 297 |
296 if (current_.type == Event::SCAVENGER) { | 298 if (current_.type == Event::SCAVENGER) { |
297 PrintF("steps_count=%d ", current_.incremental_marking_steps); | 299 PrintF("steps_count=%d ", current_.incremental_marking_steps); |
298 PrintF("steps_took=%.1f ", current_.incremental_marking_duration); | 300 PrintF("steps_took=%.1f ", current_.incremental_marking_duration); |
301 PrintF("scavenge_throughput=%" V8_PTR_PREFIX "d ", | |
302 ScavengeSpeedInBytesPerMillisecond()); | |
299 } else { | 303 } else { |
300 PrintF("steps_count=%d ", current_.incremental_marking_steps); | 304 PrintF("steps_count=%d ", current_.incremental_marking_steps); |
301 PrintF("steps_took=%.1f ", current_.incremental_marking_duration); | 305 PrintF("steps_took=%.1f ", current_.incremental_marking_duration); |
302 PrintF("longest_step=%.1f ", current_.longest_incremental_marking_step); | 306 PrintF("longest_step=%.1f ", current_.longest_incremental_marking_step); |
303 PrintF("incremental_marking_throughput=%" V8_PTR_PREFIX "d ", | 307 PrintF("incremental_marking_throughput=%" V8_PTR_PREFIX "d ", |
304 IncrementalMarkingSpeedInBytesPerMillisecond()); | 308 IncrementalMarkingSpeedInBytesPerMillisecond()); |
305 } | 309 } |
306 | 310 |
307 PrintF("\n"); | 311 PrintF("\n"); |
308 } | 312 } |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
391 while (iter != mark_compactor_events_.end()) { | 395 while (iter != mark_compactor_events_.end()) { |
392 bytes += iter->incremental_marking_bytes; | 396 bytes += iter->incremental_marking_bytes; |
393 durations += iter->pure_incremental_marking_duration; | 397 durations += iter->pure_incremental_marking_duration; |
394 ++iter; | 398 ++iter; |
395 } | 399 } |
396 | 400 |
397 if (durations == 0.0) return 0; | 401 if (durations == 0.0) return 0; |
398 | 402 |
399 return static_cast<intptr_t>(bytes / durations); | 403 return static_cast<intptr_t>(bytes / durations); |
400 } | 404 } |
405 | |
406 | |
407 intptr_t GCTracer::ScavengeSpeedInBytesPerMillisecond() const { | |
408 intptr_t bytes = 0; | |
409 double durations = 0.0; | |
410 EventBuffer::const_iterator iter = scavenger_events_.begin(); | |
411 while (iter != scavenger_events_.end()) { | |
412 bytes += iter->new_space_object_size; | |
413 durations += iter->end_time - iter->start_time; | |
414 ++iter; | |
415 } | |
416 | |
417 if (durations == 0.0) return 0; | |
418 | |
419 return static_cast<intptr_t>(bytes / durations); | |
420 } | |
401 } | 421 } |
402 } // namespace v8::internal | 422 } // namespace v8::internal |
OLD | NEW |