Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(506)

Side by Side Diff: src/heap/gc-tracer.cc

Issue 1438313002: [heap] Fix type conversion in gc tracer (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/heap/gc-tracer.h" 5 #include "src/heap/gc-tracer.h"
6 6
7 #include "src/counters.h" 7 #include "src/counters.h"
8 #include "src/heap/heap-inl.h" 8 #include "src/heap/heap-inl.h"
9 #include "src/isolate.h" 9 #include "src/isolate.h"
10 10
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 ++iter; 711 ++iter;
712 } 712 }
713 713
714 if (durations == 0.0) return 0; 714 if (durations == 0.0) return 0;
715 // Make sure the result is at least 1. 715 // Make sure the result is at least 1.
716 return Max<size_t>(static_cast<size_t>(bytes / durations + 0.5), 1); 716 return Max<size_t>(static_cast<size_t>(bytes / durations + 0.5), 1);
717 } 717 }
718 718
719 719
720 intptr_t GCTracer::CompactionSpeedInBytesPerMillisecond() const { 720 intptr_t GCTracer::CompactionSpeedInBytesPerMillisecond() const {
721 if (compaction_events_.size() < kRingBufferMaxSize) return 0.0; 721 if (compaction_events_.size() < kRingBufferMaxSize) return 0;
722 intptr_t bytes = 0; 722 intptr_t bytes = 0;
723 double durations = 0.0; 723 double durations = 0.0;
724 CompactionEventBuffer::const_iterator iter = compaction_events_.begin(); 724 CompactionEventBuffer::const_iterator iter = compaction_events_.begin();
725 while (iter != compaction_events_.end()) { 725 while (iter != compaction_events_.end()) {
726 bytes += iter->live_bytes_compacted; 726 bytes += iter->live_bytes_compacted;
727 durations += iter->duration; 727 durations += iter->duration;
728 ++iter; 728 ++iter;
729 } 729 }
730 730
731 if (durations == 0.0) return 0; 731 if (durations == 0.0) return 0;
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 879
880 880
881 bool GCTracer::SurvivalEventsRecorded() const { 881 bool GCTracer::SurvivalEventsRecorded() const {
882 return survival_events_.size() > 0; 882 return survival_events_.size() > 0;
883 } 883 }
884 884
885 885
886 void GCTracer::ResetSurvivalEvents() { survival_events_.reset(); } 886 void GCTracer::ResetSurvivalEvents() { survival_events_.reset(); }
887 } // namespace internal 887 } // namespace internal
888 } // namespace v8 888 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698