diff --git a/js/src/frontend/TokenStream.cpp b/js/src/frontend/TokenStream.cpp index 6b277901e561..1177b781c84a 100644 --- a/js/src/frontend/TokenStream.cpp +++ b/js/src/frontend/TokenStream.cpp @@ -368,7 +368,7 @@ int32_t TokenStream::getChar() { int32_t c; - if (JS_LIKELY(userbuf.hasRawChars())) { + if (MOZ_LIKELY(userbuf.hasRawChars())) { c = userbuf.getRawChar(); // Normalize the jschar if it was a newline. We need to detect any of @@ -415,7 +415,7 @@ TokenStream::getChar() int32_t TokenStream::getCharIgnoreEOL() { - if (JS_LIKELY(userbuf.hasRawChars())) + if (MOZ_LIKELY(userbuf.hasRawChars())) return userbuf.getRawChar(); flags.isEOF = true; diff --git a/js/src/frontend/TokenStream.h b/js/src/frontend/TokenStream.h index 2b0736a1713d..69a5571d75f2 100644 --- a/js/src/frontend/TokenStream.h +++ b/js/src/frontend/TokenStream.h @@ -854,7 +854,7 @@ class MOZ_STACK_CLASS TokenStream // |expect| cannot be an EOL char. bool matchChar(int32_t expect) { MOZ_ASSERT(!TokenBuf::isRawEOLChar(expect)); - return JS_LIKELY(userbuf.hasRawChars()) && + return MOZ_LIKELY(userbuf.hasRawChars()) && userbuf.matchRawChar(expect); } diff --git a/js/src/gc/Heap.h b/js/src/gc/Heap.h index 53ccd0202381..b9b83c1f51e9 100644 --- a/js/src/gc/Heap.h +++ b/js/src/gc/Heap.h @@ -276,9 +276,9 @@ struct FreeSpan if (thing < last) { /* Bump-allocate from the current span. */ first = thing + thingSize; - } else if (JS_LIKELY(thing == last)) { + } else if (MOZ_LIKELY(thing == last)) { /* - * Move to the next span. We use JS_LIKELY as without PGO + * Move to the next span. We use MOZ_LIKELY as without PGO * compilers mis-predict == here as unlikely to succeed. */ *this = *reinterpret_cast(thing); diff --git a/js/src/jit/VMFunctions.cpp b/js/src/jit/VMFunctions.cpp index 5c1363af5ef0..00685d7e928b 100644 --- a/js/src/jit/VMFunctions.cpp +++ b/js/src/jit/VMFunctions.cpp @@ -456,7 +456,7 @@ SetProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, HandleValu return true; } - if (JS_LIKELY(!obj->getOps()->setProperty)) { + if (MOZ_LIKELY(!obj->getOps()->setProperty)) { unsigned defineHow = (op == JSOP_SETNAME || op == JSOP_SETGNAME) ? DNP_UNQUALIFIED : 0; return baseops::SetPropertyHelper(cx, obj, obj, id, defineHow, &v, strict); diff --git a/js/src/jsatominlines.h b/js/src/jsatominlines.h index 7c7723477b3e..a39fc8212585 100644 --- a/js/src/jsatominlines.h +++ b/js/src/jsatominlines.h @@ -125,7 +125,7 @@ IdToString(JSContext *cx, jsid id) if (JSID_IS_STRING(id)) return JSID_TO_ATOM(id); - if (JS_LIKELY(JSID_IS_INT(id))) + if (MOZ_LIKELY(JSID_IS_INT(id))) return Int32ToString(cx, JSID_TO_INT(id)); RootedValue idv(cx, IdToValue(id)); diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h index 274c71f16e14..7b99caf65b1a 100644 --- a/js/src/jsfriendapi.h +++ b/js/src/jsfriendapi.h @@ -1754,9 +1754,9 @@ IdToValue(jsid id) { if (JSID_IS_STRING(id)) return JS::StringValue(JSID_TO_STRING(id)); - if (JS_LIKELY(JSID_IS_INT(id))) + if (MOZ_LIKELY(JSID_IS_INT(id))) return JS::Int32Value(JSID_TO_INT(id)); - if (JS_LIKELY(JSID_IS_OBJECT(id))) + if (MOZ_LIKELY(JSID_IS_OBJECT(id))) return JS::ObjectValue(*JSID_TO_OBJECT(id)); JS_ASSERT(JSID_IS_VOID(id)); return JS::UndefinedValue(); diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index 49685e0b6dda..1b10205f9602 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -912,7 +912,7 @@ Chunk::allocateArena(Zone *zone, AllocKind thingKind) if (!rt->isHeapMinorCollecting() && rt->gcBytes >= rt->gcMaxBytes) return nullptr; - ArenaHeader *aheader = JS_LIKELY(info.numArenasFreeCommitted > 0) + ArenaHeader *aheader = MOZ_LIKELY(info.numArenasFreeCommitted > 0) ? fetchNextFreeArena(rt) : fetchNextDecommittedArena(); aheader->init(zone, thingKind); @@ -1694,7 +1694,7 @@ ArenaLists::refillFreeList(ThreadSafeContext *cx, AllocKind thingKind) */ for (bool secondAttempt = false; ; secondAttempt = true) { void *thing = cx->allocator()->arenas.allocateFromArenaInline(zone, thingKind); - if (JS_LIKELY(!!thing)) + if (MOZ_LIKELY(!!thing)) return thing; if (secondAttempt) break; diff --git a/js/src/jsgcinlines.h b/js/src/jsgcinlines.h index 7121e275c9d3..b35b5075ade3 100644 --- a/js/src/jsgcinlines.h +++ b/js/src/jsgcinlines.h @@ -220,7 +220,7 @@ class CellIterImpl for (;;) { if (thing != span->first) break; - if (JS_LIKELY(span->hasNext())) { + if (MOZ_LIKELY(span->hasNext())) { thing = span->last + thingSize; span = span->nextSpan(); break; diff --git a/js/src/jsiter.cpp b/js/src/jsiter.cpp index b6ad2f62f348..1930a8cb6b84 100644 --- a/js/src/jsiter.cpp +++ b/js/src/jsiter.cpp @@ -669,13 +669,13 @@ js::GetIterator(JSContext *cx, HandleObject obj, unsigned flags, MutableHandleVa AutoIdVector keys(cx); if (flags & JSITER_FOREACH) { - if (JS_LIKELY(obj != nullptr) && !Snapshot(cx, obj, flags, &keys)) + if (MOZ_LIKELY(obj != nullptr) && !Snapshot(cx, obj, flags, &keys)) return false; JS_ASSERT(shapes.empty()); if (!VectorToValueIterator(cx, obj, flags, keys, vp)) return false; } else { - if (JS_LIKELY(obj != nullptr) && !Snapshot(cx, obj, flags, &keys)) + if (MOZ_LIKELY(obj != nullptr) && !Snapshot(cx, obj, flags, &keys)) return false; if (!VectorToKeyIterator(cx, obj, flags, keys, shapes.length(), key, vp)) return false; diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp index a7efd9d86b9e..666c40dab575 100644 --- a/js/src/jsobj.cpp +++ b/js/src/jsobj.cpp @@ -4413,7 +4413,7 @@ js::NativeSet(typename ExecutionModeTraits::ContextType cxArg, * unless the setter deleted the shape. */ if (shape->hasSlot() && - (JS_LIKELY(cx->runtime()->propertyRemovals == sample) || + (MOZ_LIKELY(cx->runtime()->propertyRemovals == sample) || obj->nativeContains(cx, shape))) { obj->setSlot(shape->slot(), vp); diff --git a/js/src/vm/Interpreter.cpp b/js/src/vm/Interpreter.cpp index e4113001fca3..4260d0d9ad0a 100644 --- a/js/src/vm/Interpreter.cpp +++ b/js/src/vm/Interpreter.cpp @@ -329,7 +329,7 @@ SetPropertyOperation(JSContext *cx, HandleScript script, jsbytecode *pc, HandleV RootedValue rref(cx, rval); RootedId id(cx, NameToId(script->getName(pc))); - if (JS_LIKELY(!obj->getOps()->setProperty)) { + if (MOZ_LIKELY(!obj->getOps()->setProperty)) { if (!baseops::SetPropertyHelper(cx, obj, obj, id, 0, &rref, script->strict())) { @@ -1192,7 +1192,7 @@ AddOperation(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, Valu if (lhs.isInt32() && rhs.isInt32()) { int32_t l = lhs.toInt32(), r = rhs.toInt32(); int32_t t; - if (JS_LIKELY(SafeAdd(l, r, &t))) { + if (MOZ_LIKELY(SafeAdd(l, r, &t))) { res->setInt32(t); return true; } @@ -1820,7 +1820,7 @@ CASE(JSOP_RETRVAL) JS_ASSERT(js_CodeSpec[*REGS.pc].format & JOF_INVOKE); /* Resume execution in the calling frame. */ - if (JS_LIKELY(interpReturnOK)) { + if (MOZ_LIKELY(interpReturnOK)) { TypeScript::Monitor(cx, script, REGS.pc, REGS.sp[-1]); ADVANCE_AND_DISPATCH(JSOP_CALL_LENGTH); diff --git a/js/src/vm/Runtime.h b/js/src/vm/Runtime.h index 92656f621eea..daa3d80f8997 100644 --- a/js/src/vm/Runtime.h +++ b/js/src/vm/Runtime.h @@ -609,14 +609,14 @@ struct MallocProvider Client *client = static_cast(this); client->updateMallocCounter(bytes); void *p = js_malloc(bytes); - return JS_LIKELY(!!p) ? p : client->onOutOfMemory(nullptr, bytes); + return MOZ_LIKELY(!!p) ? p : client->onOutOfMemory(nullptr, bytes); } void *calloc_(size_t bytes) { Client *client = static_cast(this); client->updateMallocCounter(bytes); void *p = js_calloc(bytes); - return JS_LIKELY(!!p) ? p : client->onOutOfMemory(reinterpret_cast(1), bytes); + return MOZ_LIKELY(!!p) ? p : client->onOutOfMemory(reinterpret_cast(1), bytes); } void *realloc_(void *p, size_t oldBytes, size_t newBytes) { @@ -628,7 +628,7 @@ struct MallocProvider if (newBytes > oldBytes) client->updateMallocCounter(newBytes - oldBytes); void *p2 = js_realloc(p, newBytes); - return JS_LIKELY(!!p2) ? p2 : client->onOutOfMemory(p, newBytes); + return MOZ_LIKELY(!!p2) ? p2 : client->onOutOfMemory(p, newBytes); } void *realloc_(void *p, size_t bytes) { @@ -640,7 +640,7 @@ struct MallocProvider if (!p) client->updateMallocCounter(bytes); void *p2 = js_realloc(p, bytes); - return JS_LIKELY(!!p2) ? p2 : client->onOutOfMemory(p, bytes); + return MOZ_LIKELY(!!p2) ? p2 : client->onOutOfMemory(p, bytes); } template