Bug 910782 - SpiderMonkey: Eliminate the ADD_EMPTY_CASE macro. r=luke
authorDan Gohman <sunfish@google.com>
Mon, 02 Sep 2013 16:31:10 -0700
changeset 145250 7ce923b4b074bf3824eca0325bdd0f648e7de625
parent 145249 b2ad58e8b2481d670347ba35a66670d42d32b003
child 145251 c913196e053fd28ba36b1af1efb30908ccc17930
push id25203
push useremorley@mozilla.com
push dateTue, 03 Sep 2013 11:11:23 +0000
treeherdermozilla-central@541ba36e8b9d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs910782
milestone26.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 910782 - SpiderMonkey: Eliminate the ADD_EMPTY_CASE macro. r=luke
js/src/vm/Interpreter.cpp
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -1278,17 +1278,16 @@ Interpret(JSContext *cx, RunState &state
     int switchOp;
 
 # define DO_OP()            goto do_op
 
 # define BEGIN_CASE(OP)     case OP:
 # define END_CASE(OP)       len = OP##_LENGTH; goto advanceAndDoOp;
 
 # define END_VARLEN_CASE    goto advanceAndDoOp;
-# define ADD_EMPTY_CASE(OP) BEGIN_CASE(OP)
 
 #define LOAD_DOUBLE(PCOFF, dbl)                                               \
     (dbl = script->getConst(GET_UINT32_INDEX(regs.pc + (PCOFF))).toDouble())
 
     /*
      * Prepare to call a user-supplied branch handler, and abort the script
      * if it returns false.
      */
@@ -1489,60 +1488,60 @@ Interpret(JSContext *cx, RunState &state
             JS_ASSERT(rval.isInt32() && rval.toInt32() == op);
         }
 
         switchMask = moreInterrupts ? -1 : 0;
         switchOp = int(op);
         goto do_switch;
     }
 
