| 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/gc-tracer.h" | 7 #include "src/gc-tracer.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 PrintF("promotion_rate=%.1f%% ", heap_->promotion_rate_); | 273 PrintF("promotion_rate=%.1f%% ", heap_->promotion_rate_); |
| 274 PrintF("semi_space_copy_rate=%.1f%% ", heap_->semi_space_copied_rate_); | 274 PrintF("semi_space_copy_rate=%.1f%% ", heap_->semi_space_copied_rate_); |
| 275 | 275 |
| 276 if (current_.type == Event::SCAVENGER) { | 276 if (current_.type == Event::SCAVENGER) { |
| 277 PrintF("steps_count=%d ", current_.incremental_marking_steps); | 277 PrintF("steps_count=%d ", current_.incremental_marking_steps); |
| 278 PrintF("steps_took=%.1f ", current_.incremental_marking_duration); | 278 PrintF("steps_took=%.1f ", current_.incremental_marking_duration); |
| 279 } else { | 279 } else { |
| 280 PrintF("steps_count=%d ", current_.incremental_marking_steps); | 280 PrintF("steps_count=%d ", current_.incremental_marking_steps); |
| 281 PrintF("steps_took=%.1f ", current_.incremental_marking_duration); | 281 PrintF("steps_took=%.1f ", current_.incremental_marking_duration); |
| 282 PrintF("longest_step=%.1f ", current_.longest_incremental_marking_step); | 282 PrintF("longest_step=%.1f ", current_.longest_incremental_marking_step); |
| 283 PrintF("marking_throughput=%" V8_PTR_PREFIX "d ", | 283 PrintF("incremental_marking_throughput=%" V8_PTR_PREFIX "d ", |
| 284 MarkingSpeedInBytesPerMillisecond()); | 284 IncrementalMarkingSpeedInBytesPerMillisecond()); |
| 285 } | 285 } |
| 286 | 286 |
| 287 PrintF("\n"); | 287 PrintF("\n"); |
| 288 } | 288 } |
| 289 | 289 |
| 290 | 290 |
| 291 double GCTracer::MeanDuration(const EventBuffer& events) const { | 291 double GCTracer::MeanDuration(const EventBuffer& events) const { |
| 292 if (events.empty()) return 0.0; | 292 if (events.empty()) return 0.0; |
| 293 | 293 |
| 294 double mean = 0.0; | 294 double mean = 0.0; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 | 348 |
| 349 double max_duration = 0.0; | 349 double max_duration = 0.0; |
| 350 EventBuffer::const_iterator iter = mark_compactor_events_.begin(); | 350 EventBuffer::const_iterator iter = mark_compactor_events_.begin(); |
| 351 while (iter != mark_compactor_events_.end()) | 351 while (iter != mark_compactor_events_.end()) |
| 352 max_duration = Max(iter->longest_incremental_marking_step, max_duration); | 352 max_duration = Max(iter->longest_incremental_marking_step, max_duration); |
| 353 | 353 |
| 354 return max_duration; | 354 return max_duration; |
| 355 } | 355 } |
| 356 | 356 |
| 357 | 357 |
| 358 intptr_t GCTracer::MarkingSpeedInBytesPerMillisecond() const { | 358 intptr_t GCTracer::IncrementalMarkingSpeedInBytesPerMillisecond() const { |
| 359 if (cumulative_incremental_marking_duration_ == 0.0) return 0; | 359 if (cumulative_incremental_marking_duration_ == 0.0) return 0; |
| 360 | 360 |
| 361 // We haven't completed an entire round of incremental marking, yet. | 361 // We haven't completed an entire round of incremental marking, yet. |
| 362 // Use data from GCTracer instead of data from event buffers. | 362 // Use data from GCTracer instead of data from event buffers. |
| 363 if (mark_compactor_events_.empty()) { | 363 if (mark_compactor_events_.empty()) { |
| 364 return static_cast<intptr_t>(cumulative_incremental_marking_bytes_ / | 364 return static_cast<intptr_t>(cumulative_incremental_marking_bytes_ / |
| 365 cumulative_incremental_marking_duration_); | 365 cumulative_incremental_marking_duration_); |
| 366 } | 366 } |
| 367 | 367 |
| 368 intptr_t bytes = 0; | 368 intptr_t bytes = 0; |
| 369 double durations = 0.0; | 369 double durations = 0.0; |
| 370 EventBuffer::const_iterator iter = mark_compactor_events_.begin(); | 370 EventBuffer::const_iterator iter = mark_compactor_events_.begin(); |
| 371 while (iter != mark_compactor_events_.end()) { | 371 while (iter != mark_compactor_events_.end()) { |
| 372 bytes += iter->incremental_marking_bytes; | 372 bytes += iter->incremental_marking_bytes; |
| 373 durations += iter->incremental_marking_duration; | 373 durations += iter->incremental_marking_duration; |
| 374 ++iter; | 374 ++iter; |
| 375 } | 375 } |
| 376 | 376 |
| 377 if (durations == 0.0) return 0; | 377 if (durations == 0.0) return 0; |
| 378 | 378 |
| 379 return static_cast<intptr_t>(bytes / durations); | 379 return static_cast<intptr_t>(bytes / durations); |
| 380 } | 380 } |
| 381 } | 381 } |
| 382 } // namespace v8::internal | 382 } // namespace v8::internal |
| OLD | NEW |