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

This commit is contained in:
Dan Gohman 2014-08-18 12:20:40 -07:00
Родитель d4ab873885
Коммит d24f091257
13 изменённых файлов: 52 добавлений и 52 удалений

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

@ -150,13 +150,13 @@ JSID_IS_VOID(const jsid id)
{
MOZ_ASSERT_IF(((size_t)JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_VOID,
JSID_BITS(id) == JSID_TYPE_VOID);
return ((size_t)JSID_BITS(id) == JSID_TYPE_VOID);
return (size_t)JSID_BITS(id) == JSID_TYPE_VOID;
}
static MOZ_ALWAYS_INLINE bool
JSID_IS_EMPTY(const jsid id)
{
return ((size_t)JSID_BITS(id) == JSID_TYPE_SYMBOL);
return (size_t)JSID_BITS(id) == JSID_TYPE_SYMBOL;
}
extern JS_PUBLIC_DATA(const jsid) JSID_VOID;

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

@ -1945,9 +1945,9 @@ DOUBLE_TO_JSVAL(double d)
static inline JS_VALUE_CONSTEXPR jsval
UINT_TO_JSVAL(uint32_t i)
{
return (i <= JSVAL_INT_MAX
? INT_TO_JSVAL((int32_t)i)
: DOUBLE_TO_JSVAL((double)i));
return i <= JSVAL_INT_MAX
? INT_TO_JSVAL((int32_t)i)
: DOUBLE_TO_JSVAL((double)i);
}
static inline jsval

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

@ -87,10 +87,10 @@ struct DebugModeOSREntry
}
bool needsRecompileInfo() const {
return (frameKind == ICEntry::Kind_CallVM ||
frameKind == ICEntry::Kind_DebugTrap ||
frameKind == ICEntry::Kind_DebugPrologue ||
frameKind == ICEntry::Kind_DebugEpilogue);
return frameKind == ICEntry::Kind_CallVM ||
frameKind == ICEntry::Kind_DebugTrap ||
frameKind == ICEntry::Kind_DebugPrologue ||
frameKind == ICEntry::Kind_DebugEpilogue;
}
bool recompiled() const {
@ -805,9 +805,9 @@ JitRuntime::getBaselineDebugModeOSRHandlerAddress(JSContext *cx, bool popFrameRe
{
if (!getBaselineDebugModeOSRHandler(cx))
return nullptr;
return (popFrameReg
? baselineDebugModeOSRHandler_->raw()
: baselineDebugModeOSRHandlerNoFrameRegPopAddr_);
return popFrameReg
? baselineDebugModeOSRHandler_->raw()
: baselineDebugModeOSRHandlerNoFrameRegPopAddr_;
}
JitCode *

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

@ -3890,9 +3890,9 @@ static bool
TypedArrayRequiresFloatingPoint(TypedArrayObject *tarr)
{
uint32_t type = tarr->type();
return (type == Scalar::Uint32 ||
type == Scalar::Float32 ||
type == Scalar::Float64);
return type == Scalar::Uint32 ||
type == Scalar::Float32 ||
type == Scalar::Float64;
}
static bool

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

@ -2255,8 +2255,8 @@ class ICCompare_Int32WithBoolean : public ICStub
bool generateStubCode(MacroAssembler &masm);
virtual int32_t getKey() const {
return (static_cast<int32_t>(kind) | (static_cast<int32_t>(op_) << 16) |
(static_cast<int32_t>(lhsIsInt32_) << 24));
return static_cast<int32_t>(kind) | (static_cast<int32_t>(op_) << 16) |
(static_cast<int32_t>(lhsIsInt32_) << 24);
}
public:
@ -2568,8 +2568,8 @@ class ICBinaryArith_Int32 : public ICStub
// Stub keys shift-stubs need to encode the kind, the JSOp and if we allow doubles.
virtual int32_t getKey() const {
return (static_cast<int32_t>(kind) | (static_cast<int32_t>(op_) << 16) |
(static_cast<int32_t>(allowDouble_) << 24));
return static_cast<int32_t>(kind) | (static_cast<int32_t>(op_) << 16) |
(static_cast<int32_t>(allowDouble_) << 24);
}
public:

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

@ -9250,8 +9250,8 @@ IonBuilder::needsToMonitorMissingProperties(types::TemporaryTypeSet *types)
// TypeScript::Monitor to ensure that the observed type set contains
// undefined. To account for possible missing properties, which property
// types do not track, we must always insert a type barrier.
return (info().executionMode() == ParallelExecution &&
!types->hasType(types::Type::UndefinedType()));
return info().executionMode() == ParallelExecution &&
!types->hasType(types::Type::UndefinedType());
}
bool

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

@ -2986,10 +2986,10 @@ const size_t GetElementIC::MAX_FAILED_UPDATES = 16;
GetElementIC::canAttachGetProp(JSObject *obj, const Value &idval, jsid id)
{
uint32_t dummy;
return (obj->isNative() &&
idval.isString() &&
JSID_IS_ATOM(id) &&
!JSID_TO_ATOM(id)->isIndex(&dummy));
return obj->isNative() &&
idval.isString() &&
JSID_IS_ATOM(id) &&
!JSID_TO_ATOM(id)->isIndex(&dummy);
}
static bool
@ -3562,8 +3562,8 @@ static bool
IsTypedArrayElementSetInlineable(JSObject *obj, const Value &idval, const Value &value)
{
// Don't bother attaching stubs for assigning strings and objects.
return (obj->is<TypedArrayObject>() && idval.isInt32() &&
!value.isString() && !value.isObject());
return obj->is<TypedArrayObject>() && idval.isInt32() &&
!value.isString() && !value.isObject();
}
static void

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

@ -568,8 +568,8 @@ static inline bool
IsNunbox(VirtualRegister *vreg)
{
#ifdef JS_NUNBOX32
return (vreg->type() == LDefinition::TYPE ||
vreg->type() == LDefinition::PAYLOAD);
return vreg->type() == LDefinition::TYPE ||
vreg->type() == LDefinition::PAYLOAD;
#else
return false;
#endif

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

@ -7559,13 +7559,13 @@ class MStoreTypedArrayElement
return arrayType_;
}
bool isByteArray() const {
return (arrayType_ == Scalar::Int8 ||
arrayType_ == Scalar::Uint8 ||
arrayType_ == Scalar::Uint8Clamped);
return arrayType_ == Scalar::Int8 ||
arrayType_ == Scalar::Uint8 ||
arrayType_ == Scalar::Uint8Clamped;
}
bool isFloatArray() const {
return (arrayType_ == Scalar::Float32 ||
arrayType_ == Scalar::Float64);
return arrayType_ == Scalar::Float32 ||
arrayType_ == Scalar::Float64;
}
TypePolicy *typePolicy() {
return this;
@ -7632,13 +7632,13 @@ class MStoreTypedArrayElementHole
return arrayType_;
}
bool isByteArray() const {
return (arrayType_ == Scalar::Int8 ||
arrayType_ == Scalar::Uint8 ||
arrayType_ == Scalar::Uint8Clamped);
return arrayType_ == Scalar::Int8 ||
arrayType_ == Scalar::Uint8 ||
arrayType_ == Scalar::Uint8Clamped;
}
bool isFloatArray() const {
return (arrayType_ == Scalar::Float32 ||
arrayType_ == Scalar::Float64);
return arrayType_ == Scalar::Float32 ||
arrayType_ == Scalar::Float64;
}
TypePolicy *typePolicy() {
return this;
@ -7695,8 +7695,8 @@ class MStoreTypedArrayElementStatic :
return typedArray_->type();
}
bool isFloatArray() const {
return (viewType() == Scalar::Float32 ||
viewType() == Scalar::Float64);
return viewType() == Scalar::Float32 ||
viewType() == Scalar::Float64;
}
void *base() const;

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

@ -123,8 +123,8 @@ jit::IsInTargetRegion(ForkJoinContext *cx, TypedObject *typedObj)
{
JS_ASSERT(typedObj->is<TypedObject>()); // in case JIT supplies something bogus
uint8_t *typedMem = typedObj->typedMem();
return (typedMem >= cx->targetRegionStart &&
typedMem < cx->targetRegionEnd);
return typedMem >= cx->targetRegionStart &&
typedMem < cx->targetRegionEnd;
}
bool

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

@ -4332,9 +4332,9 @@ JS::OwningCompileOptions::copy(JSContext *cx, const ReadOnlyCompileOptions &rhs)
setElementAttributeName(rhs.elementAttributeName());
setIntroductionScript(rhs.introductionScript());
return (setFileAndLine(cx, rhs.filename(), rhs.lineno) &&
setSourceMapURL(cx, rhs.sourceMapURL()) &&
setIntroducerFilename(cx, rhs.introducerFilename()));
return setFileAndLine(cx, rhs.filename(), rhs.lineno) &&
setSourceMapURL(cx, rhs.sourceMapURL()) &&
setIntroducerFilename(cx, rhs.introducerFilename());
}
bool

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

