Bug 1508106 - Add {} to non-empty CASE/END_CASE blocks in Interpreter.cpp that don't have them yet to make clang-format work better. r=tcampbell
authorJan de Mooij <jdemooij@mozilla.com>
Wed, 21 Nov 2018 16:30:20 +0000
changeset 503931 0833d96f563a736de407f4960643c367611f41b8
parent 503930 78665669badebd0088569691b6c7df09e2286d84
child 503932 34fe058fcd5c6e50c4fce7c7b46b12411d0d8982
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcampbell
bugs1508106
milestone65.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 1508106 - Add {} to non-empty CASE/END_CASE blocks in Interpreter.cpp that don't have them yet to make clang-format work better. r=tcampbell Differential Revision: https://phabricator.services.mozilla.com/D12533
js/src/vm/Interpreter.cpp
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -2316,16 +2316,17 @@ CASE(JSOP_LOOPHEAD)
     COUNT_COVERAGE();
     ADVANCE_AND_DISPATCH(1);
 }
 
 CASE(JSOP_LABEL)
 END_CASE(JSOP_LABEL)
 
 CASE(JSOP_LOOPENTRY)
+{
     COUNT_COVERAGE();
     // Attempt on-stack replacement with Baseline code.
     if (jit::IsBaselineEnabled(cx)) {
         jit::MethodStatus status = jit::CanEnterBaselineAtBranch(cx, REGS.fp());
         if (status == jit::Method_Error) {
             goto error;
         }
         if (status == jit::Method_Compiled) {
@@ -2355,75 +2356,90 @@ CASE(JSOP_LOOPENTRY)
                 goto jit_return_pop_frame;
             }
             goto leave_on_safe_point;
         }
     }
     if (script->trackRecordReplayProgress()) {
         mozilla::recordreplay::AdvanceExecutionProgressCounter();
     }
+}
 END_CASE(JSOP_LOOPENTRY)
 
 CASE(JSOP_LINENO)
 END_CASE(JSOP_LINENO)
 
 CASE(JSOP_FORCEINTERPRETER)
 END_CASE(JSOP_FORCEINTERPRETER)
 
 CASE(JSOP_UNDEFINED)
+{
     // If this ever changes, change what JSOP_GIMPLICITTHIS does too.
     PUSH_UNDEFINED();
+}
 END_CASE(JSOP_UNDEFINED)
 
 CASE(JSOP_POP)
+{
     REGS.sp--;
+}
 END_CASE(JSOP_POP)
 
 CASE(JSOP_POPN)
+{
     MOZ_ASSERT(GET_UINT16(REGS.pc) <= REGS.stackDepth());
     REGS.sp -= GET_UINT16(REGS.pc);
+
+}
 END_CASE(JSOP_POPN)
 
 CASE(JSOP_DUPAT)
 {
     MOZ_ASSERT(GET_UINT24(REGS.pc) < REGS.stackDepth());
     unsigned i = GET_UINT24(REGS.pc);
     const Value& rref = REGS.sp[-int(i + 1)];
     PUSH_COPY(rref);
 }
 END_CASE(JSOP_DUPAT)
 
 CASE(JSOP_SETRVAL)
+{
     POP_RETURN_VALUE();
+}
 END_CASE(JSOP_SETRVAL)
 
 CASE(JSOP_GETRVAL)
+{
     PUSH_COPY(REGS.fp()->returnValue());
+}
 END_CASE(JSOP_GETRVAL)
 
 CASE(JSOP_ENTERWITH)
 {
     ReservedRooted<Value> val(&rootValue0, REGS.sp[-1]);
     REGS.sp--;
     ReservedRooted<Scope*> scope(&rootScope0, script->getScope(REGS.pc));
 
     if (!EnterWithOperation(cx, REGS.fp(), val, scope.as<WithScope>())) {
         goto error;
     }
 }
 END_CASE(JSOP_ENTERWITH)
 
 CASE(JSOP_LEAVEWITH)
+{
     REGS.fp()->popOffEnvironmentChain<WithEnvironmentObject>();
+}
 END_CASE(JSOP_LEAVEWITH)
 
 CASE(JSOP_RETURN)
+{
     POP_RETURN_VALUE();
     /* FALL THROUGH */
-
+}
 CASE(JSOP_RETRVAL)
 {
     /*
      * When the inlined frame exits with an exception or an error, ok will be
      * false after the inline_return label.
      */
     CHECK_BRANCH();
 
@@ -2473,18 +2489,20 @@ CASE(JSOP_RETRVAL)
         goto error;
     } else {
         MOZ_ASSERT(REGS.stackDepth() == 0);
     }
     goto exit;
 }
 
 CASE(JSOP_DEFAULT)
