Bug 713773 - Ensure GC statistics counters are initialized (r=igor)
authorBill McCloskey <wmccloskey@mozilla.com>
Tue, 27 Dec 2011 18:42:31 -0800
changeset 84645 35674d1a5efba2e309b58e3302242b8b5b3b6bb3
parent 84644 994d41f8225738de17b062746686a88fd0289d75
child 84646 9c78b487233347155c1dd02d8a7f251a24db4aae
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersigor
bugs713773
milestone12.0a1
Bug 713773 - Ensure GC statistics counters are initialized (r=igor)
js/src/gc/Statistics.cpp
--- a/js/src/gc/Statistics.cpp
+++ b/js/src/gc/Statistics.cpp
@@ -115,16 +115,21 @@ Statistics::makeTable(ColumnInfo *cols)
 
     JS_ASSERT(i == NUM_COLUMNS);
 }
 
 Statistics::Statistics(JSRuntime *rt)
   : runtime(rt)
   , triggerReason(PUBLIC_API) //dummy reason to satisfy makeTable
 {
+    PodArrayZero(counts);
+    PodArrayZero(totals);
+
+    startupTime = PRMJ_Now();
+
     char *env = getenv("MOZ_GCTIMER");
     if (!env || strcmp(env, "none") == 0) {
         fp = NULL;
         return;
     }
 
     if (strcmp(env, "stdout") == 0) {
         fullFormat = false;
@@ -141,21 +146,16 @@ Statistics::Statistics(JSRuntime *rt)
         fprintf(fp, "     AppTime");
 
         ColumnInfo cols[NUM_COLUMNS];
         makeTable(cols);
         for (int i = 0; i < NUM_COLUMNS; i++)
             fprintf(fp, ", %*s", cols[i].width, cols[i].title);
         fprintf(fp, "\n");
     }
-
-    PodArrayZero(counts);
-    PodArrayZero(totals);
-
-    startupTime = PRMJ_Now();
 }
 
 Statistics::~Statistics()
 {
     if (fp) {
         if (fullFormat) {
             fprintf(fp, "------>TOTAL");