Bug 998172 - SpiderMonkey: Eliminate unnecessary parentheses around return values. r=nbp

This commit is contained in:
Dan Gohman 2014-04-18 11:13:44 -07:00
Родитель 8fe179529e
Коммит c6211f7aa7
22 изменённых файлов: 34 добавлений и 34 удалений

Просмотреть файл

@ -665,7 +665,7 @@ regexp_test_impl(JSContext *cx, CallArgs args)
MatchConduit conduit(&match);
RegExpRunStatus status = ExecuteRegExp(cx, args, conduit);
args.rval().setBoolean(status == RegExpRunStatus_Success);
return (status != RegExpRunStatus_Error);
return status != RegExpRunStatus_Error;
}
/* Separate interface for use by IonMonkey. */
@ -676,7 +676,7 @@ js::regexp_test_raw(JSContext *cx, HandleObject regexp, HandleString input, bool
MatchConduit conduit(&match);
RegExpRunStatus status = ExecuteRegExp(cx, regexp, input, conduit, UpdateRegExpStatics);
*result = (status == RegExpRunStatus_Success);
return (status != RegExpRunStatus_Error);
return status != RegExpRunStatus_Error;
}
bool
@ -701,5 +701,5 @@ js::regexp_test_no_statics(JSContext *cx, unsigned argc, Value *vp)
MatchConduit conduit(&match);
RegExpRunStatus status = ExecuteRegExp(cx, regexp, string, conduit, DontUpdateRegExpStatics);
args.rval().setBoolean(status == RegExpRunStatus_Success);
return (status != RegExpRunStatus_Error);
return status != RegExpRunStatus_Error;
}

Просмотреть файл

@ -815,7 +815,7 @@ class MOZ_STACK_CLASS TokenStream
#endif
static bool isRawEOLChar(int32_t c) {
return (c == '\n' || c == '\r' || c == LINE_SEPARATOR || c == PARA_SEPARATOR);
return c == '\n' || c == '\r' || c == LINE_SEPARATOR || c == PARA_SEPARATOR;
}
// Finds the next EOL, but stops once 'max' jschars have been scanned

Просмотреть файл

@ -21,7 +21,7 @@ bool
C1Spewer::init(const char *path)
{
spewout_ = fopen(path, "w");
return (spewout_ != nullptr);
return spewout_ != nullptr;
}
void

Просмотреть файл