+{
     REGS.sp--;
     /* FALL THROUGH */
+}
 CASE(JSOP_GOTO)
 {
     BRANCH(GET_JUMP_OFFSET(REGS.pc));
 }
 
 CASE(JSOP_IFEQ)
 {
     bool cond = ToBoolean(REGS.stackHandleAt(-1));
@@ -2745,25 +2763,29 @@ CASE(JSOP_BITAND)
     if (!BitAnd(cx, lhs, rhs, res)) {
         goto error;
     }
     REGS.sp--;
 }
 END_CASE(JSOP_BITAND)
 
 CASE(JSOP_EQ)
+{
     if (!LooseEqualityOp<true>(cx, REGS)) {
         goto error;
     }
+}
 END_CASE(JSOP_EQ)
 
 CASE(JSOP_NE)
+{
     if (!LooseEqualityOp<false>(cx, REGS)) {
         goto error;
     }
+}
 END_CASE(JSOP_NE)
 
 #define STRICT_EQUALITY_OP(OP, COND)                                          \
     JS_BEGIN_MACRO                                                            \
         HandleValue lval = REGS.stackHandleAt(-2);                            \
         HandleValue rval = REGS.stackHandleAt(-1);                            \
         bool equal;                                                           \
         if (!StrictlyEqual(cx, lval, rval, &equal))                           \
@@ -2989,19 +3011,21 @@ CASE(JSOP_NEG)
     MutableHandleValue res = REGS.stackHandleAt(-1);
     if (!NegOperation(cx, &val, res)) {
         goto error;
     }
 }
 END_CASE(JSOP_NEG)
 
 CASE(JSOP_POS)
+{
     if (!ToNumber(cx, REGS.stackHandleAt(-1))) {
         goto error;
     }
+}
 END_CASE(JSOP_POS)
 
 CASE(JSOP_DELNAME)
 {
     ReservedRooted<PropertyName*> name(&rootName0, script->getName(REGS.pc));
     ReservedRooted<JSObject*> envObj(&rootObject0, REGS.fp()->environmentChain());
 
     PUSH_BOOLEAN(true);
@@ -3081,24 +3105,28 @@ END_CASE(JSOP_TOID)
 CASE(JSOP_TYPEOFEXPR)
 CASE(JSOP_TYPEOF)
 {
     REGS.sp[-1].setString(TypeOfOperation(REGS.sp[-1], cx->runtime()));
 }
 END_CASE(JSOP_TYPEOF)
 
 CASE(JSOP_VOID)
+{
     REGS.sp[-1].setUndefined();
+}
 END_CASE(JSOP_VOID)
 
 CASE(JSOP_FUNCTIONTHIS)
+{
     PUSH_NULL();
     if (!GetFunctionThis(cx, REGS.fp(), REGS.stackHandleAt(-1))) {
         goto error;
     }
+}
 END_CASE(JSOP_FUNCTIONTHIS)
 
 CASE(JSOP_GLOBALTHIS)
 {
     if (script->hasNonSyntacticScope()) {
         PUSH_NULL();
         GetNonSyntacticGlobalThis(cx, REGS.fp()->environmentChain(), REGS.stackHandleAt(-1));
     } else {
@@ -3376,20 +3404,22 @@ CASE(JSOP_STRICTEVAL)
     REGS.sp = args.spAfterCall();
     TypeScript::Monitor(cx, script, REGS.pc, REGS.sp[-1]);
 }
 END_CASE(JSOP_EVAL)
 
 CASE(JSOP_SPREADNEW)
 CASE(JSOP_SPREADCALL)
 CASE(JSOP_SPREADSUPERCALL)
+{
     if (REGS.fp()->hasPushedGeckoProfilerFrame()) {
         cx->geckoProfiler().updatePC(cx, script, REGS.pc);
     }
     /* FALL THROUGH */
+}
 
 CASE(JSOP_SPREADEVAL)
 CASE(JSOP_STRICTSPREADEVAL)
 {
     static_assert(JSOP_SPREADEVAL_LENGTH == JSOP_STRICTSPREADEVAL_LENGTH,
                   "spreadeval and strictspreadeval must be the same size");
     bool construct = JSOp(*REGS.pc) == JSOP_SPREADNEW || JSOp(*REGS.pc) == JSOP_SPREADSUPERCALL;;
 
@@ -3639,42 +3669,52 @@ CASE(JSOP_GETINTRINSIC)
     }
 
     PUSH_COPY(rval);
     TypeScript::Monitor(cx, script, REGS.pc, rval);
 }
 END_CASE(JSOP_GETINTRINSIC)
 
 CASE(JSOP_UINT16)
+{
     PUSH_INT32((int32_t) GET_UINT16(REGS.pc));
+}
 END_CASE(JSOP_UINT16)
 
 CASE(JSOP_UINT24)
 CASE(JSOP_RESUMEINDEX)
+{
     PUSH_INT32((int32_t) GET_UINT24(REGS.pc));
+}
 END_CASE(JSOP_UINT24)
 
 CASE(JSOP_INT8)
+{
     PUSH_INT32(GET_INT8(REGS.pc));
+}
 END_CASE(JSOP_INT8)
 
 CASE(JSOP_INT32)
+{
     PUSH_INT32(GET_INT32(REGS.pc));
+}
 END_CASE(JSOP_INT32)
 
 CASE(JSOP_DOUBLE)
 {
     double dbl;
     LOAD_DOUBLE(0, dbl);
     PUSH_DOUBLE(dbl);
 }
 END_CASE(JSOP_DOUBLE)
 
 CASE(JSOP_STRING)
+{
     PUSH_STRING(script->getAtom(REGS.pc));
+}
 END_CASE(JSOP_STRING)
 
 CASE(JSOP_TOSTRING)
 {
     MutableHandleValue oper = REGS.stackHandleAt(-1);
 
     if (!oper.isString()) {
         JSString* operString = ToString<CanGC>(cx, oper);
@@ -3682,17 +3722,19 @@ CASE(JSOP_TOSTRING)
             goto error;
         }
         oper.setString(operString);
     }
 }
 END_CASE(JSOP_TOSTRING)
 
 CASE(JSOP_SYMBOL)
