[INFER] Tweak kludge so sunspider harness works, bug 608746.
authorBrian Hackett <bhackett1024@gmail.com>
Mon, 01 Nov 2010 15:31:26 -0700
changeset 74604 5cc1cd687ef9f35ffc30efafa5c49c40ee29d323
parent 74603 d4258341de5ce74ac382429c6ee473d5657efbe7
child 74605 76403064329eb250a3c053204f1d71c8de2ea7a0
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
bugs608746
milestone2.0b8pre
[INFER] Tweak kludge so sunspider harness works, bug 608746.
js/src/shell/js.cpp
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -152,16 +152,19 @@ static jsdouble gTimeoutInterval = -1.0;
 static volatile bool gCanceled = false;
 
 static bool enableTraceJit = false;
 static bool enableMethodJit = false;
 static bool enableProfiling = false;
 
 static bool printTiming = false;
 
+/* :FIXME: remove bug 608746 */
+static bool disablePrinting = false;
+
 static JSBool
 SetTimeoutValue(JSContext *cx, jsdouble t);
 
 static bool
 InitWatchdog(JSRuntime *rt);
 
 static void
 KillWatchdog();
@@ -458,27 +461,27 @@ Process(JSContext *cx, JSObject *obj, ch
                      * until recompilation works :FIXME: bug 608746
                      */
 
                     if (enableTraceJit)
                         JS_ToggleOptions(cx, JSOPTION_JIT);
                     if (enableMethodJit)
                         JS_ToggleOptions(cx, JSOPTION_METHODJIT);
 
-                    printf("Running interpreter...\n");
+                    disablePrinting = true;
 
                     (void)JS_ExecuteScript(cx, obj, script, NULL);
                     t1 = PRMJ_Now();
 
                     if (enableTraceJit)
                         JS_ToggleOptions(cx, JSOPTION_JIT);
                     if (enableMethodJit)
                         JS_ToggleOptions(cx, JSOPTION_METHODJIT);
 
-                    printf("Running JITs...\n");
+                    disablePrinting = false;
                 }
 #endif
 
                 (void)JS_ExecuteScript(cx, obj, script, NULL);
                 int64 t2 = PRMJ_Now() - t1;
                 if (printTiming)
                     printf("runtime = %.3f ms\n", double(t2) / PRMJ_USEC_PER_MSEC);
             }
@@ -1204,16 +1207,21 @@ Now(JSContext *cx, uintN argc, jsval *vp
     jsdouble now = PRMJ_Now() / double(PRMJ_USEC_PER_MSEC);
     JS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(now));
     return true;
 }
 
 static JSBool
 Print(JSContext *cx, uintN argc, jsval *vp)
 {
+    if (disablePrinting) {
+        JS_SET_RVAL(cx, vp, JSVAL_VOID);
+        return JS_TRUE;
+    }
+
     jsval *argv;
     uintN i;
     JSString *str;
     char *bytes;
 
     argv = JS_ARGV(cx, vp);
     for (i = 0; i < argc; i++) {
         str = JS_ValueToString(cx, argv[i]);