Enable tracing for selected opcodes that do not have any remaining tracing hazards.
authorAndreas Gal <gal@uci.edu>
Mon, 26 May 2008 20:04:58 -0700
changeset 17176 bc4ea1dfdb2db4f84f18cd9e712b541cb0c0f7ac
parent 17175 1e8aed6c7201d4db8e8ff1eb332ad8654888d10d
child 17177 77e835f850beea7167ae6a665607c0991e531fd0
push idunknown
push userunknown
push dateunknown
milestone1.9.1a1pre
Enable tracing for selected opcodes that do not have any remaining tracing hazards.
js/src/jsinterp.cpp
--- a/js/src/jsinterp.cpp
+++ b/js/src/jsinterp.cpp
@@ -2947,17 +2947,17 @@ js_Interpret(JSContext *cx)
                                 DO_OP();                                      \
                             JS_END_MACRO
 
 # define BEGIN_CASE(OP)     L_##OP:                                           \
                             trace_stop(#OP);
 # define TRACE_CASE(OP)     L_##OP:
 # define END_CASE(OP)       DO_NEXT_OP(OP##_LENGTH);
 # define END_VARLEN_CASE    DO_NEXT_OP(len);
-# define ADD_EMPTY_CASE(OP) BEGIN_CASE(OP)                                    \
+# define ADD_EMPTY_CASE(OP) TRACE_CASE(OP)                                    \
                                 JS_ASSERT(js_CodeSpec[OP].length == 1);       \
                                 op = (JSOp) *++regs.pc;                       \
                                 DO_OP();
 
 # define END_EMPTY_CASES
 
 #else /* !JS_THREADED_INTERP */
 
@@ -3205,28 +3205,28 @@ js_Interpret(JSContext *cx)
           ADD_EMPTY_CASE(JSOP_FINALLY)
 #if JS_HAS_XML_SUPPORT
           ADD_EMPTY_CASE(JSOP_STARTXML)
           ADD_EMPTY_CASE(JSOP_STARTXMLEXPR)
 #endif
           END_EMPTY_CASES
 
           /* ADD_EMPTY_CASE is not used here as JSOP_LINENO_LENGTH == 3. */
-          BEGIN_CASE(JSOP_LINENO)
+          TRACE_CASE(JSOP_LINENO)
           END_CASE(JSOP_LINENO)
 
-          BEGIN_CASE(JSOP_PUSH)
+          TRACE_CASE(JSOP_PUSH)
             PUSH_STACK_CONSTANT(JSVAL_VOID);
           END_CASE(JSOP_PUSH)
 
-          BEGIN_CASE(JSOP_POP)
+          TRACE_CASE(JSOP_POP)
             ADJUST_STACK(-1);
           END_CASE(JSOP_POP)
 
-          BEGIN_CASE(JSOP_POPN)
+          TRACE_CASE(JSOP_POPN)
             ADJUST_STACK(-(int)GET_UINT16(regs.pc));
 #ifdef DEBUG
             JS_ASSERT(fp->spbase <= regs.sp);
             obj = fp->blockChain;
             JS_ASSERT_IF(obj,
                          OBJ_BLOCK_DEPTH(cx, obj) + OBJ_BLOCK_COUNT(cx, obj)
                          <= (size_t) (regs.sp - fp->spbase));
             for (obj = fp->scopeChain; obj; obj = OBJ_GET_PARENT(cx, obj)) {
@@ -3363,20 +3363,20 @@ js_Interpret(JSContext *cx)
                     JS_ASSERT(js_CodeSpec[*regs.pc].length == JSOP_CALL_LENGTH);
                     len = JSOP_CALL_LENGTH;
                     DO_NEXT_OP(len);
                 }
                 goto error;
             }
             goto exit;
 
-          BEGIN_CASE(JSOP_DEFAULT)
+          TRACE_CASE(JSOP_DEFAULT)
             ADJUST_STACK(-1);
             /* FALL THROUGH */