-/* No-ops for ease of decompilation. */
-ADD_EMPTY_CASE(JSOP_NOP)
-ADD_EMPTY_CASE(JSOP_UNUSED125)
-ADD_EMPTY_CASE(JSOP_UNUSED126)
-ADD_EMPTY_CASE(JSOP_UNUSED132)
-ADD_EMPTY_CASE(JSOP_UNUSED148)
-ADD_EMPTY_CASE(JSOP_UNUSED161)
-ADD_EMPTY_CASE(JSOP_UNUSED162)
-ADD_EMPTY_CASE(JSOP_UNUSED163)
-ADD_EMPTY_CASE(JSOP_UNUSED164)
-ADD_EMPTY_CASE(JSOP_UNUSED165)
-ADD_EMPTY_CASE(JSOP_UNUSED166)
-ADD_EMPTY_CASE(JSOP_UNUSED167)
-ADD_EMPTY_CASE(JSOP_UNUSED168)
-ADD_EMPTY_CASE(JSOP_UNUSED169)
-ADD_EMPTY_CASE(JSOP_UNUSED170)
-ADD_EMPTY_CASE(JSOP_UNUSED171)
-ADD_EMPTY_CASE(JSOP_UNUSED172)
-ADD_EMPTY_CASE(JSOP_UNUSED173)
-ADD_EMPTY_CASE(JSOP_UNUSED174)
-ADD_EMPTY_CASE(JSOP_UNUSED175)
-ADD_EMPTY_CASE(JSOP_UNUSED176)
-ADD_EMPTY_CASE(JSOP_UNUSED177)
-ADD_EMPTY_CASE(JSOP_UNUSED178)
-ADD_EMPTY_CASE(JSOP_UNUSED179)
-ADD_EMPTY_CASE(JSOP_UNUSED180)
-ADD_EMPTY_CASE(JSOP_UNUSED181)
-ADD_EMPTY_CASE(JSOP_UNUSED182)
-ADD_EMPTY_CASE(JSOP_UNUSED183)
-ADD_EMPTY_CASE(JSOP_UNUSED188)
-ADD_EMPTY_CASE(JSOP_UNUSED189)
-ADD_EMPTY_CASE(JSOP_UNUSED190)
-ADD_EMPTY_CASE(JSOP_UNUSED200)
-ADD_EMPTY_CASE(JSOP_UNUSED201)
-ADD_EMPTY_CASE(JSOP_UNUSED208)
-ADD_EMPTY_CASE(JSOP_UNUSED209)
-ADD_EMPTY_CASE(JSOP_UNUSED210)
-ADD_EMPTY_CASE(JSOP_UNUSED219)
-ADD_EMPTY_CASE(JSOP_UNUSED220)
-ADD_EMPTY_CASE(JSOP_UNUSED221)
-ADD_EMPTY_CASE(JSOP_UNUSED222)
-ADD_EMPTY_CASE(JSOP_UNUSED223)
-ADD_EMPTY_CASE(JSOP_CONDSWITCH)
-ADD_EMPTY_CASE(JSOP_TRY)
+/* Various 1-byte no-ops. */
+BEGIN_CASE(JSOP_NOP)
+BEGIN_CASE(JSOP_UNUSED125)
+BEGIN_CASE(JSOP_UNUSED126)
+BEGIN_CASE(JSOP_UNUSED132)
+BEGIN_CASE(JSOP_UNUSED148)
+BEGIN_CASE(JSOP_UNUSED161)
+BEGIN_CASE(JSOP_UNUSED162)
+BEGIN_CASE(JSOP_UNUSED163)
+BEGIN_CASE(JSOP_UNUSED164)
+BEGIN_CASE(JSOP_UNUSED165)
+BEGIN_CASE(JSOP_UNUSED166)
+BEGIN_CASE(JSOP_UNUSED167)
+BEGIN_CASE(JSOP_UNUSED168)
+BEGIN_CASE(JSOP_UNUSED169)
+BEGIN_CASE(JSOP_UNUSED170)
+BEGIN_CASE(JSOP_UNUSED171)
+BEGIN_CASE(JSOP_UNUSED172)
+BEGIN_CASE(JSOP_UNUSED173)
+BEGIN_CASE(JSOP_UNUSED174)
+BEGIN_CASE(JSOP_UNUSED175)
+BEGIN_CASE(JSOP_UNUSED176)
+BEGIN_CASE(JSOP_UNUSED177)
+BEGIN_CASE(JSOP_UNUSED178)
+BEGIN_CASE(JSOP_UNUSED179)
+BEGIN_CASE(JSOP_UNUSED180)
+BEGIN_CASE(JSOP_UNUSED181)
+BEGIN_CASE(JSOP_UNUSED182)
+BEGIN_CASE(JSOP_UNUSED183)
+BEGIN_CASE(JSOP_UNUSED188)
+BEGIN_CASE(JSOP_UNUSED189)
+BEGIN_CASE(JSOP_UNUSED190)
+BEGIN_CASE(JSOP_UNUSED200)
+BEGIN_CASE(JSOP_UNUSED201)
+BEGIN_CASE(JSOP_UNUSED208)
+BEGIN_CASE(JSOP_UNUSED209)
+BEGIN_CASE(JSOP_UNUSED210)
+BEGIN_CASE(JSOP_UNUSED219)
+BEGIN_CASE(JSOP_UNUSED220)
+BEGIN_CASE(JSOP_UNUSED221)
+BEGIN_CASE(JSOP_UNUSED222)
+BEGIN_CASE(JSOP_UNUSED223)
+BEGIN_CASE(JSOP_CONDSWITCH)
+BEGIN_CASE(JSOP_TRY)
 {
     JS_ASSERT(js_CodeSpec[op].length == 1);
     len = 1;
     goto advanceAndDoOp;
 }
 
 BEGIN_CASE(JSOP_LOOPHEAD)
 END_CASE(JSOP_LOOPHEAD)
@@ -1580,17 +1579,16 @@ BEGIN_CASE(JSOP_LOOPENTRY)
     }
 #endif /* JS_ION */
 
 END_CASE(JSOP_LOOPENTRY)
 
 BEGIN_CASE(JSOP_NOTEARG)
 END_CASE(JSOP_NOTEARG)
 
-/* ADD_EMPTY_CASE is not used here as JSOP_LINENO_LENGTH == 3. */
 BEGIN_CASE(JSOP_LINENO)
 END_CASE(JSOP_LINENO)
 
 BEGIN_CASE(JSOP_UNDEFINED)
     PUSH_UNDEFINED();
 END_CASE(JSOP_UNDEFINED)
 
 BEGIN_CASE(JSOP_POP)