+{
     PUSH_SYMBOL(cx->wellKnownSymbols().get(GET_UINT8(REGS.pc)));
+}
 END_CASE(JSOP_SYMBOL)
 
 CASE(JSOP_OBJECT)
 {
     ReservedRooted<JSObject*> ref(&rootObject0, script->getObject(REGS.pc));
     if (cx->realm()->creationOptions().cloneSingletons()) {
         JSObject* obj = DeepCloneObjectLiteral(cx, ref, TenuredObject);
         if (!obj) {
@@ -3730,33 +3772,43 @@ CASE(JSOP_REGEXP)
     if (!obj) {
         goto error;
     }
     PUSH_OBJECT(*obj);
 }
 END_CASE(JSOP_REGEXP)
 
 CASE(JSOP_ZERO)
+{
     PUSH_INT32(0);
+}
 END_CASE(JSOP_ZERO)
 
 CASE(JSOP_ONE)
+{
     PUSH_INT32(1);
+}
 END_CASE(JSOP_ONE)
 
 CASE(JSOP_NULL)
+{
     PUSH_NULL();
+}
 END_CASE(JSOP_NULL)
 
 CASE(JSOP_FALSE)
+{
     PUSH_BOOLEAN(false);
+}
 END_CASE(JSOP_FALSE)
 
 CASE(JSOP_TRUE)
+{
     PUSH_BOOLEAN(true);
+}
 END_CASE(JSOP_TRUE)
 
 CASE(JSOP_TABLESWITCH)
 {
     jsbytecode* pc2 = REGS.pc;
     int32_t len = GET_JUMP_OFFSET(pc2);
 
     /*
@@ -3783,28 +3835,30 @@ CASE(JSOP_TABLESWITCH)
     i = uint32_t(i) - uint32_t(low);
     if (uint32_t(i) < uint32_t(high - low + 1)) {
         len = script->tableSwitchCaseOffset(REGS.pc, uint32_t(i)) - script->pcToOffset(REGS.pc);
     }
     ADVANCE_AND_DISPATCH(len);
 }
 
 CASE(JSOP_ARGUMENTS)
+{
     if (!script->ensureHasAnalyzedArgsUsage(cx)) {
         goto error;
     }
     if (script->needsArgsObj()) {
         ArgumentsObject* obj = ArgumentsObject::createExpected(cx, REGS.fp());
         if (!obj) {
             goto error;
         }
         PUSH_COPY(ObjectValue(*obj));
     } else {
         PUSH_COPY(MagicValue(JS_OPTIMIZED_ARGUMENTS));
     }
+}
 END_CASE(JSOP_ARGUMENTS)
 
 CASE(JSOP_RUNONCE)
 {
     if (!RunOnceScriptPrologue(cx, script)) {
         goto error;
     }
 }
@@ -3900,17 +3954,19 @@ CASE(JSOP_INITGLEXICAL)
         lexicalEnv = &cx->global()->lexicalEnvironment();
     }
     HandleValue value = REGS.stackHandleAt(-1);
     InitGlobalLexicalOperation(cx, lexicalEnv, script, REGS.pc, value);
 }
 END_CASE(JSOP_INITGLEXICAL)
 
 CASE(JSOP_UNINITIALIZED)
+{
     PUSH_MAGIC(JS_UNINITIALIZED_LEXICAL);
+}
 END_CASE(JSOP_UNINITIALIZED)
 
 CASE(JSOP_GETARG)
 {
     unsigned i = GET_ARGNO(REGS.pc);
     if (script->argsObjAliasesFormals()) {
         PUSH_COPY(REGS.fp()->argsObj().arg(i));
     } else {
@@ -4117,18 +4173,20 @@ CASE(JSOP_SETFUNNAME)
         goto error;
     }
 
     REGS.sp--;
 }
 END_CASE(JSOP_SETFUNNAME)
 
 CASE(JSOP_CALLEE)
+{
     MOZ_ASSERT(REGS.fp()->isFunctionFrame());
     PUSH_COPY(REGS.fp()->calleev());
+}
 END_CASE(JSOP_CALLEE)
 
 CASE(JSOP_INITPROP_GETTER)
 CASE(JSOP_INITHIDDENPROP_GETTER)
 CASE(JSOP_INITPROP_SETTER)
 CASE(JSOP_INITHIDDENPROP_SETTER)
 {
     MOZ_ASSERT(REGS.stackDepth() >= 2);
@@ -4160,17 +4218,19 @@ CASE(JSOP_INITHIDDENELEM_SETTER)
         goto error;
     }
 
     REGS.sp -= 2;
 }
 END_CASE(JSOP_INITELEM_GETTER)
 
 CASE(JSOP_HOLE)
+{
     PUSH_MAGIC(JS_ELEMENTS_HOLE);
+}
 END_CASE(JSOP_HOLE)
 
 CASE(JSOP_NEWINIT)
 {
     JSObject* obj = NewObjectOperation(cx, script, REGS.pc);
 
     if (!obj) {
         goto error;
@@ -4347,17 +4407,19 @@ CASE(JSOP_EXCEPTION)
     MutableHandleValue res = REGS.stackHandleAt(-1);
     if (!GetAndClearException(cx, res)) {
         goto error;
     }
 }
 END_CASE(JSOP_EXCEPTION)
 
 CASE(JSOP_FINALLY)
+{
     CHECK_BRANCH();
+}
 END_CASE(JSOP_FINALLY)
 
 CASE(JSOP_THROW)
 {
     CHECK_BRANCH();
     ReservedRooted<Value> v(&rootValue0);
     POP_COPY_TO(v);
     MOZ_ALWAYS_FALSE(Throw(cx, v));
@@ -4692,18 +4754,20 @@ CASE(JSOP_SUPERBASE)
         goto error;
     }
 
     PUSH_OBJECT(*superBase);
 }
 END_CASE(JSOP_SUPERBASE)
 
 CASE(JSOP_NEWTARGET)
+{
     PUSH_COPY(REGS.fp()->newTarget());
     MOZ_ASSERT(REGS.sp[-1].isObject() || REGS.sp[-1].isUndefined());
+}
 END_CASE(JSOP_NEWTARGET)
 
 CASE(JSOP_IMPORTMETA)
 {
     ReservedRooted<JSObject*> module(&rootObject0, GetModuleObjectForScript(script));
     MOZ_ASSERT(module);
 
     JSObject* metaObject = GetOrCreateModuleMetaObject(cx, module);
@@ -4784,17 +4848,19 @@ CASE(JSOP_DEBUGCHECKSELFHOSTED)
     if (!Debug_CheckSelfHosted(cx, checkVal)) {
         goto error;
     }
 #endif
 }
 END_CASE(JSOP_DEBUGCHECKSELFHOSTED)
 
 CASE(JSOP_IS_CONSTRUCTING)
+{
     PUSH_MAGIC(JS_IS_CONSTRUCTING);
+}
 END_CASE(JSOP_IS_CONSTRUCTING)
 
 #ifdef ENABLE_BIGINT
 CASE(JSOP_BIGINT)
 {
     PUSH_COPY(script->getConst(GET_UINT32_INDEX(REGS.pc)));
     MOZ_ASSERT(REGS.sp[-1].isBigInt());
 }