-          BEGIN_CASE(JSOP_GOTO)
+          TRACE_CASE(JSOP_GOTO)
             len = GET_JUMP_OFFSET(regs.pc);
             CHECK_BRANCH(len);
           END_VARLEN_CASE
 
           BEGIN_CASE(JSOP_IFEQ)
             POP_BOOLEAN(cx, rval, cond);
             if (cond == JS_FALSE) {
                 len = GET_JUMP_OFFSET(regs.pc);
@@ -3637,23 +3637,23 @@ js_Interpret(JSContext *cx)
             rval = JSVAL_TRUE;
 
           end_forinloop:
             ADJUST_STACK(i + 1);
             PUSH_STACK(rval);
             len = js_CodeSpec[op].length;
             DO_NEXT_OP(len);
 
-          BEGIN_CASE(JSOP_DUP)
+          TRACE_CASE(JSOP_DUP)
             JS_ASSERT(regs.sp > fp->spbase);
             FETCH_STACK(-1, rval);
             PUSH_STACK(rval);
           END_CASE(JSOP_DUP)
 
-          BEGIN_CASE(JSOP_DUP2)
+          TRACE_CASE(JSOP_DUP2)
             JS_ASSERT(regs.sp - 2 >= fp->spbase);
             FETCH_STACK(-2, lval);
             FETCH_STACK(-1, rval);
             PUSH_STACK(lval);
             PUSH_STACK(rval);
           END_CASE(JSOP_DUP2)
 
 #define PROPERTY_OP(n, call)                                                  \
@@ -3816,25 +3816,25 @@ js_Interpret(JSContext *cx)
     JS_BEGIN_MACRO                                                            \
         FETCH_INT(cx, -2, i);                                                 \
         FETCH_INT(cx, -1, j);                                                 \
         prim_##OP(i, j, i);                                                   \
         ADJUST_STACK(-1);                                                     \
         STORE_INT(cx, -1, i);                                                 \
     JS_END_MACRO
 
-          BEGIN_CASE(JSOP_BITOR)
+          TRACE_CASE(JSOP_BITOR)
             BITWISE_OP(ior);
           END_CASE(JSOP_BITOR)
 
-          BEGIN_CASE(JSOP_BITXOR)
+          TRACE_CASE(JSOP_BITXOR)
             BITWISE_OP(ixor);
           END_CASE(JSOP_BITXOR)
 
-          BEGIN_CASE(JSOP_BITAND)
+          TRACE_CASE(JSOP_BITAND)
             BITWISE_OP(iand);
           END_CASE(JSOP_BITAND)
 
 #define RELATIONAL_OP(OP)                                                     \
     JS_BEGIN_MACRO                                                            \
         FETCH_STACK(-1, rval);                                                \
         FETCH_STACK(-2, lval);                                                \
         /* Optimize for two int-tagged operands (typical loop control). */    \
@@ -4017,25 +4017,25 @@ js_Interpret(JSContext *cx)
     JS_BEGIN_MACRO                                                            \
         FETCH_INT(cx, -2, i);                                                 \
         FETCH_INT(cx, -1, j);                                                 \
         prim_##OP(i, j, i);                                                   \
         ADJUST_STACK(-1);                                                     \
         STORE_INT(cx, -1, i);                                                 \
     JS_END_MACRO
 
-          BEGIN_CASE(JSOP_LSH)
+          TRACE_CASE(JSOP_LSH)
             SIGNED_SHIFT_OP(ilsh);
           END_CASE(JSOP_LSH)
 
-          BEGIN_CASE(JSOP_RSH)
+          TRACE_CASE(JSOP_RSH)
             SIGNED_SHIFT_OP(irsh);
           END_CASE(JSOP_RSH)
 
-          BEGIN_CASE(JSOP_URSH)
+          TRACE_CASE(JSOP_URSH)
           {
             uint32 u;
 
             FETCH_UINT(cx, -2, u);
             FETCH_INT(cx, -1, j);
             prim_ursh(u, j, u);
             ADJUST_STACK(-1);
             STORE_UINT(cx, -1, u);
@@ -4099,32 +4099,32 @@ js_Interpret(JSContext *cx)
     JS_BEGIN_MACRO                                                            \
         FETCH_NUMBER(cx, -2, d);                                              \
         FETCH_NUMBER(cx, -1, d2);                                             \
         prim_##OP(d, d2, d);                                                  \
         ADJUST_STACK(-1);                                                     \
         STORE_NUMBER(cx, -1, d);                                              \
     JS_END_MACRO
 
-          BEGIN_CASE(JSOP_SUB)
+          TRACE_CASE(JSOP_SUB)
             BINARY_OP(dsub);
           END_CASE(JSOP_SUB)
 
-          BEGIN_CASE(JSOP_MUL)
+          TRACE_CASE(JSOP_MUL)
             BINARY_OP(dmul);
           END_CASE(JSOP_MUL)
 
-          BEGIN_CASE(JSOP_DIV)
+          TRACE_CASE(JSOP_DIV)
             FETCH_NUMBER(cx, -1, d2);
             FETCH_NUMBER(cx, -2, d);
             ADJUST_STACK(-1);
             prim_ddiv(cx, rt, regs, -1, d, d2);
           END_CASE(JSOP_DIV)
 
-          BEGIN_CASE(JSOP_MOD)
+          TRACE_CASE(JSOP_MOD)
             FETCH_NUMBER(cx, -1, d2);
             FETCH_NUMBER(cx, -2, d);
             ADJUST_STACK(-1);
             prim_dmod(cx, rt, regs, -1, d, d2);
           END_CASE(JSOP_MOD)
 
           BEGIN_CASE(JSOP_NOT)
             POP_BOOLEAN(cx, rval, cond);
@@ -5377,35 +5377,35 @@ js_Interpret(JSContext *cx)
 
           do_push_rval:
             PUSH_STACK(rval);
             if (op == JSOP_CALLNAME)
                 PUSH_STACK_OBJECT(obj);
           }
           END_CASE(JSOP_NAME)
 
-          BEGIN_CASE(JSOP_UINT16)
+          TRACE_CASE(JSOP_UINT16)
             i = (jsint) GET_UINT16(regs.pc);
             rval = INT_TO_JSVAL(i);
             PUSH_STACK_CONSTANT(rval);
           END_CASE(JSOP_UINT16)
 
-          BEGIN_CASE(JSOP_UINT24)
+          TRACE_CASE(JSOP_UINT24)
             i = (jsint) GET_UINT24(regs.pc);
             rval = INT_TO_JSVAL(i);
             PUSH_STACK_CONSTANT(rval);
           END_CASE(JSOP_UINT24)
 
-          BEGIN_CASE(JSOP_INT8)
+          TRACE_CASE(JSOP_INT8)
             i = GET_INT8(regs.pc);
             rval = INT_TO_JSVAL(i);
             PUSH_STACK_CONSTANT(rval);
           END_CASE(JSOP_INT8)
 
-          BEGIN_CASE(JSOP_INT32)
+          TRACE_CASE(JSOP_INT32)
             i = GET_INT32(regs.pc);
             rval = INT_TO_JSVAL(i);
             PUSH_STACK_CONSTANT(rval);
           END_CASE(JSOP_INT32)
 
           BEGIN_CASE(JSOP_INDEXBASE)
             /*
              * Here atoms can exceed script->atomMap.length as we use atoms
@@ -5420,23 +5420,23 @@ js_Interpret(JSContext *cx)
             atoms += (op - JSOP_INDEXBASE1 + 1) << 16;
           END_CASE(JSOP_INDEXBASE3)
 
           BEGIN_CASE(JSOP_RESETBASE0)
           BEGIN_CASE(JSOP_RESETBASE)
             atoms = script->atomMap.vector;
           END_CASE(JSOP_RESETBASE)
 
-          BEGIN_CASE(JSOP_DOUBLE)
-          BEGIN_CASE(JSOP_STRING)
+          TRACE_CASE(JSOP_DOUBLE)
+          TRACE_CASE(JSOP_STRING)
             LOAD_ATOM(0);
             PUSH_STACK_CONSTANT(ATOM_KEY(atom));
           END_CASE(JSOP_DOUBLE)
 
-          BEGIN_CASE(JSOP_OBJECT)
+          TRACE_CASE(JSOP_OBJECT)
             LOAD_OBJECT(0);
             PUSH_STACK_OBJECT(obj);
           END_CASE(JSOP_OBJECT)
 
           BEGIN_CASE(JSOP_REGEXP)
           {
             JSObject *funobj;
 
@@ -5541,33 +5541,33 @@ js_Interpret(JSContext *cx)
                     fp->vars[slot] = rval;
                 }
             }
 
             PUSH_STACK(rval);
           }
           END_CASE(JSOP_REGEXP)
 
-          BEGIN_CASE(JSOP_ZERO)
+          TRACE_CASE(JSOP_ZERO)
             PUSH_STACK_CONSTANT(JSVAL_ZERO);
           END_CASE(JSOP_ZERO)
 
-          BEGIN_CASE(JSOP_ONE)
+          TRACE_CASE(JSOP_ONE)
             PUSH_STACK_CONSTANT(JSVAL_ONE);
           END_CASE(JSOP_ONE)
 
-          BEGIN_CASE(JSOP_NULL)
+          TRACE_CASE(JSOP_NULL)
             PUSH_STACK_CONSTANT(JSVAL_NULL);
           END_CASE(JSOP_NULL)
 
-          BEGIN_CASE(JSOP_FALSE)
+          TRACE_CASE(JSOP_FALSE)
             PUSH_STACK_CONSTANT(JSVAL_FALSE);
           END_CASE(JSOP_FALSE)
 
-          BEGIN_CASE(JSOP_TRUE)
+          TRACE_CASE(JSOP_TRUE)
             PUSH_STACK_CONSTANT(JSVAL_TRUE);
           END_CASE(JSOP_TRUE)
 
           BEGIN_CASE(JSOP_TABLESWITCH)
             pc2 = regs.pc;
             len = GET_JUMP_OFFSET(pc2);
 
             /*