зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1054334 - SpiderMonkey: Eliminate unnecessary parentheses around return values r=nbp
This commit is contained in:
Родитель
d4ab873885
Коммит
d24f091257
|
@ -150,13 +150,13 @@ JSID_IS_VOID(const jsid id)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT_IF(((size_t)JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_VOID,
|
MOZ_ASSERT_IF(((size_t)JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_VOID,
|
||||||
JSID_BITS(id) == 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
|
static MOZ_ALWAYS_INLINE bool
|
||||||
JSID_IS_EMPTY(const jsid id)
|
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;
|
extern JS_PUBLIC_DATA(const jsid) JSID_VOID;
|
||||||
|
|
|
@ -1945,9 +1945,9 @@ DOUBLE_TO_JSVAL(double d)
|
||||||
static inline JS_VALUE_CONSTEXPR jsval
|
static inline JS_VALUE_CONSTEXPR jsval
|
||||||
UINT_TO_JSVAL(uint32_t i)
|
UINT_TO_JSVAL(uint32_t i)
|
||||||
{
|
{
|
||||||
return (i <= JSVAL_INT_MAX
|
return i <= JSVAL_INT_MAX
|
||||||
? INT_TO_JSVAL((int32_t)i)
|
? INT_TO_JSVAL((int32_t)i)
|
||||||
: DOUBLE_TO_JSVAL((double)i));
|
: DOUBLE_TO_JSVAL((double)i);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline jsval
|
static inline jsval
|
||||||
|
|
|
@ -87,10 +87,10 @@ struct DebugModeOSREntry
|
||||||
}
|
}
|
||||||
|
|
||||||
bool needsRecompileInfo() const {
|
bool needsRecompileInfo() const {
|
||||||
return (frameKind == ICEntry::Kind_CallVM ||
|
return frameKind == ICEntry::Kind_CallVM ||
|
||||||
frameKind == ICEntry::Kind_DebugTrap ||
|
frameKind == ICEntry::Kind_DebugTrap ||
|
||||||
frameKind == ICEntry::Kind_DebugPrologue ||
|
frameKind == ICEntry::Kind_DebugPrologue ||
|
||||||
frameKind == ICEntry::Kind_DebugEpilogue);
|
frameKind == ICEntry::Kind_DebugEpilogue;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool recompiled() const {
|
bool recompiled() const {
|
||||||
|
@ -805,9 +805,9 @@ JitRuntime::getBaselineDebugModeOSRHandlerAddress(JSContext *cx, bool popFrameRe
|
||||||
{
|
{
|
||||||
if (!getBaselineDebugModeOSRHandler(cx))
|
if (!getBaselineDebugModeOSRHandler(cx))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
return (popFrameReg
|
return popFrameReg
|
||||||
? baselineDebugModeOSRHandler_->raw()
|
? baselineDebugModeOSRHandler_->raw()
|
||||||
: baselineDebugModeOSRHandlerNoFrameRegPopAddr_);
|
: baselineDebugModeOSRHandlerNoFrameRegPopAddr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
JitCode *
|
JitCode *
|
||||||
|
|
|
@ -3890,9 +3890,9 @@ static bool
|
||||||
TypedArrayRequiresFloatingPoint(TypedArrayObject *tarr)
|
TypedArrayRequiresFloatingPoint(TypedArrayObject *tarr)
|
||||||
{
|
{
|
||||||
uint32_t type = tarr->type();
|
uint32_t type = tarr->type();
|
||||||
return (type == Scalar::Uint32 ||
|
return type == Scalar::Uint32 ||
|
||||||
type == Scalar::Float32 ||
|
type == Scalar::Float32 ||
|
||||||
type == Scalar::Float64);
|
type == Scalar::Float64;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
|
|
@ -2255,8 +2255,8 @@ class ICCompare_Int32WithBoolean : public ICStub
|
||||||
bool generateStubCode(MacroAssembler &masm);
|
bool generateStubCode(MacroAssembler &masm);
|
||||||
|
|
||||||
virtual int32_t getKey() const {
|
virtual int32_t getKey() const {
|
||||||
return (static_cast<int32_t>(kind) | (static_cast<int32_t>(op_) << 16) |
|
return static_cast<int32_t>(kind) | (static_cast<int32_t>(op_) << 16) |
|
||||||
(static_cast<int32_t>(lhsIsInt32_) << 24));
|
(static_cast<int32_t>(lhsIsInt32_) << 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
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.
|
// Stub keys shift-stubs need to encode the kind, the JSOp and if we allow doubles.
|
||||||
virtual int32_t getKey() const {
|
virtual int32_t getKey() const {
|
||||||
return (static_cast<int32_t>(kind) | (static_cast<int32_t>(op_) << 16) |
|
return static_cast<int32_t>(kind) | (static_cast<int32_t>(op_) << 16) |
|
||||||
(static_cast<int32_t>(allowDouble_) << 24));
|
(static_cast<int32_t>(allowDouble_) << 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -9250,8 +9250,8 @@ IonBuilder::needsToMonitorMissingProperties(types::TemporaryTypeSet *types)
|
||||||
// TypeScript::Monitor to ensure that the observed type set contains
|
// TypeScript::Monitor to ensure that the observed type set contains
|
||||||
// undefined. To account for possible missing properties, which property
|
// undefined. To account for possible missing properties, which property
|
||||||
// types do not track, we must always insert a type barrier.
|
// types do not track, we must always insert a type barrier.
|
||||||
return (info().executionMode() == ParallelExecution &&
|
return info().executionMode() == ParallelExecution &&
|
||||||
!types->hasType(types::Type::UndefinedType()));
|
!types->hasType(types::Type::UndefinedType());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
@ -2986,10 +2986,10 @@ const size_t GetElementIC::MAX_FAILED_UPDATES = 16;
|
||||||
GetElementIC::canAttachGetProp(JSObject *obj, const Value &idval, jsid id)
|
GetElementIC::canAttachGetProp(JSObject *obj, const Value &idval, jsid id)
|
||||||
{
|
{
|
||||||
uint32_t dummy;
|
uint32_t dummy;
|
||||||
return (obj->isNative() &&
|
return obj->isNative() &&
|
||||||
idval.isString() &&
|
idval.isString() &&
|
||||||
JSID_IS_ATOM(id) &&
|
JSID_IS_ATOM(id) &&
|
||||||
!JSID_TO_ATOM(id)->isIndex(&dummy));
|
!JSID_TO_ATOM(id)->isIndex(&dummy);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
@ -3562,8 +3562,8 @@ static bool
|
||||||
IsTypedArrayElementSetInlineable(JSObject *obj, const Value &idval, const Value &value)
|
IsTypedArrayElementSetInlineable(JSObject *obj, const Value &idval, const Value &value)
|
||||||
{
|
{
|
||||||
// Don't bother attaching stubs for assigning strings and objects.
|
// Don't bother attaching stubs for assigning strings and objects.
|
||||||
return (obj->is<TypedArrayObject>() && idval.isInt32() &&
|
return obj->is<TypedArrayObject>() && idval.isInt32() &&
|
||||||
!value.isString() && !value.isObject());
|
!value.isString() && !value.isObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -568,8 +568,8 @@ static inline bool
|
||||||
IsNunbox(VirtualRegister *vreg)
|
IsNunbox(VirtualRegister *vreg)
|
||||||
{
|
{
|
||||||
#ifdef JS_NUNBOX32
|
#ifdef JS_NUNBOX32
|
||||||
return (vreg->type() == LDefinition::TYPE ||
|
return vreg->type() == LDefinition::TYPE ||
|
||||||
vreg->type() == LDefinition::PAYLOAD);
|
vreg->type() == LDefinition::PAYLOAD;
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -7559,13 +7559,13 @@ class MStoreTypedArrayElement
|
||||||
return arrayType_;
|
return arrayType_;
|
||||||
}
|
}
|
||||||
bool isByteArray() const {
|
bool isByteArray() const {
|
||||||
return (arrayType_ == Scalar::Int8 ||
|
return arrayType_ == Scalar::Int8 ||
|
||||||
arrayType_ == Scalar::Uint8 ||
|
arrayType_ == Scalar::Uint8 ||
|
||||||
arrayType_ == Scalar::Uint8Clamped);
|
arrayType_ == Scalar::Uint8Clamped;
|
||||||
}
|
}
|
||||||
bool isFloatArray() const {
|
bool isFloatArray() const {
|
||||||
return (arrayType_ == Scalar::Float32 ||
|
return arrayType_ == Scalar::Float32 ||
|
||||||
arrayType_ == Scalar::Float64);
|
arrayType_ == Scalar::Float64;
|
||||||
}
|
}
|
||||||
TypePolicy *typePolicy() {
|
TypePolicy *typePolicy() {
|
||||||
return this;
|
return this;
|
||||||
|
@ -7632,13 +7632,13 @@ class MStoreTypedArrayElementHole
|
||||||
return arrayType_;
|
return arrayType_;
|
||||||
}
|
}
|
||||||
bool isByteArray() const {
|
bool isByteArray() const {
|
||||||
return (arrayType_ == Scalar::Int8 ||
|
return arrayType_ == Scalar::Int8 ||
|
||||||
arrayType_ == Scalar::Uint8 ||
|
arrayType_ == Scalar::Uint8 ||
|
||||||
arrayType_ == Scalar::Uint8Clamped);
|
arrayType_ == Scalar::Uint8Clamped;
|
||||||
}
|
}
|
||||||
bool isFloatArray() const {
|
bool isFloatArray() const {
|
||||||
return (arrayType_ == Scalar::Float32 ||
|
return arrayType_ == Scalar::Float32 ||
|
||||||
arrayType_ == Scalar::Float64);
|
arrayType_ == Scalar::Float64;
|
||||||
}
|
}
|
||||||
TypePolicy *typePolicy() {
|
TypePolicy *typePolicy() {
|
||||||
return this;
|
return this;
|
||||||
|
@ -7695,8 +7695,8 @@ class MStoreTypedArrayElementStatic :
|
||||||
return typedArray_->type();
|
return typedArray_->type();
|
||||||
}
|
}
|
||||||
bool isFloatArray() const {
|
bool isFloatArray() const {
|
||||||
return (viewType() == Scalar::Float32 ||
|
return viewType() == Scalar::Float32 ||
|
||||||
viewType() == Scalar::Float64);
|
viewType() == Scalar::Float64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *base() const;
|
void *base() const;
|
||||||
|
|
|
@ -123,8 +123,8 @@ jit::IsInTargetRegion(ForkJoinContext *cx, TypedObject *typedObj)
|
||||||
{
|
{
|
||||||
JS_ASSERT(typedObj->is<TypedObject>()); // in case JIT supplies something bogus
|
JS_ASSERT(typedObj->is<TypedObject>()); // in case JIT supplies something bogus
|
||||||
uint8_t *typedMem = typedObj->typedMem();
|
uint8_t *typedMem = typedObj->typedMem();
|
||||||
return (typedMem >= cx->targetRegionStart &&
|
return typedMem >= cx->targetRegionStart &&
|
||||||
typedMem < cx->targetRegionEnd);
|
typedMem < cx->targetRegionEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
@ -4332,9 +4332,9 @@ JS::OwningCompileOptions::copy(JSContext *cx, const ReadOnlyCompileOptions &rhs)
|
||||||
setElementAttributeName(rhs.elementAttributeName());
|
setElementAttributeName(rhs.elementAttributeName());
|
||||||
setIntroductionScript(rhs.introductionScript());
|
setIntroductionScript(rhs.introductionScript());
|
||||||
|
|
||||||
return (setFileAndLine(cx, rhs.filename(), rhs.lineno) &&
|
return setFileAndLine(cx, rhs.filename(), rhs.lineno) &&
|
||||||
setSourceMapURL(cx, rhs.sourceMapURL()) &&
|
setSourceMapURL(cx, rhs.sourceMapURL()) &&
|
||||||
setIntroducerFilename(cx, rhs.introducerFilename()));
|
setIntroducerFilename(cx, rhs.introducerFilename());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
@ -35,8 +35,8 @@ probes::CallTrackingActive(JSContext *cx)
|
||||||
inline bool
|
inline bool
|
||||||
probes::WantNativeAddressInfo(JSContext *cx)
|
probes::WantNativeAddressInfo(JSContext *cx)
|
||||||
{
|
{
|
||||||
return (cx->reportGranularity >= JITREPORT_GRANULARITY_FUNCTION &&
|
return cx->reportGranularity >= JITREPORT_GRANULARITY_FUNCTION &&
|
||||||
JITGranularityRequested(cx) >= JITREPORT_GRANULARITY_FUNCTION);
|
JITGranularityRequested(cx) >= JITREPORT_GRANULARITY_FUNCTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool
|
inline bool
|
||||||
|
|
|
@ -375,10 +375,10 @@ NativeSetMap::Entry::Match(PLDHashTable *table,
|
||||||
// it would end up really being a set with two interfaces (except for
|
// it would end up really being a set with two interfaces (except for
|
||||||
// the case where the one interface happened to be nsISupports).
|
// the case where the one interface happened to be nsISupports).
|
||||||
|
|
||||||
return ((SetInTable->GetInterfaceCount() == 1 &&
|
return (SetInTable->GetInterfaceCount() == 1 &&
|
||||||
SetInTable->GetInterfaceAt(0) == Addition) ||
|
SetInTable->GetInterfaceAt(0) == Addition) ||
|
||||||
(SetInTable->GetInterfaceCount() == 2 &&
|
(SetInTable->GetInterfaceCount() == 2 &&
|
||||||
SetInTable->GetInterfaceAt(1) == Addition));
|
SetInTable->GetInterfaceAt(1) == Addition);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Addition && Set == SetInTable)
|
if (!Addition && Set == SetInTable)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче