Bug 484319 - 'TM: Add logging mode for aborts only'. r=gal.
authorBen Turner <bent.mozilla@gmail.com>
Thu, 19 Mar 2009 20:39:18 -0700
changeset 26398 01f2d0726219b8b2da94917fb2051179d8b628f3
parent 26397 5f40ac8ed7d4bc14b421424843f86a7e1d5033dd
child 26399 316bf18780b0fb4efac69e85836f299bff94e952
child 26510 3593cf467e6c56f311ff05954b1e07ee02ef2806
push id6047
push userrsayre@mozilla.com
push dateFri, 20 Mar 2009 04:05:27 +0000
treeherdermozilla-central@316bf18780b0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgal
bugs484319
milestone1.9.2a1pre
Bug 484319 - 'TM: Add logging mode for aborts only'. r=gal.
js/src/jstracer.cpp
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -130,18 +130,20 @@ static const char tagChar[]  = "OIDISIBI
 #define MAX_INTERP_STACK_BYTES                                                \
     (MAX_NATIVE_STACK_SLOTS * sizeof(jsval) +                                 \
      MAX_CALL_STACK_ENTRIES * sizeof(JSInlineFrame))
 
 /* Max number of branches per tree. */
 #define MAX_BRANCHES 16
 
 #ifdef JS_JIT_SPEW
-#define ABORT_TRACE(msg)   do { debug_only_v(fprintf(stdout, "abort: %d: %s\n", __LINE__, msg);)  return false; } while (0)
+#define debug_only_a(x) if (js_verboseAbort || js_verboseDebug ) { x; }
+#define ABORT_TRACE(msg)   do { debug_only_a(fprintf(stdout, "abort: %d: %s\n", __LINE__, msg);)  return false; } while (0)
 #else
+#define debug_only_a(x)
 #define ABORT_TRACE(msg)   return false
 #endif
 
 #ifdef JS_JIT_SPEW
 struct __jitstats {
 #define JITSTAT(x) uint64 x;
 #include "jitstats.tbl"
 #undef JITSTAT
@@ -240,16 +242,17 @@ js_DumpPeerStability(JSTraceMonitor* tm,
 static bool nesting_enabled = true;
 #if defined(NANOJIT_IA32)
 static bool did_we_check_sse2 = false;
 #endif
 
 #ifdef JS_JIT_SPEW
 bool js_verboseDebug = getenv("TRACEMONKEY") && strstr(getenv("TRACEMONKEY"), "verbose");
 bool js_verboseStats = getenv("TRACEMONKEY") && strstr(getenv("TRACEMONKEY"), "stats");
+bool js_verboseAbort = getenv("TRACEMONKEY") && strstr(getenv("TRACEMONKEY"), "abort");
 #endif
 
 /* The entire VM shares one oracle. Collisions and concurrent updates are tolerated and worst
    case cause performance regressions. */
 static Oracle oracle;
 
 Tracker::Tracker()
 {
@@ -4456,17 +4459,17 @@ js_AbortRecording(JSContext* cx, const c
     if (!f) {
         js_DeleteRecorder(cx);
         return;
     }
     JS_ASSERT(!f->vmprivate);
 
 #ifdef DEBUG
     TreeInfo* ti = tm->recorder->getTreeInfo();
-    debug_only_v(printf("Abort recording of tree %s:%d@%d at %s:%d@%d: %s.\n",
+    debug_only_a(printf("Abort recording of tree %s:%d@%d at %s:%d@%d: %s.\n",
                         ti->treeFileName,
                         ti->treeLineNumber,
                         ti->treePCOffset,
                         cx->fp->script->filename,
                         js_FramePCToLineNumber(cx, cx->fp),
                         FramePCOffset(cx->fp),
                         reason);)
 #endif