Bug 607856 - long hang loading page (TM-specific part). r=dvander
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 02 Nov 2010 16:28:47 -0700
changeset 57685 64e76d8afd097caf86a7c9bd3b9ffe7b3db77609
parent 57684 f70a7b95d2ea0ddf5e2a805ba0b631652f18844b
child 57686 1a6993e17a93ba5c2be3597692910bea4dc2b1f6
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersdvander
bugs607856
milestone2.0b8pre
Bug 607856 - long hang loading page (TM-specific part). r=dvander
js/src/jstracer.cpp
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -5351,19 +5351,20 @@ TraceRecorder::emitIf(jsbytecode* pc, bo
     } else {
         exitType = BRANCH_EXIT;
     }
     /*
      * Put 'x' in a form suitable for a guard/branch condition if it isn't
      * already.  This lets us detect if the comparison is optimized to 0 or 1,
      * in which case we avoid the guard() call below.
      */
-    ensureCond(&x, &cond);
-    if (!x->isImmI())
+    if (!x->isImmI()) {
+        ensureCond(&x, &cond);
         guard(cond, x, exitType);
+    }
 }
 
 /* Emit code for a fused IFEQ/IFNE. */
 JS_REQUIRES_STACK void
 TraceRecorder::fuseIf(jsbytecode* pc, bool cond, LIns* x)
 {
     if (*pc == JSOP_IFEQ || *pc == JSOP_IFNE) {
         emitIf(pc, cond, x);