summaryrefslogtreecommitdiff
path: root/js/src/jit/TypePolicy.h
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit/TypePolicy.h')
-rw-r--r--js/src/jit/TypePolicy.h124
1 files changed, 62 insertions, 62 deletions
diff --git a/js/src/jit/TypePolicy.h b/js/src/jit/TypePolicy.h
index 0b9d2b37ef..8ab241ab00 100644
--- a/js/src/jit/TypePolicy.h
+++ b/js/src/jit/TypePolicy.h
@@ -29,7 +29,7 @@ class TypePolicy
// * If untyped, optionally ask the input to try and specialize its value.
// * Replace the operand with a conversion instruction.
// * Insert an unconditional deoptimization (no conversion possible).
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) = 0;
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) = 0;
};
struct TypeSpecializationData
@@ -79,8 +79,8 @@ class BoxInputsPolicy final : public TypePolicy
{
public:
SPECIALIZATION_DATA_;
- static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
+ [[nodiscard]] static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@@ -89,28 +89,28 @@ class ArithPolicy final : public TypePolicy
{
public:
SPECIALIZATION_DATA_;
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
};
class AllDoublePolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
- MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def);
+ [[nodiscard]] bool adjustInputs(TempAllocator& alloc, MInstruction* def);
};
class BitwisePolicy final : public TypePolicy
{
public:
SPECIALIZATION_DATA_;
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
};
class ComparePolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
};
// Policy for MTest instructions.
@@ -118,21 +118,21 @@ class TestPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
};
class TypeBarrierPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
};
class CallPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
};
// Policy for MPow. First operand Double; second Double or Int32.
@@ -140,7 +140,7 @@ class PowPolicy final : public TypePolicy
{
public:
SPECIALIZATION_DATA_;
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
};
// Expect a string for operand Op. If the input is a Value, it is unboxed.
@@ -149,8 +149,8 @@ class StringPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
- static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
+ [[nodiscard]] static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@@ -161,8 +161,8 @@ class ConvertToStringPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
- static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
+ [[nodiscard]] static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@@ -173,8 +173,8 @@ class BooleanPolicy final : private TypePolicy
{
public:
EMPTY_DATA_;
- static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
+ [[nodiscard]] static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@@ -185,8 +185,8 @@ class IntPolicy final : private TypePolicy
{
public:
EMPTY_DATA_;
- static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
+ [[nodiscard]] static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@@ -197,8 +197,8 @@ class ConvertToInt32Policy final : public TypePolicy
{
public:
EMPTY_DATA_;
- static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
+ [[nodiscard]] static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@@ -209,8 +209,8 @@ class TruncateToInt32Policy final : public TypePolicy
{
public:
EMPTY_DATA_;
- static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
+ [[nodiscard]] static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@@ -221,8 +221,8 @@ class DoublePolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
- static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
+ [[nodiscard]] static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@@ -233,8 +233,8 @@ class Float32Policy final : public TypePolicy
{
public:
EMPTY_DATA_;
- static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
+ [[nodiscard]] static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@@ -246,7 +246,7 @@ class FloatingPointPolicy final : public TypePolicy
{
public:
SPECIALIZATION_DATA_;
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
};
template <unsigned Op>
@@ -254,8 +254,8 @@ class NoFloatPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
- static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
+ [[nodiscard]] static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@@ -267,7 +267,7 @@ class NoFloatPolicyAfter final : public TypePolicy
{
public:
EMPTY_DATA_;
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
};
// Box objects or strings as an input to a ToDouble instruction.
@@ -275,8 +275,8 @@ class ToDoublePolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
- static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
+ [[nodiscard]] static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@@ -286,8 +286,8 @@ class ToInt32Policy final : public TypePolicy
{
public:
EMPTY_DATA_;
- static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
+ [[nodiscard]] static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@@ -297,8 +297,8 @@ class ToStringPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
- static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
+ [[nodiscard]] static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@@ -308,8 +308,8 @@ class ObjectPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
- static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins);
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override {
+ [[nodiscard]] static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins);
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override {
return staticAdjustInputs(alloc, ins);
}
};
@@ -323,8 +323,8 @@ class BoxPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
- static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins);
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override {
+ [[nodiscard]] static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins);
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override {
return staticAdjustInputs(alloc, ins);
}
};
@@ -335,8 +335,8 @@ class BoxExceptPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
- static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins);
- MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) {
+ [[nodiscard]] static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins);
+ [[nodiscard]] bool adjustInputs(TempAllocator& alloc, MInstruction* ins) {
return staticAdjustInputs(alloc, ins);
}
};
@@ -347,8 +347,8 @@ class CacheIdPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
- static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins);
- MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) {
+ [[nodiscard]] static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins);
+ [[nodiscard]] bool adjustInputs(TempAllocator& alloc, MInstruction* ins) {
return staticAdjustInputs(alloc, ins);
}
};
@@ -359,10 +359,10 @@ class MixPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
- static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins) {
+ [[nodiscard]] static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins) {
return Lhs::staticAdjustInputs(alloc, ins) && Rhs::staticAdjustInputs(alloc, ins);
}
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override {
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override {
return staticAdjustInputs(alloc, ins);
}
};
@@ -373,12 +373,12 @@ class Mix3Policy final : public TypePolicy
{
public:
EMPTY_DATA_;
- static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins) {
+ [[nodiscard]] static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins) {
return Policy1::staticAdjustInputs(alloc, ins) &&
Policy2::staticAdjustInputs(alloc, ins) &&
Policy3::staticAdjustInputs(alloc, ins);
}
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override {
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override {
return staticAdjustInputs(alloc, ins);
}
};
@@ -389,13 +389,13 @@ class Mix4Policy : public TypePolicy
{
public:
EMPTY_DATA_;
- static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins) {
+ [[nodiscard]] static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins) {
return Policy1::staticAdjustInputs(alloc, ins) &&
Policy2::staticAdjustInputs(alloc, ins) &&
Policy3::staticAdjustInputs(alloc, ins) &&
Policy4::staticAdjustInputs(alloc, ins);
}
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override {
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override {
return staticAdjustInputs(alloc, ins);
}
};
@@ -404,7 +404,7 @@ class CallSetElementPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
};
// First operand will be boxed to a Value (except for an object)
@@ -413,7 +413,7 @@ class InstanceOfPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
};
class StoreTypedArrayHolePolicy;
@@ -422,37 +422,37 @@ class StoreTypedArrayElementStaticPolicy;
class StoreUnboxedScalarPolicy : public TypePolicy
{
private:
- static MOZ_MUST_USE bool adjustValueInput(TempAllocator& alloc, MInstruction* ins,
- Scalar::Type arrayType, MDefinition* value,
- int valueOperand);
+ [[nodiscard]] static bool adjustValueInput(TempAllocator& alloc, MInstruction* ins,
+ Scalar::Type arrayType, MDefinition* value,
+ int valueOperand);
friend class StoreTypedArrayHolePolicy;
friend class StoreTypedArrayElementStaticPolicy;
public:
EMPTY_DATA_;
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
};
class StoreTypedArrayHolePolicy final : public StoreUnboxedScalarPolicy
{
public:
EMPTY_DATA_;
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
};
class StoreTypedArrayElementStaticPolicy final : public StoreUnboxedScalarPolicy
{
public:
EMPTY_DATA_;
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
};
class StoreUnboxedObjectOrNullPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
};
// Accepts integers and doubles. Everything else is boxed.
@@ -460,14 +460,14 @@ class ClampPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
};
class FilterTypeSetPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
- virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
+ [[nodiscard]] virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
};
#undef SPECIALIZATION_DATA_