@ -175,7 +175,7 @@ IsIonInlinablePC(jsbytecode *pc) {
inline bool
TooManyArguments(unsigned nargs)
{
return (nargs >= SNAPSHOT_MAX_NARGS || nargs > js_JitOptions.maxStackArgs);
return nargs >= SNAPSHOT_MAX_NARGS || nargs > js_JitOptions.maxStackArgs;
}
void ForbidCompilation(JSContext *cx, JSScript *script);

Просмотреть файл

@ -494,7 +494,7 @@ LIRGenerator::visitCall(MCall *call)
LCallNative *lir = new(alloc()) LCallNative(tempFixed(cxReg), tempFixed(numReg),
tempFixed(vpReg), tempFixed(tmpReg));
return (defineReturn(lir, call) && assignSafepoint(lir, call));
return defineReturn(lir, call) && assignSafepoint(lir, call);
}
LCallKnown *lir = new(alloc()) LCallKnown(useFixed(call->getFunction(), CallTempReg0),

Просмотреть файл

@ -363,7 +363,7 @@ InstMovWT::extractImm(Imm16 *imm)
bool
InstMovWT::checkImm(Imm16 imm)
{
return (imm.decode() == Imm16(*this).decode());
return imm.decode() == Imm16(*this).decode();
}
void
@ -374,7 +374,7 @@ InstMovWT::extractDest(Register *dest)
bool
InstMovWT::checkDest(Register dest)
{
return (dest == toRD(*this));
return dest == toRD(*this);
}
bool

Просмотреть файл

@ -304,7 +304,7 @@ class CodeGeneratorShared : public LInstructionVisitor
void emitPreBarrier(Address address, MIRType type);
inline bool isNextBlock(LBlock *block) {
return (current->mir()->id() + 1 == block->mir()->id());
return current->mir()->id() + 1 == block->mir()->id();
}
public:

Просмотреть файл

@ -660,7 +660,7 @@ digits(size_t *result, const jschar *s, size_t *i, size_t limit)
*result += (s[*i] - '0');
++(*i);
}
return (*i != init);
return *i != init;
}
/*
@ -683,7 +683,7 @@ fractional(double *result, const jschar *s, size_t *i, size_t limit)
factor *= 0.1;
++(*i);
}
return (*i != init);
return *i != init;
}
/*
@ -699,7 +699,7 @@ ndigits(size_t n, size_t *result, const jschar *s, size_t* i, size_t limit)
size_t init = *i;
if (digits(result, s, i, Min(limit, init+n)))
return ((*i - init) == n);
return (*i - init) == n;
*i = init;
return false;

Просмотреть файл

@ -916,7 +916,7 @@ JS::IsIncrementalGCEnabled(JSRuntime *rt)
JS_FRIEND_API(bool)
JS::IsIncrementalGCInProgress(JSRuntime *rt)
{
return (rt->gcIncrementalState != gc::NO_INCREMENTAL && !rt->gcVerifyPreData);
return rt->gcIncrementalState != gc::NO_INCREMENTAL && !rt->gcVerifyPreData;
}
JS_FRIEND_API(void)
@ -970,7 +970,7 @@ JS::IsGenerationalGCEnabled(JSRuntime *rt)
JS_FRIEND_API(bool)
JS::IsIncrementalBarrierNeeded(JSRuntime *rt)
{
return (rt->gcIncrementalState == gc::MARK && !rt->isHeapBusy());
return rt->gcIncrementalState == gc::MARK && !rt->isHeapBusy();
}
JS_FRIEND_API(bool)

Просмотреть файл

@ -68,7 +68,7 @@ class MathCache
return e.out;
e.in = x;
e.f = f;
return (e.out = f(x));
return e.out = f(x);
}
size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf);

Просмотреть файл

@ -1932,7 +1932,7 @@ js::CallResultEscapes(jsbytecode *pc)
if (*pc == JSOP_NOT)
pc += JSOP_NOT_LENGTH;
return (*pc != JSOP_IFEQ);
return *pc != JSOP_IFEQ;
}
extern bool

Просмотреть файл

@ -33,7 +33,7 @@ GetDefCount(JSScript *script, unsigned offset)
* would pop b, c, and d to rearrange the stack to |a c[0]
* d[1] b[2]|.
*/
return (pc[1] + 1);
return pc[1] + 1;
default:
return StackDefs(script, pc);
}
@ -45,7 +45,7 @@ GetUseCount(JSScript *script, unsigned offset)
jsbytecode *pc = script->offsetToPC(offset);
if (JSOp(*pc) == JSOP_PICK)
return (pc[1] + 1);
return pc[1] + 1;
if (js_CodeSpec[*pc].nuses == -1)
return StackUses(script, pc);
return js_CodeSpec[*pc].nuses;

Просмотреть файл

@ -1380,7 +1380,7 @@ class JSScript : public js::gc::BarrieredCell<JSScript>
jssrcnote *notes() { return (jssrcnote *)(code() + length()); }
bool hasArray(ArrayKind kind) {
return (hasArrayBits & (1 << kind));
return hasArrayBits & (1 << kind);
}
void setHasArray(ArrayKind kind) { hasArrayBits |= (1 << kind); }
void cloneHasArray(JSScript *script) { hasArrayBits = script->hasArrayBits; }

Просмотреть файл

