summaryrefslogtreecommitdiff
path: root/js/src/jit/IonBuilder.h
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit/IonBuilder.h')
-rw-r--r--js/src/jit/IonBuilder.h454
1 files changed, 227 insertions, 227 deletions
diff --git a/js/src/jit/IonBuilder.h b/js/src/jit/IonBuilder.h
index 8f616b74eb..c5275d7b89 100644
--- a/js/src/jit/IonBuilder.h
+++ b/js/src/jit/IonBuilder.h
@@ -217,15 +217,15 @@ class IonBuilder
// Callers of build() and buildInline() should always check whether the
// call overrecursed, if false is returned. Overrecursion is not
// signaled as OOM and will not in general be caught by OOM paths.
- MOZ_MUST_USE bool build();
- MOZ_MUST_USE bool buildInline(IonBuilder* callerBuilder, MResumePoint* callerResumePoint,
+ [[nodiscard]] bool build();
+ [[nodiscard]] bool buildInline(IonBuilder* callerBuilder, MResumePoint* callerResumePoint,
CallInfo& callInfo);
private:
- MOZ_MUST_USE bool traverseBytecode();
+ [[nodiscard]] bool traverseBytecode();
ControlStatus snoopControlFlow(JSOp op);
- MOZ_MUST_USE bool processIterators();
- MOZ_MUST_USE bool inspectOpcode(JSOp op);
+ [[nodiscard]] bool processIterators();
+ [[nodiscard]] bool inspectOpcode(JSOp op);
uint32_t readIndex(jsbytecode* pc);
JSAtom* readAtom(jsbytecode* pc);
bool abort(const char* message, ...) MOZ_FORMAT_PRINTF(2, 3);
@@ -233,12 +233,12 @@ class IonBuilder
void spew(const char* message);
JSFunction* getSingleCallTarget(TemporaryTypeSet* calleeTypes);
- MOZ_MUST_USE bool getPolyCallTargets(TemporaryTypeSet* calleeTypes, bool constructing,
+ [[nodiscard]] bool getPolyCallTargets(TemporaryTypeSet* calleeTypes, bool constructing,
ObjectVector& targets, uint32_t maxTargets);
void popCfgStack();
DeferredEdge* filterDeadDeferredEdges(DeferredEdge* edge);
- MOZ_MUST_USE bool processDeferredContinues(CFGState& state);
+ [[nodiscard]] bool processDeferredContinues(CFGState& state);
ControlStatus processControlEnd();
ControlStatus processCfgStack();
ControlStatus processCfgEntry(CFGState& state);
@@ -265,11 +265,11 @@ class IonBuilder
ControlStatus processContinue(JSOp op);
ControlStatus processBreak(JSOp op, jssrcnote* sn);
ControlStatus maybeLoop(JSOp op, jssrcnote* sn);
- MOZ_MUST_USE bool pushLoop(CFGState::State state, jsbytecode* stopAt, MBasicBlock* entry,
+ [[nodiscard]] bool pushLoop(CFGState::State state, jsbytecode* stopAt, MBasicBlock* entry,
bool osr, jsbytecode* loopHead, jsbytecode* initialPc,
jsbytecode* bodyStart, jsbytecode* bodyEnd,
jsbytecode* exitpc, jsbytecode* continuepc);
- MOZ_MUST_USE bool analyzeNewLoopTypes(MBasicBlock* entry, jsbytecode* start, jsbytecode* end);
+ [[nodiscard]] bool analyzeNewLoopTypes(MBasicBlock* entry, jsbytecode* start, jsbytecode* end);
MBasicBlock* addBlock(MBasicBlock* block, uint32_t loopDepth);
MBasicBlock* newBlock(MBasicBlock* predecessor, jsbytecode* pc);
@@ -310,9 +310,9 @@ class IonBuilder
// Incorporates a type/typeSet into an OSR value for a loop, after the loop
// body has been processed.
- MOZ_MUST_USE bool addOsrValueTypeBarrier(uint32_t slot, MInstruction** def,
+ [[nodiscard]] bool addOsrValueTypeBarrier(uint32_t slot, MInstruction** def,
MIRType type, TemporaryTypeSet* typeSet);
- MOZ_MUST_USE bool maybeAddOsrTypeBarriers();
+ [[nodiscard]] bool maybeAddOsrTypeBarriers();
// Restarts processing of a loop if the type information at its header was
// incomplete.
@@ -328,19 +328,19 @@ class IonBuilder
// Please see the Big Honkin' Comment about how resume points work in
// IonBuilder.cpp, near the definition for this function.
- MOZ_MUST_USE bool resume(MInstruction* ins, jsbytecode* pc, MResumePoint::Mode mode);
- MOZ_MUST_USE bool resumeAt(MInstruction* ins, jsbytecode* pc);
- MOZ_MUST_USE bool resumeAfter(MInstruction* ins);
- MOZ_MUST_USE bool maybeInsertResume();
+ [[nodiscard]] bool resume(MInstruction* ins, jsbytecode* pc, MResumePoint::Mode mode);
+ [[nodiscard]] bool resumeAt(MInstruction* ins, jsbytecode* pc);
+ [[nodiscard]] bool resumeAfter(MInstruction* ins);
+ [[nodiscard]] bool maybeInsertResume();
void insertRecompileCheck();
- MOZ_MUST_USE bool initParameters();
+ [[nodiscard]] bool initParameters();
void initLocals();
void rewriteParameter(uint32_t slotIdx, MDefinition* param, int32_t argIndex);
- MOZ_MUST_USE bool rewriteParameters();
- MOZ_MUST_USE bool initEnvironmentChain(MDefinition* callee = nullptr);
- MOZ_MUST_USE bool initArgumentsObject();
+ [[nodiscard]] bool rewriteParameters();
+ [[nodiscard]] bool initEnvironmentChain(MDefinition* callee = nullptr);
+ [[nodiscard]] bool initArgumentsObject();
void pushConstant(const Value& v);
MConstant* constant(const Value& v);
@@ -350,27 +350,27 @@ class IonBuilder
MInstruction* setInitializedLength(MDefinition* obj, JSValueType unboxedType, size_t count);
// Improve the type information at tests
- MOZ_MUST_USE bool improveTypesAtTest(MDefinition* ins, bool trueBranch, MTest* test);
- MOZ_MUST_USE bool improveTypesAtCompare(MCompare* ins, bool trueBranch, MTest* test);
- MOZ_MUST_USE bool improveTypesAtNullOrUndefinedCompare(MCompare* ins, bool trueBranch,
+ [[nodiscard]] bool improveTypesAtTest(MDefinition* ins, bool trueBranch, MTest* test);
+ [[nodiscard]] bool improveTypesAtCompare(MCompare* ins, bool trueBranch, MTest* test);
+ [[nodiscard]] bool improveTypesAtNullOrUndefinedCompare(MCompare* ins, bool trueBranch,
MTest* test);
- MOZ_MUST_USE bool improveTypesAtTypeOfCompare(MCompare* ins, bool trueBranch, MTest* test);
+ [[nodiscard]] bool improveTypesAtTypeOfCompare(MCompare* ins, bool trueBranch, MTest* test);
// Used to detect triangular structure at test.
- MOZ_MUST_USE bool detectAndOrStructure(MPhi* ins, bool* branchIsTrue);
- MOZ_MUST_USE bool replaceTypeSet(MDefinition* subject, TemporaryTypeSet* type, MTest* test);
+ [[nodiscard]] bool detectAndOrStructure(MPhi* ins, bool* branchIsTrue);
+ [[nodiscard]] bool replaceTypeSet(MDefinition* subject, TemporaryTypeSet* type, MTest* test);
// Add a guard which ensure that the set of type which goes through this
// generated code correspond to the observed types for the bytecode.
MDefinition* addTypeBarrier(MDefinition* def, TemporaryTypeSet* observed,
BarrierKind kind, MTypeBarrier** pbarrier = nullptr);
- MOZ_MUST_USE bool pushTypeBarrier(MDefinition* def, TemporaryTypeSet* observed,
+ [[nodiscard]] bool pushTypeBarrier(MDefinition* def, TemporaryTypeSet* observed,
BarrierKind kind);
// As pushTypeBarrier, but will compute the needBarrier boolean itself based
// on observed and the JSFunction that we're planning to call. The
// JSFunction must be a DOM method or getter.
- MOZ_MUST_USE bool pushDOMTypeBarrier(MInstruction* ins, TemporaryTypeSet* observed,
+ [[nodiscard]] bool pushDOMTypeBarrier(MInstruction* ins, TemporaryTypeSet* observed,
JSFunction* func);
// If definiteType is not known or def already has the right type, just
@@ -412,13 +412,13 @@ class IonBuilder
bool invalidatedIdempotentCache();
bool hasStaticEnvironmentObject(EnvironmentCoordinate ec, JSObject** pcall);
- MOZ_MUST_USE bool loadSlot(MDefinition* obj, size_t slot, size_t nfixed, MIRType rvalType,
+ [[nodiscard]] bool loadSlot(MDefinition* obj, size_t slot, size_t nfixed, MIRType rvalType,
BarrierKind barrier, TemporaryTypeSet* types);
- MOZ_MUST_USE bool loadSlot(MDefinition* obj, Shape* shape, MIRType rvalType,
+ [[nodiscard]] bool loadSlot(MDefinition* obj, Shape* shape, MIRType rvalType,
BarrierKind barrier, TemporaryTypeSet* types);
- MOZ_MUST_USE bool storeSlot(MDefinition* obj, size_t slot, size_t nfixed, MDefinition* value,
+ [[nodiscard]] bool storeSlot(MDefinition* obj, size_t slot, size_t nfixed, MDefinition* value,
bool needsBarrier, MIRType slotType = MIRType::None);
- MOZ_MUST_USE bool storeSlot(MDefinition* obj, Shape* shape, MDefinition* value,
+ [[nodiscard]] bool storeSlot(MDefinition* obj, Shape* shape, MDefinition* value,
bool needsBarrier, MIRType slotType = MIRType::None);
bool shouldAbortOnPreliminaryGroups(MDefinition *obj);
@@ -426,135 +426,135 @@ class IonBuilder
MDefinition* maybeUnboxForPropertyAccess(MDefinition* def);
// jsop_getprop() helpers.
- MOZ_MUST_USE bool checkIsDefinitelyOptimizedArguments(MDefinition* obj, bool* isOptimizedArgs);
- MOZ_MUST_USE bool getPropTryInferredConstant(bool* emitted, MDefinition* obj,
+ [[nodiscard]] bool checkIsDefinitelyOptimizedArguments(MDefinition* obj, bool* isOptimizedArgs);
+ [[nodiscard]] bool getPropTryInferredConstant(bool* emitted, MDefinition* obj,
PropertyName* name, TemporaryTypeSet* types);
- MOZ_MUST_USE bool getPropTryArgumentsLength(bool* emitted, MDefinition* obj);
- MOZ_MUST_USE bool getPropTryArgumentsCallee(bool* emitted, MDefinition* obj,
+ [[nodiscard]] bool getPropTryArgumentsLength(bool* emitted, MDefinition* obj);
+ [[nodiscard]] bool getPropTryArgumentsCallee(bool* emitted, MDefinition* obj,
PropertyName* name);
- MOZ_MUST_USE bool getPropTryConstant(bool* emitted, MDefinition* obj, jsid id,
+ [[nodiscard]] bool getPropTryConstant(bool* emitted, MDefinition* obj, jsid id,
TemporaryTypeSet* types);
- MOZ_MUST_USE bool getPropTryNotDefined(bool* emitted, MDefinition* obj, jsid id,
+ [[nodiscard]] bool getPropTryNotDefined(bool* emitted, MDefinition* obj, jsid id,
TemporaryTypeSet* types);
- MOZ_MUST_USE bool getPropTryDefiniteSlot(bool* emitted, MDefinition* obj, PropertyName* name,
+ [[nodiscard]] bool getPropTryDefiniteSlot(bool* emitted, MDefinition* obj, PropertyName* name,
BarrierKind barrier, TemporaryTypeSet* types);
- MOZ_MUST_USE bool getPropTryModuleNamespace(bool* emitted, MDefinition* obj, PropertyName* name,
+ [[nodiscard]] bool getPropTryModuleNamespace(bool* emitted, MDefinition* obj, PropertyName* name,
BarrierKind barrier, TemporaryTypeSet* types);
- MOZ_MUST_USE bool getPropTryUnboxed(bool* emitted, MDefinition* obj, PropertyName* name,
+ [[nodiscard]] bool getPropTryUnboxed(bool* emitted, MDefinition* obj, PropertyName* name,
BarrierKind barrier, TemporaryTypeSet* types);
- MOZ_MUST_USE bool getPropTryCommonGetter(bool* emitted, MDefinition* obj, PropertyName* name,
+ [[nodiscard]] bool getPropTryCommonGetter(bool* emitted, MDefinition* obj, PropertyName* name,
TemporaryTypeSet* types);
- MOZ_MUST_USE bool getPropTryInlineAccess(bool* emitted, MDefinition* obj, PropertyName* name,
+ [[nodiscard]] bool getPropTryInlineAccess(bool* emitted, MDefinition* obj, PropertyName* name,
BarrierKind barrier, TemporaryTypeSet* types);
- MOZ_MUST_USE bool getPropTryTypedObject(bool* emitted, MDefinition* obj, PropertyName* name);
- MOZ_MUST_USE bool getPropTryScalarPropOfTypedObject(bool* emitted, MDefinition* typedObj,
+ [[nodiscard]] bool getPropTryTypedObject(bool* emitted, MDefinition* obj, PropertyName* name);
+ [[nodiscard]] bool getPropTryScalarPropOfTypedObject(bool* emitted, MDefinition* typedObj,
int32_t fieldOffset,
TypedObjectPrediction fieldTypeReprs);
- MOZ_MUST_USE bool getPropTryReferencePropOfTypedObject(bool* emitted, MDefinition* typedObj,
+ [[nodiscard]] bool getPropTryReferencePropOfTypedObject(bool* emitted, MDefinition* typedObj,
int32_t fieldOffset,
TypedObjectPrediction fieldPrediction,
PropertyName* name);
- MOZ_MUST_USE bool getPropTryComplexPropOfTypedObject(bool* emitted, MDefinition* typedObj,
+ [[nodiscard]] bool getPropTryComplexPropOfTypedObject(bool* emitted, MDefinition* typedObj,
int32_t fieldOffset,
TypedObjectPrediction fieldTypeReprs,
size_t fieldIndex);
- MOZ_MUST_USE bool getPropTryInnerize(bool* emitted, MDefinition* obj, PropertyName* name,
+ [[nodiscard]] bool getPropTryInnerize(bool* emitted, MDefinition* obj, PropertyName* name,
TemporaryTypeSet* types);
- MOZ_MUST_USE bool getPropTryCache(bool* emitted, MDefinition* obj, PropertyName* name,
+ [[nodiscard]] bool getPropTryCache(bool* emitted, MDefinition* obj, PropertyName* name,
BarrierKind barrier, TemporaryTypeSet* types);
- MOZ_MUST_USE bool getPropTrySharedStub(bool* emitted, MDefinition* obj,
+ [[nodiscard]] bool getPropTrySharedStub(bool* emitted, MDefinition* obj,
TemporaryTypeSet* types);
// jsop_setprop() helpers.
- MOZ_MUST_USE bool setPropTryCommonSetter(bool* emitted, MDefinition* obj,
+ [[nodiscard]] bool setPropTryCommonSetter(bool* emitted, MDefinition* obj,
PropertyName* name, MDefinition* value);
- MOZ_MUST_USE bool setPropTryCommonDOMSetter(bool* emitted, MDefinition* obj,
+ [[nodiscard]] bool setPropTryCommonDOMSetter(bool* emitted, MDefinition* obj,
MDefinition* value, JSFunction* setter,
TemporaryTypeSet* objTypes);
- MOZ_MUST_USE bool setPropTryDefiniteSlot(bool* emitted, MDefinition* obj,
+ [[nodiscard]] bool setPropTryDefiniteSlot(bool* emitted, MDefinition* obj,
PropertyName* name, MDefinition* value,
bool barrier, TemporaryTypeSet* objTypes);
- MOZ_MUST_USE bool setPropTryUnboxed(bool* emitted, MDefinition* obj,
+ [[nodiscard]] bool setPropTryUnboxed(bool* emitted, MDefinition* obj,
PropertyName* name, MDefinition* value,
bool barrier, TemporaryTypeSet* objTypes);
- MOZ_MUST_USE bool setPropTryInlineAccess(bool* emitted, MDefinition* obj,
+ [[nodiscard]] bool setPropTryInlineAccess(bool* emitted, MDefinition* obj,
PropertyName* name, MDefinition* value,
bool barrier, TemporaryTypeSet* objTypes);
- MOZ_MUST_USE bool setPropTryTypedObject(bool* emitted, MDefinition* obj,
+ [[nodiscard]] bool setPropTryTypedObject(bool* emitted, MDefinition* obj,
PropertyName* name, MDefinition* value);
- MOZ_MUST_USE bool setPropTryReferencePropOfTypedObject(bool* emitted, MDefinition* obj,
+ [[nodiscard]] bool setPropTryReferencePropOfTypedObject(bool* emitted, MDefinition* obj,
int32_t fieldOffset, MDefinition* value,
TypedObjectPrediction fieldPrediction,
PropertyName* name);
- MOZ_MUST_USE bool setPropTryScalarPropOfTypedObject(bool* emitted,
+ [[nodiscard]] bool setPropTryScalarPropOfTypedObject(bool* emitted,
MDefinition* obj,
int32_t fieldOffset,
MDefinition* value,
TypedObjectPrediction fieldTypeReprs);
- MOZ_MUST_USE bool setPropTryCache(bool* emitted, MDefinition* obj,
+ [[nodiscard]] bool setPropTryCache(bool* emitted, MDefinition* obj,
PropertyName* name, MDefinition* value,
bool barrier, TemporaryTypeSet* objTypes);
// jsop_binary_arith helpers.
MBinaryArithInstruction* binaryArithInstruction(JSOp op, MDefinition* left, MDefinition* right);
MIRType binaryArithNumberSpecialization(MDefinition* left, MDefinition* right);
- MOZ_MUST_USE bool binaryArithTryConcat(bool* emitted, JSOp op, MDefinition* left,
+ [[nodiscard]] bool binaryArithTryConcat(bool* emitted, JSOp op, MDefinition* left,
MDefinition* right);
- MOZ_MUST_USE MBinaryArithInstruction* binaryArithEmitSpecialized(MDefinition::Opcode op,
+ [[nodiscard]] MBinaryArithInstruction* binaryArithEmitSpecialized(MDefinition::Opcode op,
MIRType specialization,
MDefinition* left,
MDefinition* right);
- MOZ_MUST_USE bool binaryArithTrySpecialized(bool* emitted, JSOp op, MDefinition* left,
+ [[nodiscard]] bool binaryArithTrySpecialized(bool* emitted, JSOp op, MDefinition* left,
MDefinition* right);
- MOZ_MUST_USE bool binaryArithTrySpecializedOnBaselineInspector(bool* emitted, JSOp op,
+ [[nodiscard]] bool binaryArithTrySpecializedOnBaselineInspector(bool* emitted, JSOp op,
MDefinition* left,
MDefinition* right);
- MOZ_MUST_USE bool arithTrySharedStub(bool* emitted, JSOp op, MDefinition* left,
+ [[nodiscard]] bool arithTrySharedStub(bool* emitted, JSOp op, MDefinition* left,
MDefinition* right);
// jsop_bitnot helpers.
- MOZ_MUST_USE bool bitnotTrySpecialized(bool* emitted, MDefinition* input);
+ [[nodiscard]] bool bitnotTrySpecialized(bool* emitted, MDefinition* input);
// jsop_inc_or_dec helpers.
MDefinition* unaryArithConvertToBinary(JSOp op, MDefinition::Opcode* defOp);
- MOZ_MUST_USE bool unaryArithTrySpecialized(bool* emitted, JSOp op, MDefinition* value);
- MOZ_MUST_USE bool unaryArithTrySpecializedOnBaselineInspector(bool* emitted, JSOp op,
+ [[nodiscard]] bool unaryArithTrySpecialized(bool* emitted, JSOp op, MDefinition* value);
+ [[nodiscard]] bool unaryArithTrySpecializedOnBaselineInspector(bool* emitted, JSOp op,
MDefinition* value);
// jsop_pow helpers.
- MOZ_MUST_USE bool powTrySpecialized(bool* emitted, MDefinition* base, MDefinition* power,
+ [[nodiscard]] bool powTrySpecialized(bool* emitted, MDefinition* base, MDefinition* power,
MIRType outputType);
// jsop_compare helpers.
- MOZ_MUST_USE bool compareTrySpecialized(bool* emitted, JSOp op, MDefinition* left,
+ [[nodiscard]] bool compareTrySpecialized(bool* emitted, JSOp op, MDefinition* left,
MDefinition* right);
- MOZ_MUST_USE bool compareTryBitwise(bool* emitted, JSOp op, MDefinition* left,
+ [[nodiscard]] bool compareTryBitwise(bool* emitted, JSOp op, MDefinition* left,
MDefinition* right);
- MOZ_MUST_USE bool compareTrySpecializedOnBaselineInspector(bool* emitted, JSOp op,
+ [[nodiscard]] bool compareTrySpecializedOnBaselineInspector(bool* emitted, JSOp op,
MDefinition* left,
MDefinition* right);
- MOZ_MUST_USE bool compareTrySharedStub(bool* emitted, JSOp op, MDefinition* left,
+ [[nodiscard]] bool compareTrySharedStub(bool* emitted, JSOp op, MDefinition* left,
MDefinition* right);
// jsop_newarray helpers.
- MOZ_MUST_USE bool newArrayTrySharedStub(bool* emitted);
- MOZ_MUST_USE bool newArrayTryTemplateObject(bool* emitted, JSObject* templateObject,
+ [[nodiscard]] bool newArrayTrySharedStub(bool* emitted);
+ [[nodiscard]] bool newArrayTryTemplateObject(bool* emitted, JSObject* templateObject,
uint32_t length);
- MOZ_MUST_USE bool newArrayTryVM(bool* emitted, JSObject* templateObject, uint32_t length);
+ [[nodiscard]] bool newArrayTryVM(bool* emitted, JSObject* templateObject, uint32_t length);
// jsop_newobject helpers.
- MOZ_MUST_USE bool newObjectTrySharedStub(bool* emitted);
- MOZ_MUST_USE bool newObjectTryTemplateObject(bool* emitted, JSObject* templateObject);
- MOZ_MUST_USE bool newObjectTryVM(bool* emitted, JSObject* templateObject);
+ [[nodiscard]] bool newObjectTrySharedStub(bool* emitted);
+ [[nodiscard]] bool newObjectTryTemplateObject(bool* emitted, JSObject* templateObject);
+ [[nodiscard]] bool newObjectTryVM(bool* emitted, JSObject* templateObject);
// jsop_in helpers.
- MOZ_MUST_USE bool inTryDense(bool* emitted, MDefinition* obj, MDefinition* id);
- MOZ_MUST_USE bool inTryFold(bool* emitted, MDefinition* obj, MDefinition* id);
+ [[nodiscard]] bool inTryDense(bool* emitted, MDefinition* obj, MDefinition* id);
+ [[nodiscard]] bool inTryFold(bool* emitted, MDefinition* obj, MDefinition* id);
// binary data lookup helpers.
TypedObjectPrediction typedObjectPrediction(MDefinition* typedObj);
TypedObjectPrediction typedObjectPrediction(TemporaryTypeSet* types);
- MOZ_MUST_USE bool typedObjectHasField(MDefinition* typedObj,
+ [[nodiscard]] bool typedObjectHasField(MDefinition* typedObj,
PropertyName* name,
size_t* fieldOffset,
TypedObjectPrediction* fieldTypeReprs,
@@ -572,87 +572,87 @@ class IonBuilder
MDefinition* typeObjectForElementFromArrayStructType(MDefinition* typedObj);
MDefinition* typeObjectForFieldFromStructType(MDefinition* type,
size_t fieldIndex);
- MOZ_MUST_USE bool storeReferenceTypedObjectValue(MDefinition* typedObj,
+ [[nodiscard]] bool storeReferenceTypedObjectValue(MDefinition* typedObj,
const LinearSum& byteOffset,
ReferenceTypeDescr::Type type,
MDefinition* value,
PropertyName* name);
- MOZ_MUST_USE bool storeScalarTypedObjectValue(MDefinition* typedObj,
+ [[nodiscard]] bool storeScalarTypedObjectValue(MDefinition* typedObj,
const LinearSum& byteOffset,
ScalarTypeDescr::Type type,
MDefinition* value);
- MOZ_MUST_USE bool checkTypedObjectIndexInBounds(uint32_t elemSize,
+ [[nodiscard]] bool checkTypedObjectIndexInBounds(uint32_t elemSize,
MDefinition* obj,
MDefinition* index,
TypedObjectPrediction objTypeDescrs,
LinearSum* indexAsByteOffset);
- MOZ_MUST_USE bool pushDerivedTypedObject(bool* emitted,
+ [[nodiscard]] bool pushDerivedTypedObject(bool* emitted,
MDefinition* obj,
const LinearSum& byteOffset,
TypedObjectPrediction derivedTypeDescrs,
MDefinition* derivedTypeObj);
- MOZ_MUST_USE bool pushScalarLoadFromTypedObject(MDefinition* obj,
+ [[nodiscard]] bool pushScalarLoadFromTypedObject(MDefinition* obj,
const LinearSum& byteoffset,
ScalarTypeDescr::Type type);
- MOZ_MUST_USE bool pushReferenceLoadFromTypedObject(MDefinition* typedObj,
+ [[nodiscard]] bool pushReferenceLoadFromTypedObject(MDefinition* typedObj,
const LinearSum& byteOffset,
ReferenceTypeDescr::Type type,
PropertyName* name);
JSObject* getStaticTypedArrayObject(MDefinition* obj, MDefinition* index);
// jsop_setelem() helpers.
- MOZ_MUST_USE bool setElemTryTypedArray(bool* emitted, MDefinition* object,
+ [[nodiscard]] bool setElemTryTypedArray(bool* emitted, MDefinition* object,
MDefinition* index, MDefinition* value);
- MOZ_MUST_USE bool setElemTryTypedObject(bool* emitted, MDefinition* obj,
+ [[nodiscard]] bool setElemTryTypedObject(bool* emitted, MDefinition* obj,
MDefinition* index, MDefinition* value);
- MOZ_MUST_USE bool setElemTryTypedStatic(bool* emitted, MDefinition* object,
+ [[nodiscard]] bool setElemTryTypedStatic(bool* emitted, MDefinition* object,
MDefinition* index, MDefinition* value);
- MOZ_MUST_USE bool setElemTryDense(bool* emitted, MDefinition* object,
+ [[nodiscard]] bool setElemTryDense(bool* emitted, MDefinition* object,
MDefinition* index, MDefinition* value, bool writeHole);
- MOZ_MUST_USE bool setElemTryArguments(bool* emitted, MDefinition* object,
+ [[nodiscard]] bool setElemTryArguments(bool* emitted, MDefinition* object,
MDefinition* index, MDefinition* value);
- MOZ_MUST_USE bool setElemTryCache(bool* emitted, MDefinition* object,
+ [[nodiscard]] bool setElemTryCache(bool* emitted, MDefinition* object,
MDefinition* index, MDefinition* value);
- MOZ_MUST_USE bool setElemTryReferenceElemOfTypedObject(bool* emitted,
+ [[nodiscard]] bool setElemTryReferenceElemOfTypedObject(bool* emitted,
MDefinition* obj,
MDefinition* index,
TypedObjectPrediction objPrediction,
MDefinition* value,
TypedObjectPrediction elemPrediction);
- MOZ_MUST_USE bool setElemTryScalarElemOfTypedObject(bool* emitted,
+ [[nodiscard]] bool setElemTryScalarElemOfTypedObject(bool* emitted,
MDefinition* obj,
MDefinition* index,
TypedObjectPrediction objTypeReprs,
MDefinition* value,
TypedObjectPrediction elemTypeReprs,
uint32_t elemSize);
- MOZ_MUST_USE bool initializeArrayElement(MDefinition* obj, size_t index, MDefinition* value,
+ [[nodiscard]] bool initializeArrayElement(MDefinition* obj, size_t index, MDefinition* value,
JSValueType unboxedType,
bool addResumePointAndIncrementInitializedLength);
// jsop_getelem() helpers.
- MOZ_MUST_USE bool getElemTryDense(bool* emitted, MDefinition* obj, MDefinition* index);
- MOZ_MUST_USE bool getElemTryGetProp(bool* emitted, MDefinition* obj, MDefinition* index);
- MOZ_MUST_USE bool getElemTryTypedStatic(bool* emitted, MDefinition* obj, MDefinition* index);
- MOZ_MUST_USE bool getElemTryTypedArray(bool* emitted, MDefinition* obj, MDefinition* index);
- MOZ_MUST_USE bool getElemTryTypedObject(bool* emitted, MDefinition* obj, MDefinition* index);
- MOZ_MUST_USE bool getElemTryString(bool* emitted, MDefinition* obj, MDefinition* index);
- MOZ_MUST_USE bool getElemTryArguments(bool* emitted, MDefinition* obj, MDefinition* index);
- MOZ_MUST_USE bool getElemTryArgumentsInlined(bool* emitted, MDefinition* obj,
+ [[nodiscard]] bool getElemTryDense(bool* emitted, MDefinition* obj, MDefinition* index);
+ [[nodiscard]] bool getElemTryGetProp(bool* emitted, MDefinition* obj, MDefinition* index);
+ [[nodiscard]] bool getElemTryTypedStatic(bool* emitted, MDefinition* obj, MDefinition* index);
+ [[nodiscard]] bool getElemTryTypedArray(bool* emitted, MDefinition* obj, MDefinition* index);
+ [[nodiscard]] bool getElemTryTypedObject(bool* emitted, MDefinition* obj, MDefinition* index);
+ [[nodiscard]] bool getElemTryString(bool* emitted, MDefinition* obj, MDefinition* index);
+ [[nodiscard]] bool getElemTryArguments(bool* emitted, MDefinition* obj, MDefinition* index);
+ [[nodiscard]] bool getElemTryArgumentsInlined(bool* emitted, MDefinition* obj,
MDefinition* index);
- MOZ_MUST_USE bool getElemTryCache(bool* emitted, MDefinition* obj, MDefinition* index);
- MOZ_MUST_USE bool getElemTryScalarElemOfTypedObject(bool* emitted,
+ [[nodiscard]] bool getElemTryCache(bool* emitted, MDefinition* obj, MDefinition* index);
+ [[nodiscard]] bool getElemTryScalarElemOfTypedObject(bool* emitted,
MDefinition* obj,
MDefinition* index,
TypedObjectPrediction objTypeReprs,
TypedObjectPrediction elemTypeReprs,
uint32_t elemSize);
- MOZ_MUST_USE bool getElemTryReferenceElemOfTypedObject(bool* emitted,
+ [[nodiscard]] bool getElemTryReferenceElemOfTypedObject(bool* emitted,
MDefinition* obj,
MDefinition* index,
TypedObjectPrediction objPrediction,
TypedObjectPrediction elemPrediction);
- MOZ_MUST_USE bool getElemTryComplexElemOfTypedObject(bool* emitted,
+ [[nodiscard]] bool getElemTryComplexElemOfTypedObject(bool* emitted,
MDefinition* obj,
MDefinition* index,
TypedObjectPrediction objTypeReprs,
@@ -683,7 +683,7 @@ class IonBuilder
return length;
}
- MOZ_MUST_USE bool improveThisTypesForCall();
+ [[nodiscard]] bool improveThisTypesForCall();
MDefinition* getCallee();
MDefinition* getAliasedVar(EnvironmentCoordinate ec);
@@ -691,118 +691,118 @@ class IonBuilder
MDefinition* convertToBoolean(MDefinition* input);
- MOZ_MUST_USE bool tryFoldInstanceOf(MDefinition* lhs, JSObject* protoObject);
- MOZ_MUST_USE bool hasOnProtoChain(TypeSet::ObjectKey* key, JSObject* protoObject,
+ [[nodiscard]] bool tryFoldInstanceOf(MDefinition* lhs, JSObject* protoObject);
+ [[nodiscard]] bool hasOnProtoChain(TypeSet::ObjectKey* key, JSObject* protoObject,
bool* hasOnProto);
- MOZ_MUST_USE bool jsop_add(MDefinition* left, MDefinition* right);
- MOZ_MUST_USE bool jsop_bitnot();
- MOZ_MUST_USE bool jsop_bitop(JSOp op);
- MOZ_MUST_USE bool jsop_binary_arith(JSOp op);
- MOZ_MUST_USE bool jsop_binary_arith(JSOp op, MDefinition* left, MDefinition* right);
- MOZ_MUST_USE bool jsop_pow();
- MOZ_MUST_USE bool jsop_pos();
- MOZ_MUST_USE bool jsop_neg();
- MOZ_MUST_USE bool jsop_tonumeric();
- MOZ_MUST_USE bool jsop_inc_or_dec(JSOp op);
- MOZ_MUST_USE bool jsop_tostring();
- MOZ_MUST_USE bool jsop_setarg(uint32_t arg);
- MOZ_MUST_USE bool jsop_defvar(uint32_t index);
- MOZ_MUST_USE bool jsop_deflexical(uint32_t index);
- MOZ_MUST_USE bool jsop_deffun(uint32_t index);
- MOZ_MUST_USE bool jsop_notearg();
- MOZ_MUST_USE bool jsop_throwsetconst();
- MOZ_MUST_USE bool jsop_checklexical();
- MOZ_MUST_USE bool jsop_checkaliasedlexical(EnvironmentCoordinate ec);
- MOZ_MUST_USE bool jsop_funcall(uint32_t argc);
- MOZ_MUST_USE bool jsop_funapply(uint32_t argc);
- MOZ_MUST_USE bool jsop_funapplyarguments(uint32_t argc);
- MOZ_MUST_USE bool jsop_funapplyarray(uint32_t argc);
- MOZ_MUST_USE bool jsop_call(uint32_t argc, bool constructing);
- MOZ_MUST_USE bool jsop_call(uint32_t argc, bool constructing, bool ignoresReturnValue);
- MOZ_MUST_USE bool jsop_eval(uint32_t argc);
- MOZ_MUST_USE bool jsop_ifeq(JSOp op);
- MOZ_MUST_USE bool jsop_try();
- MOZ_MUST_USE bool jsop_label();
- MOZ_MUST_USE bool jsop_condswitch();
- MOZ_MUST_USE bool jsop_logical(JSOp op);
- MOZ_MUST_USE bool jsop_dup2();
- MOZ_MUST_USE bool jsop_loophead(jsbytecode* pc);
- MOZ_MUST_USE bool jsop_compare(JSOp op);
- MOZ_MUST_USE bool jsop_compare(JSOp op, MDefinition* left, MDefinition* right);
- MOZ_MUST_USE bool getStaticName(JSObject* staticObject, PropertyName* name, bool* psucceeded,
+ [[nodiscard]] bool jsop_add(MDefinition* left, MDefinition* right);
+ [[nodiscard]] bool jsop_bitnot();
+ [[nodiscard]] bool jsop_bitop(JSOp op);
+ [[nodiscard]] bool jsop_binary_arith(JSOp op);
+ [[nodiscard]] bool jsop_binary_arith(JSOp op, MDefinition* left, MDefinition* right);
+ [[nodiscard]] bool jsop_pow();
+ [[nodiscard]] bool jsop_pos();
+ [[nodiscard]] bool jsop_neg();
+ [[nodiscard]] bool jsop_tonumeric();
+ [[nodiscard]] bool jsop_inc_or_dec(JSOp op);
+ [[nodiscard]] bool jsop_tostring();
+ [[nodiscard]] bool jsop_setarg(uint32_t arg);
+ [[nodiscard]] bool jsop_defvar(uint32_t index);
+ [[nodiscard]] bool jsop_deflexical(uint32_t index);
+ [[nodiscard]] bool jsop_deffun(uint32_t index);
+ [[nodiscard]] bool jsop_notearg();
+ [[nodiscard]] bool jsop_throwsetconst();
+ [[nodiscard]] bool jsop_checklexical();
+ [[nodiscard]] bool jsop_checkaliasedlexical(EnvironmentCoordinate ec);
+ [[nodiscard]] bool jsop_funcall(uint32_t argc);
+ [[nodiscard]] bool jsop_funapply(uint32_t argc);
+ [[nodiscard]] bool jsop_funapplyarguments(uint32_t argc);
+ [[nodiscard]] bool jsop_funapplyarray(uint32_t argc);
+ [[nodiscard]] bool jsop_call(uint32_t argc, bool constructing);
+ [[nodiscard]] bool jsop_call(uint32_t argc, bool constructing, bool ignoresReturnValue);
+ [[nodiscard]] bool jsop_eval(uint32_t argc);
+ [[nodiscard]] bool jsop_ifeq(JSOp op);
+ [[nodiscard]] bool jsop_try();
+ [[nodiscard]] bool jsop_label();
+ [[nodiscard]] bool jsop_condswitch();
+ [[nodiscard]] bool jsop_logical(JSOp op);
+ [[nodiscard]] bool jsop_dup2();
+ [[nodiscard]] bool jsop_loophead(jsbytecode* pc);
+ [[nodiscard]] bool jsop_compare(JSOp op);
+ [[nodiscard]] bool jsop_compare(JSOp op, MDefinition* left, MDefinition* right);
+ [[nodiscard]] bool getStaticName(JSObject* staticObject, PropertyName* name, bool* psucceeded,
MDefinition* lexicalCheck = nullptr);
- MOZ_MUST_USE bool loadStaticSlot(JSObject* staticObject, BarrierKind barrier,
+ [[nodiscard]] bool loadStaticSlot(JSObject* staticObject, BarrierKind barrier,
TemporaryTypeSet* types, uint32_t slot);
- MOZ_MUST_USE bool setStaticName(JSObject* staticObject, PropertyName* name);
- MOZ_MUST_USE bool jsop_getgname(PropertyName* name);
- MOZ_MUST_USE bool jsop_getname(PropertyName* name);
- MOZ_MUST_USE bool jsop_intrinsic(PropertyName* name);
- MOZ_MUST_USE bool jsop_getimport(PropertyName* name);
- MOZ_MUST_USE bool jsop_bindname(PropertyName* name);
- MOZ_MUST_USE bool jsop_bindvar();
- MOZ_MUST_USE bool jsop_getelem();
- MOZ_MUST_USE bool jsop_getelem_dense(MDefinition* obj, MDefinition* index,
+ [[nodiscard]] bool setStaticName(JSObject* staticObject, PropertyName* name);
+ [[nodiscard]] bool jsop_getgname(PropertyName* name);
+ [[nodiscard]] bool jsop_getname(PropertyName* name);
+ [[nodiscard]] bool jsop_intrinsic(PropertyName* name);
+ [[nodiscard]] bool jsop_getimport(PropertyName* name);
+ [[nodiscard]] bool jsop_bindname(PropertyName* name);
+ [[nodiscard]] bool jsop_bindvar();
+ [[nodiscard]] bool jsop_getelem();
+ [[nodiscard]] bool jsop_getelem_dense(MDefinition* obj, MDefinition* index,
JSValueType unboxedType);
- MOZ_MUST_USE bool jsop_getelem_typed(MDefinition* obj, MDefinition* index,
+ [[nodiscard]] bool jsop_getelem_typed(MDefinition* obj, MDefinition* index,
ScalarTypeDescr::Type arrayType);
- MOZ_MUST_USE bool jsop_setelem();
- MOZ_MUST_USE bool jsop_setelem_dense(TemporaryTypeSet::DoubleConversion conversion,
+ [[nodiscard]] bool jsop_setelem();
+ [[nodiscard]] bool jsop_setelem_dense(TemporaryTypeSet::DoubleConversion conversion,
MDefinition* object, MDefinition* index,
MDefinition* value, JSValueType unboxedType,
bool writeHole, bool* emitted);
- MOZ_MUST_USE bool jsop_setelem_typed(ScalarTypeDescr::Type arrayType,
+ [[nodiscard]] bool jsop_setelem_typed(ScalarTypeDescr::Type arrayType,
MDefinition* object, MDefinition* index,
MDefinition* value);
- MOZ_MUST_USE bool jsop_length();
- MOZ_MUST_USE bool jsop_length_fastPath();
- MOZ_MUST_USE bool jsop_arguments();
- MOZ_MUST_USE bool jsop_arguments_getelem();
- MOZ_MUST_USE bool jsop_runonce();
- MOZ_MUST_USE bool jsop_rest();
- MOZ_MUST_USE bool jsop_not();
- MOZ_MUST_USE bool jsop_getprop(PropertyName* name);
- MOZ_MUST_USE bool jsop_setprop(PropertyName* name);
- MOZ_MUST_USE bool jsop_delprop(PropertyName* name);
- MOZ_MUST_USE bool jsop_delelem();
- MOZ_MUST_USE bool jsop_newarray(uint32_t length);
- MOZ_MUST_USE bool jsop_newarray(JSObject* templateObject, uint32_t length);
- MOZ_MUST_USE bool jsop_newarray_copyonwrite();
- MOZ_MUST_USE bool jsop_newobject();
- MOZ_MUST_USE bool jsop_initelem();
- MOZ_MUST_USE bool jsop_initelem_array();
- MOZ_MUST_USE bool jsop_initelem_getter_setter();
- MOZ_MUST_USE bool jsop_mutateproto();
- MOZ_MUST_USE bool jsop_initprop(PropertyName* name);
- MOZ_MUST_USE bool jsop_initprop_getter_setter(PropertyName* name);
- MOZ_MUST_USE bool jsop_regexp(RegExpObject* reobj);
- MOZ_MUST_USE bool jsop_object(JSObject* obj);
- MOZ_MUST_USE bool jsop_lambda(JSFunction* fun);
- MOZ_MUST_USE bool jsop_lambda_arrow(JSFunction* fun);
- MOZ_MUST_USE bool jsop_setfunname(uint8_t prefixKind);
- MOZ_MUST_USE bool jsop_functionthis();
- MOZ_MUST_USE bool jsop_globalthis();
- MOZ_MUST_USE bool jsop_typeof();
- MOZ_MUST_USE bool jsop_toasync();
- MOZ_MUST_USE bool jsop_toasyncgen();
- MOZ_MUST_USE bool jsop_toasynciter();
- MOZ_MUST_USE bool jsop_toid();
- MOZ_MUST_USE bool jsop_iter(uint8_t flags);
- MOZ_MUST_USE bool jsop_itermore();
- MOZ_MUST_USE bool jsop_isnoiter();
- MOZ_MUST_USE bool jsop_iterend();
- MOZ_MUST_USE bool jsop_in();
- MOZ_MUST_USE bool jsop_instanceof();
- MOZ_MUST_USE bool jsop_getaliasedvar(EnvironmentCoordinate ec);
- MOZ_MUST_USE bool jsop_setaliasedvar(EnvironmentCoordinate ec);
- MOZ_MUST_USE bool jsop_debugger();
- MOZ_MUST_USE bool jsop_newtarget();
- MOZ_MUST_USE bool jsop_checkisobj(uint8_t kind);
- MOZ_MUST_USE bool jsop_checkiscallable(uint8_t kind);
- MOZ_MUST_USE bool jsop_checkobjcoercible();
- MOZ_MUST_USE bool jsop_pushcallobj();
- MOZ_MUST_USE bool jsop_importmeta();
- MOZ_MUST_USE bool jsop_dynamic_import();
+ [[nodiscard]] bool jsop_length();
+ [[nodiscard]] bool jsop_length_fastPath();
+ [[nodiscard]] bool jsop_arguments();
+ [[nodiscard]] bool jsop_arguments_getelem();
+ [[nodiscard]] bool jsop_runonce();
+ [[nodiscard]] bool jsop_rest();
+ [[nodiscard]] bool jsop_not();
+ [[nodiscard]] bool jsop_getprop(PropertyName* name);
+ [[nodiscard]] bool jsop_setprop(PropertyName* name);
+ [[nodiscard]] bool jsop_delprop(PropertyName* name);
+ [[nodiscard]] bool jsop_delelem();
+ [[nodiscard]] bool jsop_newarray(uint32_t length);
+ [[nodiscard]] bool jsop_newarray(JSObject* templateObject, uint32_t length);
+ [[nodiscard]] bool jsop_newarray_copyonwrite();
+ [[nodiscard]] bool jsop_newobject();
+ [[nodiscard]] bool jsop_initelem();
+ [[nodiscard]] bool jsop_initelem_array();
+ [[nodiscard]] bool jsop_initelem_getter_setter();
+ [[nodiscard]] bool jsop_mutateproto();
+ [[nodiscard]] bool jsop_initprop(PropertyName* name);
+ [[nodiscard]] bool jsop_initprop_getter_setter(PropertyName* name);
+ [[nodiscard]] bool jsop_regexp(RegExpObject* reobj);
+ [[nodiscard]] bool jsop_object(JSObject* obj);
+ [[nodiscard]] bool jsop_lambda(JSFunction* fun);
+ [[nodiscard]] bool jsop_lambda_arrow(JSFunction* fun);
+ [[nodiscard]] bool jsop_setfunname(uint8_t prefixKind);
+ [[nodiscard]] bool jsop_functionthis();
+ [[nodiscard]] bool jsop_globalthis();
+ [[nodiscard]] bool jsop_typeof();
+ [[nodiscard]] bool jsop_toasync();
+ [[nodiscard]] bool jsop_toasyncgen();
+ [[nodiscard]] bool jsop_toasynciter();
+ [[nodiscard]] bool jsop_toid();
+ [[nodiscard]] bool jsop_iter(uint8_t flags);
+ [[nodiscard]] bool jsop_itermore();
+ [[nodiscard]] bool jsop_isnoiter();
+ [[nodiscard]] bool jsop_iterend();
+ [[nodiscard]] bool jsop_in();
+ [[nodiscard]] bool jsop_instanceof();
+ [[nodiscard]] bool jsop_getaliasedvar(EnvironmentCoordinate ec);
+ [[nodiscard]] bool jsop_setaliasedvar(EnvironmentCoordinate ec);
+ [[nodiscard]] bool jsop_debugger();
+ [[nodiscard]] bool jsop_newtarget();
+ [[nodiscard]] bool jsop_checkisobj(uint8_t kind);
+ [[nodiscard]] bool jsop_checkiscallable(uint8_t kind);
+ [[nodiscard]] bool jsop_checkobjcoercible();
+ [[nodiscard]] bool jsop_pushcallobj();
+ [[nodiscard]] bool jsop_importmeta();
+ [[nodiscard]] bool jsop_dynamic_import();
/* Inlining. */
@@ -830,7 +830,7 @@ class IonBuilder
// Oracles.
InliningDecision canInlineTarget(JSFunction* target, CallInfo& callInfo);
InliningDecision makeInliningDecision(JSObject* target, CallInfo& callInfo);
- MOZ_MUST_USE bool selectInliningTargets(const ObjectVector& targets, CallInfo& callInfo,
+ [[nodiscard]] bool selectInliningTargets(const ObjectVector& targets, CallInfo& callInfo,
BoolVector& choiceSet, uint32_t* numInlineable);
// Native inlining helpers.
@@ -962,13 +962,13 @@ class IonBuilder
// Call functions
InliningStatus inlineCallsite(const ObjectVector& targets, CallInfo& callInfo);
- MOZ_MUST_USE bool inlineCalls(CallInfo& callInfo, const ObjectVector& targets,
+ [[nodiscard]] bool inlineCalls(CallInfo& callInfo, const ObjectVector& targets,
BoolVector& choiceSet, MGetPropertyCache* maybeCache);
// Inlining helpers.
- MOZ_MUST_USE bool inlineGenericFallback(JSFunction* target, CallInfo& callInfo,
+ [[nodiscard]] bool inlineGenericFallback(JSFunction* target, CallInfo& callInfo,
MBasicBlock* dispatchBlock);
- MOZ_MUST_USE bool inlineObjectGroupFallback(CallInfo& callInfo, MBasicBlock* dispatchBlock,
+ [[nodiscard]] bool inlineObjectGroupFallback(CallInfo& callInfo, MBasicBlock* dispatchBlock,
MObjectGroupDispatch* dispatch,
MGetPropertyCache* cache,
MBasicBlock** fallbackTarget);
@@ -978,22 +978,22 @@ class IonBuilder
DoCheckAtomicResult
};
- MOZ_MUST_USE bool atomicsMeetsPreconditions(CallInfo& callInfo, Scalar::Type* arrayElementType,
+ [[nodiscard]] bool atomicsMeetsPreconditions(CallInfo& callInfo, Scalar::Type* arrayElementType,
bool* requiresDynamicCheck,
AtomicCheckResult checkResult=DoCheckAtomicResult);
void atomicsCheckBounds(CallInfo& callInfo, MInstruction** elements, MDefinition** index);
- MOZ_MUST_USE bool testNeedsArgumentCheck(JSFunction* target, CallInfo& callInfo);
+ [[nodiscard]] bool testNeedsArgumentCheck(JSFunction* target, CallInfo& callInfo);
MCall* makeCallHelper(JSFunction* target, CallInfo& callInfo);
- MOZ_MUST_USE bool makeCall(JSFunction* target, CallInfo& callInfo);
+ [[nodiscard]] bool makeCall(JSFunction* target, CallInfo& callInfo);
MDefinition* patchInlinedReturn(CallInfo& callInfo, MBasicBlock* exit, MBasicBlock* bottom);
MDefinition* patchInlinedReturns(CallInfo& callInfo, MIRGraphReturns& returns,
MBasicBlock* bottom);
MDefinition* specializeInlinedReturn(MDefinition* rdef, MBasicBlock* exit);
- MOZ_MUST_USE bool objectsHaveCommonPrototype(TemporaryTypeSet* types, PropertyName* name,
+ [[nodiscard]] bool objectsHaveCommonPrototype(TemporaryTypeSet* types, PropertyName* name,
bool isGetter, JSObject* foundProto,
bool* guardGlobal);
void freezePropertiesForCommonPrototype(TemporaryTypeSet* types, PropertyName* name,
@@ -1001,12 +1001,12 @@ class IonBuilder
/*
* Callers must pass a non-null globalGuard if they pass a non-null globalShape.
*/
- MOZ_MUST_USE bool testCommonGetterSetter(TemporaryTypeSet* types, PropertyName* name,
+ [[nodiscard]] bool testCommonGetterSetter(TemporaryTypeSet* types, PropertyName* name,
bool isGetter, JSObject* foundProto,
Shape* lastProperty, JSFunction* getterOrSetter,
MDefinition** guard, Shape* globalShape = nullptr,
MDefinition** globalGuard = nullptr);
- MOZ_MUST_USE bool testShouldDOMCall(TypeSet* inTypes,
+ [[nodiscard]] bool testShouldDOMCall(TypeSet* inTypes,
JSFunction* func, JSJitInfo::OpType opType);
MDefinition*
@@ -1015,7 +1015,7 @@ class IonBuilder
const BaselineInspector::ObjectGroupVector& convertUnboxedGroups,
bool isOwnProperty);
- MOZ_MUST_USE bool annotateGetPropertyCache(MDefinition* obj, PropertyName* name,
+ [[nodiscard]] bool annotateGetPropertyCache(MDefinition* obj, PropertyName* name,
MGetPropertyCache* getPropCache,
TemporaryTypeSet* objTypes,
TemporaryTypeSet* pushedTypes);
@@ -1046,8 +1046,8 @@ class IonBuilder
MDefinition* elements, int32_t elementsOffset,
MDefinition* scaledOffset, JSValueType unboxedType,
MDefinition* value, bool preBarrier = true);
- MOZ_MUST_USE bool checkPreliminaryGroups(MDefinition *obj);
- MOZ_MUST_USE bool freezePropTypeSets(TemporaryTypeSet* types,
+ [[nodiscard]] bool checkPreliminaryGroups(MDefinition *obj);
+ [[nodiscard]] bool freezePropTypeSets(TemporaryTypeSet* types,
JSObject* foundProto, PropertyName* name);
bool canInlinePropertyOpShapes(const BaselineInspector::ReceiverVector& receivers);
@@ -1057,7 +1057,7 @@ class IonBuilder
// updating |current| directly. setCurrent() should only be used in cases
// where the block cannot have phis whose type needs to be computed.
- MOZ_MUST_USE bool setCurrentAndSpecializePhis(MBasicBlock* block) {
+ [[nodiscard]] bool setCurrentAndSpecializePhis(MBasicBlock* block) {
if (block) {
if (!block->specializePhis(alloc()))
return false;
@@ -1140,7 +1140,7 @@ class IonBuilder
void trace(JSTracer* trc);
private:
- MOZ_MUST_USE bool init();
+ [[nodiscard]] bool init();
JSContext* analysisContext;
BaselineFrameInspector* baselineFrame_;
@@ -1368,7 +1368,7 @@ class CallInfo
setter_(false)
{ }
- MOZ_MUST_USE bool init(CallInfo& callInfo) {
+ [[nodiscard]] bool init(CallInfo& callInfo) {
MOZ_ASSERT(constructing_ == callInfo.constructing());
fun_ = callInfo.fun();
@@ -1384,7 +1384,7 @@ class CallInfo
return true;
}
- MOZ_MUST_USE bool init(MBasicBlock* current, uint32_t argc) {
+ [[nodiscard]] bool init(MBasicBlock* current, uint32_t argc) {
MOZ_ASSERT(args_.empty());
// Get the arguments in the right order
@@ -1427,7 +1427,7 @@ class CallInfo
return argc() + 2 + constructing();
}
- MOZ_MUST_USE bool setArgs(const MDefinitionVector& args) {
+ [[nodiscard]] bool setArgs(const MDefinitionVector& args) {
MOZ_ASSERT(args_.empty());
return args_.appendAll(args);
}