Bug 836284 - Handle negative slice times in GC stats reporter; r=billm
authorTerrence Cole <terrence@mozilla.com>
Mon, 30 Sep 2013 11:00:55 -0700
changeset 149303 fd872b99606c7c5559d33342554599ff7add797b
parent 149302 6f7129d1e041292318b5123ff6acf151a5b80ce5
child 149304 d4e4cc29a3e4f52d7da373bb5dd94b4da42e6731
push id34521
push usertcole@mozilla.com
push dateMon, 30 Sep 2013 18:01:27 +0000
treeherdermozilla-inbound@fd872b99606c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs836284
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 836284 - Handle negative slice times in GC stats reporter; r=billm
js/src/gc/Statistics.cpp
--- a/js/src/gc/Statistics.cpp
+++ b/js/src/gc/Statistics.cpp
@@ -73,16 +73,18 @@ class gcstats::StatisticsSerializer
     void appendNumber(const char *name, const char *vfmt, const char *units, ...) {
         va_list va;
         va_start(va, units);
         append(name, vfmt, va, units);
         va_end(va);
     }
 
     void appendDecimal(const char *name, const char *units, double d) {
+        if (d < 0)
+            d = 0;
         if (asJSON_)
             appendNumber(name, "%d.%d", units, (int)d, (int)(d * 10.) % 10);
         else
             appendNumber(name, "%.1f", units, d);
     }
 
     void appendIfNonzeroMS(const char *name, double v) {
         if (asJSON_ || v >= 0.1)