@ -35,8 +35,8 @@ probes::CallTrackingActive(JSContext *cx)
inline bool
probes::WantNativeAddressInfo(JSContext *cx)
{
return (cx->reportGranularity >= JITREPORT_GRANULARITY_FUNCTION &&
JITGranularityRequested(cx) >= JITREPORT_GRANULARITY_FUNCTION);
return cx->reportGranularity >= JITREPORT_GRANULARITY_FUNCTION &&
JITGranularityRequested(cx) >= JITREPORT_GRANULARITY_FUNCTION;
}
inline bool

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

@ -375,10 +375,10 @@ NativeSetMap::Entry::Match(PLDHashTable *table,
// it would end up really being a set with two interfaces (except for
// the case where the one interface happened to be nsISupports).
return ((SetInTable->GetInterfaceCount() == 1 &&
SetInTable->GetInterfaceAt(0) == Addition) ||
(SetInTable->GetInterfaceCount() == 2 &&
SetInTable->GetInterfaceAt(1) == Addition));
return (SetInTable->GetInterfaceCount() == 1 &&
SetInTable->GetInterfaceAt(0) == Addition) ||
(SetInTable->GetInterfaceCount() == 2 &&
SetInTable->GetInterfaceAt(1) == Addition);
}
if (!Addition && Set == SetInTable)