@ -3174,7 +3174,7 @@ class SplitMatchResult {
endIndex_ = SIZE_MAX;
}
bool isFailure() const {
return (endIndex_ == SIZE_MAX);
return endIndex_ == SIZE_MAX;
}
size_t endIndex() const {
JS_ASSERT(!isFailure());

Просмотреть файл

@ -535,7 +535,7 @@ GlobalWorkerThreadState::canStartAsmJSCompile()
{
// Don't execute an AsmJS job if an earlier one failed.
JS_ASSERT(isLocked());
return (!asmJSWorklist().empty() && !numAsmJSFailedJobs);
return !asmJSWorklist().empty() && !numAsmJSFailedJobs;
}
bool

Просмотреть файл

@ -370,7 +370,7 @@ class NewObjectCache
Entry *entry = &entries[*pentry];
/* N.B. Lookups with the same clasp/key but different kinds map to different entries. */
return (entry->clasp == clasp && entry->key == key);
return entry->clasp == clasp && entry->key == key;
}
void fill(EntryIndex entry_, const Class *clasp, gc::Cell *key, gc::AllocKind kind, JSObject *obj) {

Просмотреть файл

@ -1172,7 +1172,7 @@ class Shape : public gc::BarrieredCell<Shape>
}
uint32_t numFixedSlots() const {
return (slotInfo >> FIXED_SLOTS_SHIFT);
return slotInfo >> FIXED_SLOTS_SHIFT;
}
void setNumFixedSlots(uint32_t nfixed) {

Просмотреть файл

@ -644,9 +644,9 @@ StaticStrings::isStatic(JSAtom *atom)
const jschar *chars = atom->chars();
switch (atom->length()) {
case 1:
return (chars[0] < UNIT_STATIC_LIMIT);
return chars[0] < UNIT_STATIC_LIMIT;
case 2:
return (fitsInSmallChar(chars[0]) && fitsInSmallChar(chars[1]));
return fitsInSmallChar(chars[0]) && fitsInSmallChar(chars[1]);
case 3:
if ('1' <= chars[0] && chars[0] <= '9' &&
'0' <= chars[1] && chars[1] <= '9' &&
@ -655,7 +655,7 @@ StaticStrings::isStatic(JSAtom *atom)
(chars[1] - '0') * 10 +
(chars[2] - '0');
return (unsigned(i) < INT_STATIC_LIMIT);
return unsigned(i) < INT_STATIC_LIMIT;
}
return false;
default:

Просмотреть файл

@ -381,7 +381,7 @@ class JSString : public js::gc::BarrieredCell<JSString>
MOZ_ALWAYS_INLINE
bool isAtom() const {
return (d.lengthAndFlags & ATOM_BIT);
return d.lengthAndFlags & ATOM_BIT;
}
MOZ_ALWAYS_INLINE
@ -399,7 +399,7 @@ class JSString : public js::gc::BarrieredCell<JSString>
inline bool hasBase() const {
JS_STATIC_ASSERT((DEPENDENT_FLAGS | JS_BIT(1)) == UNDEPENDED_FLAGS);
return (d.lengthAndFlags & HAS_BASE_BIT);
return d.lengthAndFlags & HAS_BASE_BIT;
}
inline JSLinearString *base() const;
@ -740,7 +740,7 @@ class JSAtom : public JSFlatString
MOZ_ALWAYS_INLINE
bool isPermanent() const {
return (d.lengthAndFlags & PERMANENT_BIT);
return d.lengthAndFlags & PERMANENT_BIT;
}
// Transform this atom into a permanent atom. This is only done during

Просмотреть файл

@ -61,7 +61,7 @@ rdtsc(void)
result = result<<32;
result = result|lower;
return(result);
return result;
}
#endif

Просмотреть файл

@ -166,7 +166,7 @@ js::ClampDoubleToUint8(const double x)
* ones bit should do the trick to get us the value we
* want.
*/
return (y & ~1);
return y & ~1;
}
return y;
@ -2059,7 +2059,7 @@ const JSFunctionSpec _typedArray##Object::jsfuncs[] = {
if (!(obj = CheckedUnwrap(obj))) \
return false; \
const Class *clasp = obj->getClass(); \
return (clasp == &TypedArrayObject::classes[TypedArrayObjectTemplate<NativeType>::ArrayTypeID()]); \
return clasp == &TypedArrayObject::classes[TypedArrayObjectTemplate<NativeType>::ArrayTypeID()]; \
}
IMPL_TYPED_ARRAY_JSAPI_CONSTRUCTORS(Int8, int8_t)

Просмотреть файл

@ -12,7 +12,7 @@
inline bool
IsVTuneProfilingActive()
{
return (iJIT_IsProfilingActive() == iJIT_SAMPLING_ON);
return iJIT_IsProfilingActive() == iJIT_SAMPLING_ON;
}
#endif // vtunewrapper_h