summaryrefslogtreecommitdiff
path: root/js/src/jit/SharedIC.h
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit/SharedIC.h')
-rw-r--r--js/src/jit/SharedIC.h104
1 files changed, 52 insertions, 52 deletions
diff --git a/js/src/jit/SharedIC.h b/js/src/jit/SharedIC.h
index d259ebf0bc..dcc615a608 100644
--- a/js/src/jit/SharedIC.h
+++ b/js/src/jit/SharedIC.h
@@ -939,10 +939,10 @@ class ICUpdatedStub : public ICStub
{}
public:
- MOZ_MUST_USE bool initUpdatingChain(JSContext* cx, ICStubSpace* space);
+ [[nodiscard]] bool initUpdatingChain(JSContext* cx, ICStubSpace* space);
- MOZ_MUST_USE bool addUpdateStubForValue(JSContext* cx, HandleScript script, HandleObject obj,
- HandleId id, HandleValue val);
+ [[nodiscard]] bool addUpdateStubForValue(JSContext* cx, HandleScript script, HandleObject obj,
+ HandleId id, HandleValue val);
void addOptimizedUpdateStub(ICStub* stub) {
if (firstUpdateStub_->isTypeUpdate_Fallback()) {
@@ -1015,7 +1015,7 @@ class ICStubCompiler
(static_cast<int32_t>(kind) << 1);
}
- virtual MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) = 0;
+ [[nodiscard]] virtual bool generateStubCode(MacroAssembler& masm) = 0;
virtual void postGenerateStubCode(MacroAssembler& masm, Handle<JitCode*> genCode) {}
JitCode* getStubCode();
@@ -1032,14 +1032,14 @@ class ICStubCompiler
void pushStubPayload(MacroAssembler& masm, Register scratch);
// Emits a tail call to a VMFunction wrapper.
- MOZ_MUST_USE bool tailCallVM(const VMFunction& fun, MacroAssembler& masm);
+ [[nodiscard]] bool tailCallVM(const VMFunction& fun, MacroAssembler& masm);
// Emits a normal (non-tail) call to a VMFunction wrapper.
- MOZ_MUST_USE bool callVM(const VMFunction& fun, MacroAssembler& masm);
+ [[nodiscard]] bool callVM(const VMFunction& fun, MacroAssembler& masm);
// Emits a call to a type-update IC, assuming that the value to be
// checked is already in R0.
- MOZ_MUST_USE bool callTypeUpdateIC(MacroAssembler& masm, uint32_t objectOffset);
+ [[nodiscard]] bool callTypeUpdateIC(MacroAssembler& masm, uint32_t objectOffset);
// A stub frame is used when a stub wants to call into the VM without
// performing a tail call. This is required for the return address
@@ -1180,9 +1180,9 @@ class ICMonitoredFallbackStub : public ICFallbackStub
fallbackMonitorStub_(nullptr) {}
public:
- MOZ_MUST_USE bool initMonitoringChain(JSContext* cx, ICStubSpace* space,
+ [[nodiscard]] bool initMonitoringChain(JSContext* cx, ICStubSpace* space,
ICStubCompiler::Engine engine);
- MOZ_MUST_USE bool addMonitorStubForValue(JSContext* cx, SharedStubInfo* info, HandleValue val);
+ [[nodiscard]] bool addMonitorStubForValue(JSContext* cx, SharedStubInfo* info, HandleValue val);
inline ICTypeMonitor_Fallback* fallbackMonitorStub() const {
return fallbackMonitorStub_;
@@ -1442,7 +1442,7 @@ class ICTypeMonitor_Fallback : public ICStub
// Create a new monitor stub for the type of the given value, and
// add it to this chain.
- MOZ_MUST_USE bool addMonitorStubForValue(JSContext* cx, SharedStubInfo* info, HandleValue val);
+ [[nodiscard]] bool addMonitorStubForValue(JSContext* cx, SharedStubInfo* info, HandleValue val);
void resetMonitorStubChain(Zone* zone);
@@ -1452,7 +1452,7 @@ class ICTypeMonitor_Fallback : public ICStub
uint32_t argumentIndex_;
protected:
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, Engine engine, ICMonitoredFallbackStub* mainFallbackStub)
@@ -1485,7 +1485,7 @@ class ICTypeMonitor_PrimitiveSet : public TypeCheckPrimitiveSetStub
public:
class Compiler : public TypeCheckPrimitiveSetStub::Compiler {
protected:
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, Engine engine, ICTypeMonitor_PrimitiveSet* existingStub,
@@ -1529,7 +1529,7 @@ class ICTypeMonitor_SingleObject : public ICStub
class Compiler : public ICStubCompiler {
protected:
HandleObject obj_;
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, HandleObject obj)
@@ -1563,7 +1563,7 @@ class ICTypeMonitor_ObjectGroup : public ICStub
class Compiler : public ICStubCompiler {
protected:
HandleObjectGroup group_;
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, HandleObjectGroup group)
@@ -1615,7 +1615,7 @@ class ICBinaryArith_Fallback : public ICFallbackStub
// Compiler for this stub kind.
class Compiler : public ICStubCompiler {
protected:
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
explicit Compiler(JSContext* cx, Engine engine)
@@ -1648,7 +1648,7 @@ class ICBinaryArith_Int32 : public ICStub
JSOp op_;
bool allowDouble_;
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
// Stub keys shift-stubs need to encode the kind, the JSOp and if we allow doubles.
virtual int32_t getKey() const {
@@ -1680,7 +1680,7 @@ class ICBinaryArith_StringConcat : public ICStub
public:
class Compiler : public ICStubCompiler {
protected:
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
explicit Compiler(JSContext* cx, Engine engine)
@@ -1711,7 +1711,7 @@ class ICBinaryArith_StringObjectConcat : public ICStub
class Compiler : public ICStubCompiler {
protected:
bool lhsIsString_;
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
virtual int32_t getKey() const {
return static_cast<int32_t>(engine_) |
@@ -1743,7 +1743,7 @@ class ICBinaryArith_Double : public ICStub
public:
class Compiler : public ICMultiStubCompiler {
protected:
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, JSOp op, Engine engine)
@@ -1785,7 +1785,7 @@ class ICBinaryArith_BooleanWithInt32 : public ICStub
JSOp op_;
bool lhsIsBool_;
bool rhsIsBool_;
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
virtual int32_t getKey() const {
return static_cast<int32_t>(engine_) |
@@ -1830,7 +1830,7 @@ class ICBinaryArith_DoubleWithInt32 : public ICStub
class Compiler : public ICMultiStubCompiler {
protected:
bool lhsIsDouble_;
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
virtual int32_t getKey() const {
return static_cast<int32_t>(engine_) |
@@ -1881,7 +1881,7 @@ class ICUnaryArith_Fallback : public ICFallbackStub
// Compiler for this stub kind.
class Compiler : public ICStubCompiler {
protected:
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
explicit Compiler(JSContext* cx, Engine engine)
@@ -1905,7 +1905,7 @@ class ICUnaryArith_Int32 : public ICStub
public:
class Compiler : public ICMultiStubCompiler {
protected:
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, JSOp op, Engine engine)
@@ -1929,7 +1929,7 @@ class ICUnaryArith_Double : public ICStub
public:
class Compiler : public ICMultiStubCompiler {
protected:
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, JSOp op, Engine engine)
@@ -1973,7 +1973,7 @@ class ICCompare_Fallback : public ICFallbackStub
// Compiler for this stub kind.
class Compiler : public ICStubCompiler {
protected:
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
explicit Compiler(JSContext* cx, Engine engine)
@@ -1996,7 +1996,7 @@ class ICCompare_Int32 : public ICStub
// Compiler for this stub kind.
class Compiler : public ICMultiStubCompiler {
protected:
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, JSOp op, Engine engine)
@@ -2019,7 +2019,7 @@ class ICCompare_Double : public ICStub
public:
class Compiler : public ICMultiStubCompiler {
protected:
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, JSOp op, Engine engine)
@@ -2049,7 +2049,7 @@ class ICCompare_NumberWithUndefined : public ICStub
class Compiler : public ICMultiStubCompiler {
protected:
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
bool lhsIsUndefined;
@@ -2084,7 +2084,7 @@ class ICCompare_String : public ICStub
public:
class Compiler : public ICMultiStubCompiler {
protected:
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, JSOp op, Engine engine)
@@ -2108,7 +2108,7 @@ class ICCompare_Boolean : public ICStub
public:
class Compiler : public ICMultiStubCompiler {
protected:
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, JSOp op, Engine engine)
@@ -2132,7 +2132,7 @@ class ICCompare_Object : public ICStub
public:
class Compiler : public ICMultiStubCompiler {
protected:
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, JSOp op, Engine engine)
@@ -2156,7 +2156,7 @@ class ICCompare_ObjectWithUndefined : public ICStub
public:
class Compiler : public ICMultiStubCompiler {
protected:
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
bool lhsIsUndefined;
bool compareWithNull;
@@ -2202,7 +2202,7 @@ class ICCompare_Int32WithBoolean : public ICStub
protected:
JSOp op_;
bool lhsIsInt32_;
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
virtual int32_t getKey() const {
return static_cast<int32_t>(engine_) |
@@ -2249,7 +2249,7 @@ IsPreliminaryObject(JSObject* obj);
void
StripPreliminaryObjectStubs(JSContext* cx, ICFallbackStub* stub);
-MOZ_MUST_USE bool
+[[nodiscard]] bool
EffectlesslyLookupProperty(JSContext* cx, HandleObject obj, HandleId name,
MutableHandleObject holder, MutableHandle<PropertyResult> prop,
bool* checkDOMProxy=nullptr,
@@ -2268,17 +2268,17 @@ IsCacheableGetPropReadSlot(JSObject* obj, JSObject* holder, Shape* shape, bool i
void
GetFixedOrDynamicSlotOffset(Shape* shape, bool* isFixed, uint32_t* offset);
-MOZ_MUST_USE bool
+[[nodiscard]] bool
IsCacheableGetPropCall(JSContext* cx, JSObject* obj, JSObject* holder, Shape* shape,
bool* isScripted, bool* isTemporarilyUnoptimizable, bool isDOMProxy=false);
-MOZ_MUST_USE bool
+[[nodiscard]] bool
UpdateExistingGetPropCallStubs(ICFallbackStub* fallbackStub,
ICStub::Kind kind,
HandleNativeObject holder,
HandleObject receiver,
HandleFunction getter);
-MOZ_MUST_USE bool
+[[nodiscard]] bool
CheckHasNoSuchProperty(JSContext* cx, JSObject* obj, PropertyName* name,
JSObject** lastProto = nullptr, size_t* protoChainDepthOut = nullptr);
@@ -2287,7 +2287,7 @@ GuardReceiverObject(MacroAssembler& masm, ReceiverGuard guard,
Register object, Register scratch,
size_t receiverGuardOffset, Label* failure);
-MOZ_MUST_USE bool
+[[nodiscard]] bool
GetProtoShapes(JSObject* obj, size_t protoChainDepth, MutableHandle<ShapeVector> shapes);
void
@@ -2302,7 +2302,7 @@ CheckDOMProxyExpandoDoesNotShadow(JSContext* cx, MacroAssembler& masm, Register
void
CheckForTypedObjectWithDetachedStorage(JSContext* cx, MacroAssembler& masm, Label* failure);
-MOZ_MUST_USE bool
+[[nodiscard]] bool
DoCallNativeGetter(JSContext* cx, HandleFunction callee, HandleObject obj,
MutableHandleValue result);
@@ -2344,7 +2344,7 @@ class ICGetProp_Fallback : public ICMonitoredFallbackStub
protected:
uint32_t returnOffset_;
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
void postGenerateStubCode(MacroAssembler& masm, Handle<JitCode*> code);
public:
@@ -2376,7 +2376,7 @@ class ICGetProp_Generic : public ICMonitoredStub
class Compiler : public ICStubCompiler {
protected:
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
ICStub* firstMonitorStub_;
public:
explicit Compiler(JSContext* cx, Engine engine, ICStub* firstMonitorStub)
@@ -2401,7 +2401,7 @@ class ICGetProp_StringLength : public ICStub
public:
class Compiler : public ICStubCompiler {
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
explicit Compiler(JSContext* cx, Engine engine)
@@ -2515,7 +2515,7 @@ class ICGetPropNativeCompiler : public ICStubCompiler
uint32_t offset_;
bool inputDefinitelyObject_;
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
protected:
virtual int32_t getKey() const {
@@ -2695,7 +2695,7 @@ class ICGetProp_CallScripted : public ICGetPropCallGetter
class Compiler : public ICGetPropCallGetter::Compiler {
protected:
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, ICStub* firstMonitorStub, HandleObject obj,
@@ -2770,7 +2770,7 @@ class ICGetPropCallNativeCompiler : public ICGetPropCallGetter::Compiler
{
bool inputDefinitelyObject_;
protected:
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
virtual int32_t getKey() const {
int32_t baseKey = ICGetPropCallGetter::Compiler::getKey();
@@ -2883,9 +2883,9 @@ class ICGetPropCallDOMProxyNativeCompiler : public ICStubCompiler {
RootedFunction getter_;
uint32_t pcOffset_;
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm, Address* internalStructAddr,
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm, Address* internalStructAddr,
Address* generationAddr);
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
ICGetPropCallDOMProxyNativeCompiler(JSContext* cx, ICStub::Kind kind,
@@ -2941,7 +2941,7 @@ class ICGetProp_DOMProxyShadowed : public ICMonitoredStub
RootedPropertyName name_;
uint32_t pcOffset_;
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, Engine engine, ICStub* firstMonitorStub, Handle<ProxyObject*> proxy,
@@ -2973,7 +2973,7 @@ class ICGetProp_ArgumentsLength : public ICStub
protected:
Which which_;
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
virtual int32_t getKey() const {
return static_cast<int32_t>(engine_) |
@@ -3004,7 +3004,7 @@ class ICGetProp_ArgumentsCallee : public ICMonitoredStub
class Compiler : public ICStubCompiler {
protected:
ICStub* firstMonitorStub_;
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, Engine engine, ICStub* firstMonitorStub)
@@ -3039,7 +3039,7 @@ class ICNewArray_Fallback : public ICFallbackStub
public:
class Compiler : public ICStubCompiler {
RootedObjectGroup templateGroup;
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, ObjectGroup* templateGroup, Engine engine)
@@ -3085,7 +3085,7 @@ class ICNewObject_Fallback : public ICFallbackStub
public:
class Compiler : public ICStubCompiler {
- MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+ [[nodiscard]] bool generateStubCode(MacroAssembler& masm);
public:
explicit Compiler(JSContext* cx, Engine engine)