Bug 1267551 (part 12) - Use MOZ_MUST_USE even more in js/src/jit/. r=h4writer.

This catches a few missing checks.

--HG--
extra : rebase_source : c70e85efe29461f577794e7fb795d9dc2ed0f024
This commit is contained in:
Nicholas Nethercote 2016-06-08 16:10:45 +10:00
Родитель 9fdc31aea3
Коммит 01a3b82ac4
30 изменённых файлов: 539 добавлений и 467 удалений

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

@ -207,14 +207,14 @@ class JitRuntime
public:
explicit JitRuntime(JSRuntime* rt);
~JitRuntime();
bool initialize(JSContext* cx, js::AutoLockForExclusiveAccess& lock);
MOZ_MUST_USE bool initialize(JSContext* cx, js::AutoLockForExclusiveAccess& lock);
uint8_t* allocateOsrTempData(size_t size);
void freeOsrTempData();
static void Mark(JSTracer* trc, js::AutoLockForExclusiveAccess& lock);
static void MarkJitcodeGlobalTableUnconditionally(JSTracer* trc);
static bool MarkJitcodeGlobalTableIteratively(JSTracer* trc);
static MOZ_MUST_USE bool MarkJitcodeGlobalTableIteratively(JSTracer* trc);
static void SweepJitcodeGlobalTable(JSRuntime* rt);
ExecutableAllocator& execAlloc() {
@ -491,7 +491,7 @@ class JitCompartment
return p->value();
return nullptr;
}
bool putStubCode(JSContext* cx, uint32_t key, Handle<JitCode*> stubCode) {
MOZ_MUST_USE bool putStubCode(JSContext* cx, uint32_t key, Handle<JitCode*> stubCode) {
MOZ_ASSERT(stubCode);
if (!stubCodes_->putNew(key, stubCode.get())) {
ReportOutOfMemory(cx);
@ -508,8 +508,8 @@ class JitCompartment
*stubInfo = nullptr;
return nullptr;
}
bool putCacheIRStubCode(const CacheIRStubKey::Lookup& lookup, CacheIRStubKey& key,
JitCode* stubCode)
MOZ_MUST_USE bool putCacheIRStubCode(const CacheIRStubKey::Lookup& lookup, CacheIRStubKey& key,
JitCode* stubCode)
{
CacheIRStubCodeMap::AddPtr p = cacheIRStubCodes_->lookupForAdd(lookup);
MOZ_ASSERT(!p);
@ -546,10 +546,10 @@ class JitCompartment
JitCompartment();
~JitCompartment();
bool initialize(JSContext* cx);
MOZ_MUST_USE bool initialize(JSContext* cx);
// Initialize code stubs only used by Ion, not Baseline.
bool ensureIonStubsExist(JSContext* cx);
MOZ_MUST_USE bool ensureIonStubsExist(JSContext* cx);
void mark(JSTracer* trc, JSCompartment* compartment);
void sweep(FreeOp* fop, JSCompartment* compartment);
@ -562,7 +562,7 @@ class JitCompartment
return regExpMatcherStub_;
}
bool ensureRegExpMatcherStubExists(JSContext* cx) {
MOZ_MUST_USE bool ensureRegExpMatcherStubExists(JSContext* cx) {
if (regExpMatcherStub_)
return true;
regExpMatcherStub_ = generateRegExpMatcherStub(cx);
@ -573,7 +573,7 @@ class JitCompartment
return regExpSearcherStub_;
}
bool ensureRegExpSearcherStubExists(JSContext* cx) {
MOZ_MUST_USE bool ensureRegExpSearcherStubExists(JSContext* cx) {
if (regExpSearcherStub_)
return true;
regExpSearcherStub_ = generateRegExpSearcherStub(cx);
@ -584,7 +584,7 @@ class JitCompartment
return regExpTesterStub_;
}
bool ensureRegExpTesterStubExists(JSContext* cx) {
MOZ_MUST_USE bool ensureRegExpTesterStubExists(JSContext* cx) {
if (regExpTesterStub_)
return true;
regExpTesterStub_ = generateRegExpTesterStub(cx);

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

@ -276,9 +276,9 @@ class JitProfilingFrameIterator
inline JitFrameLayout* framePtr();
inline JSScript* frameScript();
bool tryInitWithPC(void* pc);
bool tryInitWithTable(JitcodeGlobalTable* table, void* pc, JSRuntime* rt,
bool forLastCallSite);
MOZ_MUST_USE bool tryInitWithPC(void* pc);
MOZ_MUST_USE bool tryInitWithTable(JitcodeGlobalTable* table, void* pc, JSRuntime* rt,
bool forLastCallSite);
void fixBaselineReturnAddress();
void moveToNextFrame(CommonFrameLayout* frame);
@ -320,7 +320,7 @@ class RInstructionResults
~RInstructionResults();
bool init(JSContext* cx, uint32_t numResults);
MOZ_MUST_USE bool init(JSContext* cx, uint32_t numResults);
bool isInitialized() const;
#ifdef DEBUG
size_t length() const;
@ -444,7 +444,7 @@ class SnapshotIterator
Value fromInstructionResult(uint32_t index) const;
Value allocationValue(const RValueAllocation& a, ReadMethod rm = RM_Normal);
bool allocationReadable(const RValueAllocation& a, ReadMethod rm = RM_Normal);
MOZ_MUST_USE bool allocationReadable(const RValueAllocation& a, ReadMethod rm = RM_Normal);
void writeAllocationValuePayload(const RValueAllocation& a, Value v);
void warnUnreadableAllocation();
@ -482,7 +482,7 @@ class SnapshotIterator
public:
// Exhibits frame properties contained in the snapshot.
uint32_t pcOffset() const;
inline bool resumeAfter() const {
inline MOZ_MUST_USE bool resumeAfter() const {
// Inline frames are inlined on calls, which are considered as being
// resumed on the Call as baseline will push the pc once we return from
// the call.
@ -516,11 +516,11 @@ class SnapshotIterator
// recover instructions. This vector should be registered before the
// beginning of the iteration. This function is in charge of allocating
// enough space for all instructions results, and return false iff it fails.
bool initInstructionResults(MaybeReadFallback& fallback);
MOZ_MUST_USE bool initInstructionResults(MaybeReadFallback& fallback);
// This function is used internally for computing the result of the recover
// instructions.
bool computeInstructionResults(JSContext* cx, RInstructionResults* results) const;
MOZ_MUST_USE bool computeInstructionResults(JSContext* cx, RInstructionResults* results) const;
public:
// Handle iterating over frames of the snapshots.

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

@ -9,13 +9,15 @@
// This file represents the Loop Invariant Code Motion optimization pass
#include "mozilla/Attributes.h"
namespace js {
namespace jit {
class MIRGenerator;
class MIRGraph;
bool LICM(MIRGenerator* mir, MIRGraph& graph);
MOZ_MUST_USE bool LICM(MIRGenerator* mir, MIRGraph& graph);
} // namespace jit
} // namespace js

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

@ -957,7 +957,7 @@ class LBlock
public:
explicit LBlock(MBasicBlock* block);
bool init(TempAllocator& alloc);
MOZ_MUST_USE bool init(TempAllocator& alloc);
void add(LInstruction* ins) {
ins->setBlock(this);
@ -1140,7 +1140,7 @@ class LVariadicInstruction : public details::LInstructionFixedDefsTempsHelper<De
FixedList<LAllocation> operands_;
public:
bool init(TempAllocator& alloc, size_t length) {
MOZ_MUST_USE bool init(TempAllocator& alloc, size_t length) {
return operands_.init(alloc, length);
}
size_t numOperands() const final override {
@ -1177,13 +1177,13 @@ class LRecoverInfo : public TempObject
RecoverOffset recoverOffset_;
explicit LRecoverInfo(TempAllocator& alloc);
bool init(MResumePoint* mir);
MOZ_MUST_USE bool init(MResumePoint* mir);
// Fill the instruction vector such as all instructions needed for the
// recovery are pushed before the current instruction.
bool appendOperands(MNode* ins);
bool appendDefinition(MDefinition* def);
bool appendResumePoint(MResumePoint* rp);
MOZ_MUST_USE bool appendOperands(MNode* ins);
MOZ_MUST_USE bool appendDefinition(MDefinition* def);
MOZ_MUST_USE bool appendResumePoint(MResumePoint* rp);
public:
static LRecoverInfo* New(MIRGenerator* gen, MResumePoint* mir);
@ -1275,7 +1275,7 @@ class LSnapshot : public TempObject
BailoutKind bailoutKind_;
LSnapshot(LRecoverInfo* recover, BailoutKind kind);
bool init(MIRGenerator* gen);
MOZ_MUST_USE bool init(MIRGenerator* gen);
public:
static LSnapshot* New(MIRGenerator* gen, LRecoverInfo* recover, BailoutKind kind);
@ -1464,7 +1464,7 @@ class LSafepoint : public TempObject
LiveGeneralRegisterSet gcRegs() const {
return gcRegs_;
}
bool addGcSlot(bool stack, uint32_t slot) {
MOZ_MUST_USE bool addGcSlot(bool stack, uint32_t slot) {
bool result = gcSlots_.append(SlotEntry(stack, slot));
if (result)
assertInvariants();
@ -1484,13 +1484,13 @@ class LSafepoint : public TempObject
slotsOrElementsRegs_.addUnchecked(reg);
assertInvariants();
}
bool addSlotsOrElementsSlot(bool stack, uint32_t slot) {
MOZ_MUST_USE bool addSlotsOrElementsSlot(bool stack, uint32_t slot) {
bool result = slotsOrElementsSlots_.append(SlotEntry(stack, slot));
if (result)
assertInvariants();
return result;
}
bool addSlotsOrElementsPointer(LAllocation alloc) {
MOZ_MUST_USE bool addSlotsOrElementsPointer(LAllocation alloc) {
if (alloc.isMemory())
return addSlotsOrElementsSlot(alloc.isStackSlot(), alloc.memorySlot());
MOZ_ASSERT(alloc.isRegister());
@ -1509,7 +1509,7 @@ class LSafepoint : public TempObject
return false;
}
bool addGcPointer(LAllocation alloc) {
MOZ_MUST_USE bool addGcPointer(LAllocation alloc) {
if (alloc.isMemory())
return addGcSlot(alloc.isStackSlot(), alloc.memorySlot());
if (alloc.isRegister())
@ -1529,7 +1529,7 @@ class LSafepoint : public TempObject
return false;
}
bool addValueSlot(bool stack, uint32_t slot) {
MOZ_MUST_USE bool addValueSlot(bool stack, uint32_t slot) {
bool result = valueSlots_.append(SlotEntry(stack, slot));
if (result)
assertInvariants();
@ -1549,14 +1549,14 @@ class LSafepoint : public TempObject
#ifdef JS_NUNBOX32
bool addNunboxParts(uint32_t typeVreg, LAllocation type, LAllocation payload) {
MOZ_MUST_USE bool addNunboxParts(uint32_t typeVreg, LAllocation type, LAllocation payload) {
bool result = nunboxParts_.append(NunboxEntry(typeVreg, type, payload));
if (result)
assertInvariants();
return result;
}
bool addNunboxType(uint32_t typeVreg, LAllocation type) {
MOZ_MUST_USE bool addNunboxType(uint32_t typeVreg, LAllocation type) {
for (size_t i = 0; i < nunboxParts_.length(); i++) {
if (nunboxParts_[i].type == type)
return true;
@ -1574,7 +1574,7 @@ class LSafepoint : public TempObject
return result;
}
bool addNunboxPayload(uint32_t payloadVreg, LAllocation payload) {
MOZ_MUST_USE bool addNunboxPayload(uint32_t payloadVreg, LAllocation payload) {
for (size_t i = 0; i < nunboxParts_.length(); i++) {
if (nunboxParts_[i].payload == payload)
return true;
@ -1630,7 +1630,7 @@ class LSafepoint : public TempObject
return valueRegs_;
}
bool addBoxedValue(LAllocation alloc) {
MOZ_MUST_USE bool addBoxedValue(LAllocation alloc) {
if (alloc.isRegister()) {
Register reg = alloc.toRegister().gpr();
if (!valueRegs().has(reg))
@ -1772,7 +1772,7 @@ class LIRGraph
public:
explicit LIRGraph(MIRGraph* mir);
bool init() {
MOZ_MUST_USE bool init() {
return constantPoolMap_.init() && blocks_.init(mir_.alloc(), mir_.numBlocks());
}
MIRGraph& mir() const {
@ -1787,7 +1787,7 @@ class LIRGraph
uint32_t numBlockIds() const {
return mir_.numBlockIds();
}
bool initBlock(MBasicBlock* mir) {
MOZ_MUST_USE bool initBlock(MBasicBlock* mir) {
LBlock* lir = new (&blocks_[mir->id()]) LBlock(mir);
return lir->init(mir_.alloc());
}
@ -1838,7 +1838,7 @@ class LIRGraph
uint32_t totalSlotCount() const {
return paddedLocalSlotCount() + argumentsSize();
}
bool addConstantToPool(const Value& v, uint32_t* index);
MOZ_MUST_USE bool addConstantToPool(const Value& v, uint32_t* index);
size_t numConstants() const {
return constantPool_.length();
}

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

@ -12,7 +12,7 @@
namespace js {
namespace jit {
bool
MOZ_MUST_USE bool
UnrollLoops(MIRGraph& graph, const LoopIterationBoundVector& bounds);
} // namespace jit

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

@ -46,7 +46,7 @@ class LIRGenerator : public LIRGeneratorSpecific
maxargslots_(0)
{ }
bool generate();
MOZ_MUST_USE bool generate();
private:
LBoxAllocation useBoxFixedAtStart(MDefinition* mir, ValueOperand op);
@ -60,8 +60,8 @@ class LIRGenerator : public LIRGeneratorSpecific
MOZ_MUST_USE bool lowerCallArguments(MCall* call);
public:
bool visitInstruction(MInstruction* ins);
bool visitBlock(MBasicBlock* block);
MOZ_MUST_USE bool visitInstruction(MInstruction* ins);
MOZ_MUST_USE bool visitBlock(MBasicBlock* block);
// Visitor hooks are explicit, to give CPU-specific versions a chance to
// intercept without a bunch of explicit gunk in the .cpp.

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

@ -71,7 +71,7 @@ MIRType MIRTypeFromValue(const js::Value& vp)
// corresponding MIRType, and return true.
//
// If simdType is not suported by Ion, return false.
static inline
static inline MOZ_MUST_USE
bool MaybeSimdTypeToMIRType(SimdType type, MIRType* mirType)
{
switch (type) {
@ -337,7 +337,7 @@ class MNode : public TempObject
inline MDefinition* toDefinition();
inline MResumePoint* toResumePoint();
virtual bool writeRecoverData(CompactBufferWriter& writer) const;
virtual MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const;
virtual void dump(GenericPrinter& out) const = 0;
virtual void dump() const = 0;
@ -438,7 +438,7 @@ class StoreDependency : public TempObject
: all_(alloc)
{ }
bool init(MDefinitionVector& all) {
MOZ_MUST_USE bool init(MDefinitionVector& all) {
if (!all_.appendAll(all))
return false;
return true;
@ -855,7 +855,7 @@ class MDefinition : public MNode
// Mark this instruction as having replaced all uses of ins, as during GVN,
// returning false if the replacement should not be performed. For use when
// GVN eliminates instructions which are not equivalent to one another.
virtual bool updateForReplacement(MDefinition* ins) {
virtual MOZ_MUST_USE bool updateForReplacement(MDefinition* ins) {
return true;
}
@ -1450,7 +1450,7 @@ class MConstant : public MNullaryInstruction
// Try to convert this constant to boolean, similar to js::ToBoolean.
// Returns false if the type is MIRType::Magic*.
bool valueToBoolean(bool* res) const;
bool MOZ_MUST_USE valueToBoolean(bool* res) const;
// Like valueToBoolean, but returns the result directly instead of using
// an outparam. Should not be used if this constant might be a magic value.
@ -1469,7 +1469,7 @@ class MConstant : public MNullaryInstruction
return AliasSet::None();
}
bool updateForReplacement(MDefinition* def) override {
MOZ_MUST_USE bool updateForReplacement(MDefinition* def) override {
MConstant* c = def->toConstant();
// During constant folding, we don't want to replace a float32
// value by a double value.
@ -3120,7 +3120,7 @@ MakeSingletonTypeSet(CompilerConstraintList* constraints, JSObject* obj);
TemporaryTypeSet*
MakeSingletonTypeSet(CompilerConstraintList* constraints, ObjectGroup* obj);
bool
MOZ_MUST_USE bool
MergeTypes(MIRType* ptype, TemporaryTypeSet** ptypeSet,
MIRType newType, TemporaryTypeSet* newTypeSet);
@ -3251,7 +3251,7 @@ class MNewArray
return AliasSet::None();
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
// The template object can safely be used in the recover instruction
// because it can never be mutated by any other function execution.
@ -3409,7 +3409,7 @@ class MNewObject
return vmCall_;
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
// The template object can safely be used in the recover instruction
// because it can never be mutated by any other function execution.
@ -3557,7 +3557,7 @@ class MSimdBox
}
void printOpcode(GenericPrinter& out) const override;
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -3667,7 +3667,7 @@ class MNewDerivedTypedObject
return AliasSet::None();
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -3682,7 +3682,7 @@ struct OperandIndexMap : public TempObject
// have any large number of properties.
FixedList<uint8_t> map;
bool init(TempAllocator& alloc, JSObject* templateObject);
MOZ_MUST_USE bool init(TempAllocator& alloc, JSObject* templateObject);
};
// Represent the content of all slots of an object. This instruction is not
@ -3703,7 +3703,7 @@ class MObjectState
MObjectState(JSObject *templateObject, OperandIndexMap* operandIndex);
explicit MObjectState(MObjectState* state);
bool init(TempAllocator& alloc, MDefinition* obj);
MOZ_MUST_USE bool init(TempAllocator& alloc, MDefinition* obj);
void initSlot(uint32_t slot, MDefinition* def) {
initOperand(slot + 1, def);
@ -3721,7 +3721,7 @@ class MObjectState
// As we might do read of uninitialized properties, we have to copy the
// initial values from the template object.
bool initFromTemplateObject(TempAllocator& alloc, MDefinition* undefinedVal);
MOZ_MUST_USE bool initFromTemplateObject(TempAllocator& alloc, MDefinition* undefinedVal);
MDefinition* object() const {
return getOperand(0);
@ -3776,7 +3776,7 @@ class MObjectState
replaceOperand(operandIndex_->map[offset], def);
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -3829,7 +3829,7 @@ class MArrayState
replaceOperand(index + 2, def);
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -4369,7 +4369,7 @@ class MAssertRecoveredOnBailout
// Needed to assert that float32 instructions are correctly recovered.
bool canConsumeFloat32(MUse* use) const override { return true; }
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -4577,8 +4577,8 @@ class MCompare
static MCompare* NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right, JSOp op,
CompareType compareType);
bool tryFold(bool* result);
bool evaluateConstantOperands(TempAllocator& alloc, bool* result);
MOZ_MUST_USE bool tryFold(bool* result);
MOZ_MUST_USE bool evaluateConstantOperands(TempAllocator& alloc, bool* result);
MDefinition* foldsTo(TempAllocator& alloc) override;
void filtersUndefinedOrNull(bool trueBranch, MDefinition** subject, bool* filtersUndefined,
bool* filtersNull);
@ -4654,8 +4654,8 @@ class MCompare
ALLOW_CLONE(MCompare)
protected:
bool tryFoldEqualOperands(bool* result);
bool tryFoldTypeOf(bool* result);
MOZ_MUST_USE bool tryFoldEqualOperands(bool* result);
MOZ_MUST_USE bool tryFoldTypeOf(bool* result);
bool congruentTo(const MDefinition* ins) const override {
if (!binaryCongruentTo(ins))
@ -4975,7 +4975,7 @@ class MCreateThisWithTemplate
return AliasSet::None();
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override;
};
@ -5298,7 +5298,7 @@ class MToDouble
implicitTruncate_ = Max(implicitTruncate_, kind);
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
if (input()->type() == MIRType::Value)
return false;
@ -5355,7 +5355,7 @@ class MToFloat32
bool canConsumeFloat32(MUse* use) const override { return true; }
bool canProduceFloat32() const override { return true; }
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -5698,7 +5698,7 @@ class MTruncateToInt32
}
#endif
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return input()->type() < MIRType::Symbol;
}
@ -5810,7 +5810,7 @@ class MBitNot
}
void computeRange(TempAllocator& alloc) override;
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return specialization_ != MIRType::None;
}
@ -5871,7 +5871,7 @@ class MTypeOf
return congruentIfOperandsEqual(ins);
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -5967,7 +5967,7 @@ class MBitAnd : public MBinaryBitwiseInstruction
}
void computeRange(TempAllocator& alloc) override;
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return specialization_ != MIRType::None;
}
@ -6000,7 +6000,7 @@ class MBitOr : public MBinaryBitwiseInstruction
return this;
}
void computeRange(TempAllocator& alloc) override;
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return specialization_ != MIRType::None;
}
@ -6034,7 +6034,7 @@ class MBitXor : public MBinaryBitwiseInstruction
}
void computeRange(TempAllocator& alloc) override;
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return specialization_ < MIRType::Object;
}
@ -6082,7 +6082,7 @@ class MLsh : public MShiftInstruction
}
void computeRange(TempAllocator& alloc) override;
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return specialization_ != MIRType::None;
}
@ -6109,7 +6109,7 @@ class MRsh : public MShiftInstruction
}
void computeRange(TempAllocator& alloc) override;
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return specialization_ < MIRType::Object;
}
@ -6151,7 +6151,7 @@ class MUrsh : public MShiftInstruction
void computeRange(TempAllocator& alloc) override;
void collectRangeInfoPreTrunc() override;
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return specialization_ < MIRType::Object;
}
@ -6264,7 +6264,7 @@ class MMinMax
}
MDefinition* foldsTo(TempAllocator& alloc) override;
void computeRange(TempAllocator& alloc) override;
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -6314,7 +6314,7 @@ class MAbs
bool isFloat32Commutative() const override { return true; }
void trySpecializeFloat32(TempAllocator& alloc) override;
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -6483,7 +6483,7 @@ class MSqrt
bool isFloat32Commutative() const override { return true; }
void trySpecializeFloat32(TempAllocator& alloc) override;
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -6559,7 +6559,7 @@ class MAtan2
return true;
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -6594,7 +6594,7 @@ class MHypot
return true;
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -6646,7 +6646,7 @@ class MPow
bool possiblyCalls() const override {
return true;
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
// Temporarily disable recovery to relieve fuzzer pressure. See bug 1188586.
return false;
@ -6697,7 +6697,7 @@ class MPowHalf
return AliasSet::None();
}
void collectRangeInfoPreTrunc() override;
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -6818,7 +6818,7 @@ class MMathFunction
}
void trySpecializeFloat32(TempAllocator& alloc) override;
void computeRange(TempAllocator& alloc) override;
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
if (input()->type() == MIRType::SinCosDouble)
return false;
@ -6875,7 +6875,7 @@ class MAdd : public MBinaryArithInstruction
void truncate() override;
TruncateKind operandTruncateKind(size_t index) const override;
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return specialization_ < MIRType::Object;
}
@ -6919,7 +6919,7 @@ class MSub : public MBinaryArithInstruction
void truncate() override;
TruncateKind operandTruncateKind(size_t index) const override;
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return specialization_ < MIRType::Object;
}
@ -7004,7 +7004,7 @@ class MMul : public MBinaryArithInstruction
canBeNegativeZero_ = negativeZero;
}
bool updateForReplacement(MDefinition* ins) override;
MOZ_MUST_USE bool updateForReplacement(MDefinition* ins) override;
bool fallible() const {
return canBeNegativeZero_ || canOverflow();
@ -7023,7 +7023,7 @@ class MMul : public MBinaryArithInstruction
Mode mode() const { return mode_; }
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return specialization_ < MIRType::Object;
}
@ -7144,7 +7144,7 @@ class MDiv : public MBinaryArithInstruction
void collectRangeInfoPreTrunc() override;
TruncateKind operandTruncateKind(size_t index) const override;
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return specialization_ < MIRType::Object;
}
@ -7229,7 +7229,7 @@ class MMod : public MBinaryArithInstruction
return trapOnError_;
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return specialization_ < MIRType::Object;
}
@ -7278,7 +7278,7 @@ class MConcat
return AliasSet::None();
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -7315,7 +7315,7 @@ class MCharCodeAt
void computeRange(TempAllocator& alloc) override;
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -7348,7 +7348,7 @@ class MFromCharCode
return congruentIfOperandsEqual(ins);
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -7431,7 +7431,7 @@ class MStringSplit
// it as store instruction, see also MNewArray.
return AliasSet::None();
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -8198,7 +8198,7 @@ class MRegExpMatcher
return getOperand(2);
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
@ -8247,7 +8247,7 @@ class MRegExpSearcher
return getOperand(2);
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
@ -8300,7 +8300,7 @@ class MRegExpTester
return true;
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -8428,7 +8428,7 @@ class MStringReplace
return AliasSet::None();
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
if (isFlatReplacement_) {
MOZ_ASSERT(!pattern()->isRegExp());
@ -8550,7 +8550,7 @@ class MLambda
const LambdaFunctionInfo& info() const {
return info_;
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -9376,7 +9376,7 @@ class MNot
bool congruentTo(const MDefinition* ins) const override {
return congruentIfOperandsEqual(ins);
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -11076,7 +11076,7 @@ class InlinePropertyTable : public TempObject
return pc_;
}
bool addEntry(TempAllocator& alloc, ObjectGroup* group, JSFunction* func) {
MOZ_MUST_USE bool addEntry(TempAllocator& alloc, ObjectGroup* group, JSFunction* func) {
return entries_.append(new(alloc) Entry(group, func));
}
@ -11205,7 +11205,7 @@ class MGetPropertyCache
}
void setBlock(MBasicBlock* block) override;
bool updateForReplacement(MDefinition* ins) override;
MOZ_MUST_USE bool updateForReplacement(MDefinition* ins) override;
bool allowDoubleResult() const;
};
@ -11252,7 +11252,7 @@ class MGetPropertyPolymorphic
return congruentIfOperandsEqual(ins);
}
bool addReceiver(const ReceiverGuard& receiver, Shape* shape) {
MOZ_MUST_USE bool addReceiver(const ReceiverGuard& receiver, Shape* shape) {
Entry entry;
entry.receiver = receiver;
entry.shape = shape;
@ -11325,7 +11325,7 @@ class MSetPropertyPolymorphic
return new(alloc) MSetPropertyPolymorphic(alloc, obj, value, name);
}
bool addReceiver(const ReceiverGuard& receiver, Shape* shape) {
MOZ_MUST_USE bool addReceiver(const ReceiverGuard& receiver, Shape* shape) {
Entry entry;
entry.receiver = receiver;
entry.shape = shape;
@ -11452,7 +11452,7 @@ class MDispatchInstruction
}
public:
bool addCase(JSFunction* func, ObjectGroup* funcGroup, MBasicBlock* block) {
MOZ_MUST_USE bool addCase(JSFunction* func, ObjectGroup* funcGroup, MBasicBlock* block) {
return map_.append(Entry(func, funcGroup, block));
}
uint32_t numCases() const {
@ -11680,7 +11680,7 @@ class MGuardReceiverPolymorphic
return getOperand(0);
}
bool addReceiver(const ReceiverGuard& receiver) {
MOZ_MUST_USE bool addReceiver(const ReceiverGuard& receiver) {
return receivers_.append(receiver);
}
size_t numReceivers() const {
@ -12528,8 +12528,8 @@ class MGetDOMProperty
return info_;
}
bool init(TempAllocator& alloc, MDefinition* obj, MDefinition* guard,
MDefinition* globalGuard) {
MOZ_MUST_USE bool init(TempAllocator& alloc, MDefinition* obj, MDefinition* guard,
MDefinition* globalGuard) {
MOZ_ASSERT(obj);
// guard can be null.
// globalGuard can be null.
@ -12689,7 +12689,7 @@ class MStringLength
void computeRange(TempAllocator& alloc) override;
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -12733,7 +12733,7 @@ class MFloor
return congruentIfOperandsEqual(ins);
}
void computeRange(TempAllocator& alloc) override;
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -12777,7 +12777,7 @@ class MCeil
return congruentIfOperandsEqual(ins);
}
void computeRange(TempAllocator& alloc) override;
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -12822,7 +12822,7 @@ class MRound
return congruentIfOperandsEqual(ins);
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}
@ -13091,7 +13091,7 @@ class MArgumentsLength : public MNullaryInstruction
void computeRange(TempAllocator& alloc) override;
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
@ -13744,7 +13744,7 @@ class MResumePoint final :
}
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
// Register a store instruction on the current resume point. This
// instruction would be recovered when we are bailing out. The |cache|
@ -14002,7 +14002,7 @@ class MAtomicIsLockFree
return congruentIfOperandsEqual(ins);
}
bool writeRecoverData(CompactBufferWriter& writer) const override;
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
}

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

@ -54,7 +54,7 @@ class MIRGenerator
MIRGraph& graph() {
return *graph_;
}
bool ensureBallast() {
MOZ_MUST_USE bool ensureBallast() {
return alloc().ensureBallast();
}
const JitRuntime* jitRuntime() const {
@ -77,14 +77,14 @@ class MIRGenerator
// Set an error state and prints a message. Returns false so errors can be
// propagated up.
bool abort(const char* message, ...);
bool abortFmt(const char* message, va_list ap);
bool abort(const char* message, ...); // always returns false
bool abortFmt(const char* message, va_list ap); // always returns false
bool errored() const {
return error_;
}
bool instrumentedProfiling() {
MOZ_MUST_USE bool instrumentedProfiling() {
if (!instrumentedProfilingIsCached_) {
instrumentedProfiling_ = GetJitContext()->runtime->spsProfiler().enabled();
instrumentedProfilingIsCached_ = true;

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

@ -1632,11 +1632,13 @@ class MacroAssembler : public MacroAssemblerSpecific
void convertValueToFloatingPoint(ValueOperand value, FloatRegister output, Label* fail,
MIRType outputType);
bool convertValueToFloatingPoint(JSContext* cx, const Value& v, FloatRegister output,
Label* fail, MIRType outputType);
bool convertConstantOrRegisterToFloatingPoint(JSContext* cx, ConstantOrRegister src,
MOZ_MUST_USE bool convertValueToFloatingPoint(JSContext* cx, const Value& v,
FloatRegister output, Label* fail,
MIRType outputType);
MOZ_MUST_USE bool convertConstantOrRegisterToFloatingPoint(JSContext* cx,
ConstantOrRegister src,
FloatRegister output, Label* fail,
MIRType outputType);
void convertTypedOrValueToFloatingPoint(TypedOrValueRegister src, FloatRegister output,
Label* fail, MIRType outputType);
@ -1644,11 +1646,12 @@ class MacroAssembler : public MacroAssemblerSpecific
void convertValueToDouble(ValueOperand value, FloatRegister output, Label* fail) {
convertValueToFloatingPoint(value, output, fail, MIRType::Double);
}
bool convertValueToDouble(JSContext* cx, const Value& v, FloatRegister output, Label* fail) {
MOZ_MUST_USE bool convertValueToDouble(JSContext* cx, const Value& v, FloatRegister output,
Label* fail) {
return convertValueToFloatingPoint(cx, v, output, fail, MIRType::Double);
}
bool convertConstantOrRegisterToDouble(JSContext* cx, ConstantOrRegister src,
FloatRegister output, Label* fail)
MOZ_MUST_USE bool convertConstantOrRegisterToDouble(JSContext* cx, ConstantOrRegister src,
FloatRegister output, Label* fail)
{
return convertConstantOrRegisterToFloatingPoint(cx, src, output, fail, MIRType::Double);
}
@ -1659,11 +1662,12 @@ class MacroAssembler : public MacroAssemblerSpecific
void convertValueToFloat(ValueOperand value, FloatRegister output, Label* fail) {
convertValueToFloatingPoint(value, output, fail, MIRType::Float32);
}
bool convertValueToFloat(JSContext* cx, const Value& v, FloatRegister output, Label* fail) {
MOZ_MUST_USE bool convertValueToFloat(JSContext* cx, const Value& v, FloatRegister output,
Label* fail) {
return convertValueToFloatingPoint(cx, v, output, fail, MIRType::Float32);
}
bool convertConstantOrRegisterToFloat(JSContext* cx, ConstantOrRegister src,
FloatRegister output, Label* fail)
MOZ_MUST_USE bool convertConstantOrRegisterToFloat(JSContext* cx, ConstantOrRegister src,
FloatRegister output, Label* fail)
{
return convertConstantOrRegisterToFloatingPoint(cx, src, output, fail, MIRType::Float32);
}
@ -1706,10 +1710,11 @@ class MacroAssembler : public MacroAssemblerSpecific
convertValueToInt(value, nullptr, nullptr, nullptr, nullptr, InvalidReg, temp, output,
fail, behavior);
}
bool convertValueToInt(JSContext* cx, const Value& v, Register output, Label* fail,
IntConversionBehavior behavior);
bool convertConstantOrRegisterToInt(JSContext* cx, ConstantOrRegister src, FloatRegister temp,
Register output, Label* fail, IntConversionBehavior behavior);
MOZ_MUST_USE bool convertValueToInt(JSContext* cx, const Value& v, Register output, Label* fail,
IntConversionBehavior behavior);
MOZ_MUST_USE bool convertConstantOrRegisterToInt(JSContext* cx, ConstantOrRegister src,
FloatRegister temp, Register output,
Label* fail, IntConversionBehavior behavior);
void convertTypedOrValueToInt(TypedOrValueRegister src, FloatRegister temp, Register output,
Label* fail, IntConversionBehavior behavior);
@ -1733,15 +1738,16 @@ class MacroAssembler : public MacroAssemblerSpecific
: IntConversion_Normal,
conversion);
}
bool convertValueToInt32(JSContext* cx, const Value& v, Register output, Label* fail,
bool negativeZeroCheck)
MOZ_MUST_USE bool convertValueToInt32(JSContext* cx, const Value& v, Register output,
Label* fail, bool negativeZeroCheck)
{
return convertValueToInt(cx, v, output, fail, negativeZeroCheck
? IntConversion_NegativeZeroCheck
: IntConversion_Normal);
}
bool convertConstantOrRegisterToInt32(JSContext* cx, ConstantOrRegister src, FloatRegister temp,
Register output, Label* fail, bool negativeZeroCheck)
MOZ_MUST_USE bool convertConstantOrRegisterToInt32(JSContext* cx, ConstantOrRegister src,
FloatRegister temp, Register output,
Label* fail, bool negativeZeroCheck)
{
return convertConstantOrRegisterToInt(cx, src, temp, output, fail, negativeZeroCheck
? IntConversion_NegativeZeroCheck
@ -1775,11 +1781,13 @@ class MacroAssembler : public MacroAssemblerSpecific
convertValueToInt(value, input, nullptr, nullptr, nullptr, InvalidReg, temp, output, fail,
IntConversion_Truncate);
}
bool truncateValueToInt32(JSContext* cx, const Value& v, Register output, Label* fail) {
MOZ_MUST_USE bool truncateValueToInt32(JSContext* cx, const Value& v, Register output,
Label* fail) {
return convertValueToInt(cx, v, output, fail, IntConversion_Truncate);
}
bool truncateConstantOrRegisterToInt32(JSContext* cx, ConstantOrRegister src, FloatRegister temp,
Register output, Label* fail)
MOZ_MUST_USE bool truncateConstantOrRegisterToInt32(JSContext* cx, ConstantOrRegister src,
FloatRegister temp, Register output,
Label* fail)
{
return convertConstantOrRegisterToInt(cx, src, temp, output, fail, IntConversion_Truncate);
}
@ -1806,11 +1814,13 @@ class MacroAssembler : public MacroAssemblerSpecific
convertValueToInt(value, input, nullptr, nullptr, nullptr, InvalidReg, temp, output, fail,
IntConversion_ClampToUint8);
}
bool clampValueToUint8(JSContext* cx, const Value& v, Register output, Label* fail) {
MOZ_MUST_USE bool clampValueToUint8(JSContext* cx, const Value& v, Register output,
Label* fail) {
return convertValueToInt(cx, v, output, fail, IntConversion_ClampToUint8);
}
bool clampConstantOrRegisterToUint8(JSContext* cx, ConstantOrRegister src, FloatRegister temp,
Register output, Label* fail)
MOZ_MUST_USE bool clampConstantOrRegisterToUint8(JSContext* cx, ConstantOrRegister src,
FloatRegister temp, Register output,
Label* fail)
{
return convertConstantOrRegisterToInt(cx, src, temp, output, fail,
IntConversion_ClampToUint8);
@ -1841,7 +1851,7 @@ class MacroAssembler : public MacroAssemblerSpecific
void restoreFrameAlignmentForICArguments(AfterICSaveLive& aic) PER_ARCH;
AfterICSaveLive icSaveLive(LiveRegisterSet& liveRegs);
bool icBuildOOLFakeExitFrame(void* fakeReturnAddr, AfterICSaveLive& aic);
MOZ_MUST_USE bool icBuildOOLFakeExitFrame(void* fakeReturnAddr, AfterICSaveLive& aic);
void icRestoreLive(LiveRegisterSet& liveRegs, AfterICSaveLive& aic);
// Align the stack pointer based on the number of arguments which are pushed

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

@ -293,7 +293,7 @@ class MoveResolver
PendingMove* findBlockingMove(const PendingMove* last);
PendingMove* findCycledMove(PendingMoveIterator* stack, PendingMoveIterator end, const PendingMove* first);
bool addOrderedMove(const MoveOp& move);
MOZ_MUST_USE bool addOrderedMove(const MoveOp& move);
void reorderMove(size_t from, size_t to);
// Internal reset function. Does not clear lists.
@ -310,7 +310,7 @@ class MoveResolver
// After calling addMove() for each parallel move, resolve() performs the
// cycle resolution algorithm. Calling addMove() again resets the resolver.
MOZ_MUST_USE bool addMove(const MoveOperand& from, const MoveOperand& to, MoveOp::Type type);
bool resolve();
MOZ_MUST_USE bool resolve();
void sortMemoryToMemoryMoves();
size_t numMoves() const {

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

@ -75,8 +75,8 @@ class OptimizationTypeInfo
types_(alloc)
{ }
bool trackTypeSet(TemporaryTypeSet* typeSet);
bool trackType(TypeSet::Type type);
MOZ_MUST_USE bool trackTypeSet(TemporaryTypeSet* typeSet);
MOZ_MUST_USE bool trackType(TypeSet::Type type);
JS::TrackedTypeSite site() const { return site_; }
MIRType mirType() const { return mirType_; }
@ -87,8 +87,8 @@ class OptimizationTypeInfo
HashNumber hash() const;
bool writeCompact(JSContext* cx, CompactBufferWriter& writer,
UniqueTrackedTypes& uniqueTypes) const;
MOZ_MUST_USE bool writeCompact(JSContext* cx, CompactBufferWriter& writer,
UniqueTrackedTypes& uniqueTypes) const;
};
typedef Vector<OptimizationTypeInfo, 1, JitAllocPolicy> TempOptimizationTypeInfoVector;
@ -114,9 +114,9 @@ class TrackedOptimizations : public TempObject
currentAttempt_ = UINT32_MAX;
}
bool trackTypeInfo(OptimizationTypeInfo&& ty);
MOZ_MUST_USE bool trackTypeInfo(OptimizationTypeInfo&& ty);
bool trackAttempt(JS::TrackedStrategy strategy);
MOZ_MUST_USE bool trackAttempt(JS::TrackedStrategy strategy);
void amendAttempt(uint32_t index);
void trackOutcome(JS::TrackedOutcome outcome);
void trackSuccess();
@ -174,10 +174,10 @@ class UniqueTrackedOptimizations
sorted_(cx)
{ }
bool init() { return map_.init(); }
bool add(const TrackedOptimizations* optimizations);
MOZ_MUST_USE bool init() { return map_.init(); }
MOZ_MUST_USE bool add(const TrackedOptimizations* optimizations);
bool sortByFrequency(JSContext* cx);
MOZ_MUST_USE bool sortByFrequency(JSContext* cx);
bool sorted() const { return !sorted_.empty(); }
uint32_t count() const { MOZ_ASSERT(sorted()); return sorted_.length(); }
const SortedVector& sortedVector() const { MOZ_ASSERT(sorted()); return sorted_; }
@ -407,10 +407,10 @@ class IonTrackedOptimizationsRegion
uint8_t* index);
static void WriteDelta(CompactBufferWriter& writer, uint32_t startDelta, uint32_t length,
uint8_t index);
static bool WriteRun(CompactBufferWriter& writer,
const NativeToTrackedOptimizations* start,
const NativeToTrackedOptimizations* end,
const UniqueTrackedOptimizations& unique);
static MOZ_MUST_USE bool WriteRun(CompactBufferWriter& writer,
const NativeToTrackedOptimizations* start,
const NativeToTrackedOptimizations* end,
const UniqueTrackedOptimizations& unique);
};
class IonTrackedOptimizationsAttempts
@ -560,7 +560,7 @@ typedef IonTrackedOptimizationsOffsetsTable<IonTrackedOptimizationsAttempts>
typedef IonTrackedOptimizationsOffsetsTable<IonTrackedOptimizationsTypeInfo>
IonTrackedOptimizationsTypesTable;
bool
MOZ_MUST_USE bool
WriteIonTrackedOptimizationsTable(JSContext* cx, CompactBufferWriter& writer,
const NativeToTrackedOptimizations* start,
const NativeToTrackedOptimizations* end,

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

@ -41,8 +41,8 @@ struct PcScriptCache
}
// Get a value from the cache. May perform lazy allocation.
bool get(JSRuntime* rt, uint32_t hash, uint8_t* addr,
JSScript** scriptRes, jsbytecode** pcRes)
MOZ_MUST_USE bool get(JSRuntime* rt, uint32_t hash, uint8_t* addr,
JSScript** scriptRes, jsbytecode** pcRes)
{
// If a GC occurred, lazily clear the cache now.
if (gcNumber != rt->gc.gcNumber()) {

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

@ -66,9 +66,9 @@ class PerfSpewer
BasicBlocksVector basicBlocks_;
public:
virtual bool startBasicBlock(MBasicBlock* blk, MacroAssembler& masm);
virtual bool endBasicBlock(MacroAssembler& masm);
bool noteEndInlineCode(MacroAssembler& masm);
virtual MOZ_MUST_USE bool startBasicBlock(MBasicBlock* blk, MacroAssembler& masm);
virtual MOZ_MUST_USE bool endBasicBlock(MacroAssembler& masm);
MOZ_MUST_USE bool noteEndInlineCode(MacroAssembler& masm);
void writeProfile(JSScript* script, JitCode* code, MacroAssembler& masm);
};
@ -80,8 +80,8 @@ void writePerfSpewerJitCodeProfile(JitCode* code, const char* msg);
class AsmJSPerfSpewer : public PerfSpewer
{
public:
bool startBasicBlock(MBasicBlock* blk, MacroAssembler& masm) { return true; }
bool endBasicBlock(MacroAssembler& masm) { return true; }
MOZ_MUST_USE bool startBasicBlock(MBasicBlock* blk, MacroAssembler& masm) { return true; }
MOZ_MUST_USE bool endBasicBlock(MacroAssembler& masm) { return true; }
};
void writePerfSpewerAsmJSFunctionMap(uintptr_t base, uintptr_t size, const char* filename,

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

@ -102,24 +102,24 @@ class RangeAnalysis
public:
RangeAnalysis(MIRGenerator* mir, MIRGraph& graph) :
mir(mir), graph_(graph) {}
bool addBetaNodes();
bool analyze();
bool addRangeAssertions();
bool removeBetaNodes();
bool prepareForUCE(bool* shouldRemoveDeadCode);
bool tryRemovingGuards();
bool truncate();
bool removeUnnecessaryBitops();
MOZ_MUST_USE bool addBetaNodes();
MOZ_MUST_USE bool analyze();
MOZ_MUST_USE bool addRangeAssertions();
MOZ_MUST_USE bool removeBetaNodes();
MOZ_MUST_USE bool prepareForUCE(bool* shouldRemoveDeadCode);
MOZ_MUST_USE bool tryRemovingGuards();
MOZ_MUST_USE bool truncate();
MOZ_MUST_USE bool removeUnnecessaryBitops();
// Any iteration bounds discovered for loops in the graph.
LoopIterationBoundVector loopIterationBounds;
private:
bool analyzeLoop(MBasicBlock* header);
MOZ_MUST_USE bool analyzeLoop(MBasicBlock* header);
LoopIterationBound* analyzeLoopIterationCount(MBasicBlock* header,
MTest* test, BranchDirection direction);
void analyzeLoopPhi(MBasicBlock* header, LoopIterationBound* loopBound, MPhi* phi);
bool tryHoistBoundsCheck(MBasicBlock* header, MBoundsCheck* ins);
MOZ_MUST_USE bool tryHoistBoundsCheck(MBasicBlock* header, MBoundsCheck* ins);
};
class Range : public TempObject {
@ -454,7 +454,7 @@ class Range : public TempObject {
void dump(GenericPrinter& out) const;
void dump() const;
bool update(const Range* other);
MOZ_MUST_USE bool update(const Range* other);
// Unlike the other operations, unionWith is an in-place
// modification. This is to avoid a bunch of useless extra
@ -483,7 +483,7 @@ class Range : public TempObject {
static Range* ceil(TempAllocator& alloc, const Range* op);
static Range* sign(TempAllocator& alloc, const Range* op);
static bool negativeZeroMul(const Range* lhs, const Range* rhs);
static MOZ_MUST_USE bool negativeZeroMul(const Range* lhs, const Range* rhs);
bool isUnknownInt32() const {
return isInt32() && lower() == INT32_MIN && upper() == INT32_MAX;

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

@ -137,7 +137,7 @@ class RInstruction
// Function used to recover the value computed by this instruction. This
// function reads its arguments from the allocations listed on the snapshot
// iterator and stores its returned value on the snapshot iterator too.
virtual bool recover(JSContext* cx, SnapshotIterator& iter) const = 0;
virtual MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const = 0;
// Decode an RInstruction on top of the reserved storage space, based on the
// tag written by the writeRecoverData function of the corresponding MIR
@ -185,7 +185,7 @@ class RResumePoint final : public RInstruction
virtual uint32_t numOperands() const {
return numOperands_;
}
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RBitNot final : public RInstruction
@ -193,7 +193,7 @@ class RBitNot final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(BitNot, 1)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RBitAnd final : public RInstruction
@ -201,7 +201,7 @@ class RBitAnd final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(BitAnd, 2)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RBitOr final : public RInstruction
@ -209,7 +209,7 @@ class RBitOr final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(BitOr, 2)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RBitXor final : public RInstruction
@ -217,7 +217,7 @@ class RBitXor final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(BitXor, 2)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RLsh final : public RInstruction
@ -225,7 +225,7 @@ class RLsh final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(Lsh, 2)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RRsh final : public RInstruction
@ -233,7 +233,7 @@ class RRsh final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(Rsh, 2)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RUrsh final : public RInstruction
@ -241,7 +241,7 @@ class RUrsh final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(Ursh, 2)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RAdd final : public RInstruction
@ -252,7 +252,7 @@ class RAdd final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(Add, 2)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RSub final : public RInstruction
@ -263,7 +263,7 @@ class RSub final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(Sub, 2)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RMul final : public RInstruction
@ -275,7 +275,7 @@ class RMul final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(Mul, 2)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RDiv final : public RInstruction
@ -286,7 +286,7 @@ class RDiv final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(Div, 2)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RMod final : public RInstruction
@ -294,7 +294,7 @@ class RMod final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(Mod, 2)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RNot final : public RInstruction
@ -302,7 +302,7 @@ class RNot final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(Not, 1)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RConcat final : public RInstruction
@ -310,7 +310,7 @@ class RConcat final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(Concat, 2)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RStringLength final : public RInstruction
@ -318,7 +318,7 @@ class RStringLength final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(StringLength, 1)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RArgumentsLength final : public RInstruction
@ -326,7 +326,7 @@ class RArgumentsLength final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(ArgumentsLength, 0)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
@ -335,7 +335,7 @@ class RFloor final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(Floor, 1)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RCeil final : public RInstruction
@ -343,7 +343,7 @@ class RCeil final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(Ceil, 1)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RRound final : public RInstruction
@ -351,7 +351,7 @@ class RRound final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(Round, 1)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RCharCodeAt final : public RInstruction
@ -359,7 +359,7 @@ class RCharCodeAt final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(CharCodeAt, 2)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RFromCharCode final : public RInstruction
@ -367,7 +367,7 @@ class RFromCharCode final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(FromCharCode, 1)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RPow final : public RInstruction
@ -375,7 +375,7 @@ class RPow final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(Pow, 2)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RPowHalf final : public RInstruction
@ -383,7 +383,7 @@ class RPowHalf final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(PowHalf, 1)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RMinMax final : public RInstruction
@ -394,7 +394,7 @@ class RMinMax final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(MinMax, 2)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RAbs final : public RInstruction
@ -402,7 +402,7 @@ class RAbs final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(Abs, 1)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RSqrt final : public RInstruction
@ -413,7 +413,7 @@ class RSqrt final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(Sqrt, 1)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RAtan2 final : public RInstruction
@ -421,7 +421,7 @@ class RAtan2 final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(Atan2, 2)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RHypot final : public RInstruction
@ -436,7 +436,7 @@ class RHypot final : public RInstruction
return numOperands_;
}
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RMathFunction final : public RInstruction
@ -447,7 +447,7 @@ class RMathFunction final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(MathFunction, 1)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RStringSplit final : public RInstruction
@ -455,7 +455,7 @@ class RStringSplit final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(StringSplit, 3)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RRegExpMatcher final : public RInstruction
@ -463,7 +463,7 @@ class RRegExpMatcher final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(RegExpMatcher, 3)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RRegExpSearcher final : public RInstruction
@ -471,7 +471,7 @@ class RRegExpSearcher final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(RegExpSearcher, 3)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RRegExpTester final : public RInstruction
@ -479,7 +479,7 @@ class RRegExpTester final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(RegExpTester, 3)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RStringReplace final : public RInstruction
@ -490,7 +490,7 @@ class RStringReplace final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(StringReplace, 3)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RTypeOf final : public RInstruction
@ -498,7 +498,7 @@ class RTypeOf final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(TypeOf, 1)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RToDouble final : public RInstruction
@ -506,7 +506,7 @@ class RToDouble final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(ToDouble, 1)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RToFloat32 final : public RInstruction
@ -514,7 +514,7 @@ class RToFloat32 final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(ToFloat32, 1)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RTruncateToInt32 final : public RInstruction
@ -522,7 +522,7 @@ class RTruncateToInt32 final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(TruncateToInt32, 1)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RNewObject final : public RInstruction
@ -533,7 +533,7 @@ class RNewObject final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(NewObject, 1)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RNewArray final : public RInstruction
@ -544,7 +544,7 @@ class RNewArray final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(NewArray, 1)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RNewDerivedTypedObject final : public RInstruction
@ -552,7 +552,7 @@ class RNewDerivedTypedObject final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(NewDerivedTypedObject, 3)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RCreateThisWithTemplate final : public RInstruction
@ -560,7 +560,7 @@ class RCreateThisWithTemplate final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(CreateThisWithTemplate, 1)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RLambda final : public RInstruction
@ -568,7 +568,7 @@ class RLambda final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(Lambda, 2)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RSimdBox final : public RInstruction
@ -579,7 +579,7 @@ class RSimdBox final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(SimdBox, 1)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RObjectState final : public RInstruction
@ -598,7 +598,7 @@ class RObjectState final : public RInstruction
return numSlots() + 1;
}
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RArrayState final : public RInstruction
@ -618,7 +618,7 @@ class RArrayState final : public RInstruction
return numElements() + 2;
}
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RAtomicIsLockFree final : public RInstruction
@ -626,7 +626,7 @@ class RAtomicIsLockFree final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(AtomicIsLockFree, 1)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
class RAssertRecoveredOnBailout final : public RInstruction
@ -634,7 +634,7 @@ class RAssertRecoveredOnBailout final : public RInstruction
public:
RINSTRUCTION_HEADER_NUM_OP_(AssertRecoveredOnBailout, 1)
bool recover(JSContext* cx, SnapshotIterator& iter) const;
MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
};
#undef RINSTRUCTION_HEADER_

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

@ -166,11 +166,15 @@ AllocationIntegrityState::check(bool populateSafepoints)
// instruction reuses its input register for an output.
LInstructionReverseIterator riter = block->rbegin(ins);
riter++;
checkIntegrity(block, *riter, vreg, **alloc, populateSafepoints);
if (!checkIntegrity(block, *riter, vreg, **alloc, populateSafepoints))
return false;
while (!worklist.empty()) {
IntegrityItem item = worklist.popCopy();
checkIntegrity(item.block, *item.block->rbegin(), item.vreg, item.alloc, populateSafepoints);
if (!checkIntegrity(item.block, *item.block->rbegin(), item.vreg, item.alloc,
populateSafepoints)) {
return false;
}
}
}
}

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

@ -37,13 +37,13 @@ struct AllocationIntegrityState
// Record all virtual registers in the graph. This must be called before
// register allocation, to pick up the original LUses.
bool record();
MOZ_MUST_USE bool record();
// Perform the liveness analysis on the graph, and assert on an invalid
// allocation. This must be called after register allocation, to pick up
// all assigned physical values. If populateSafepoints is specified,
// safepoints will be filled in with liveness information.
bool check(bool populateSafepoints);
MOZ_MUST_USE bool check(bool populateSafepoints);
private:
@ -122,11 +122,11 @@ struct AllocationIntegrityState
typedef HashSet<IntegrityItem, IntegrityItem, SystemAllocPolicy> IntegrityItemSet;
IntegrityItemSet seen;
bool checkIntegrity(LBlock* block, LInstruction* ins, uint32_t vreg, LAllocation alloc,
bool populateSafepoints);
bool checkSafepointAllocation(LInstruction* ins, uint32_t vreg, LAllocation alloc,
bool populateSafepoints);
bool addPredecessor(LBlock* block, uint32_t vreg, LAllocation alloc);
MOZ_MUST_USE bool checkIntegrity(LBlock* block, LInstruction* ins, uint32_t vreg,
LAllocation alloc, bool populateSafepoints);
MOZ_MUST_USE bool checkSafepointAllocation(LInstruction* ins, uint32_t vreg, LAllocation alloc,
bool populateSafepoints);
MOZ_MUST_USE bool addPredecessor(LBlock* block, uint32_t vreg, LAllocation alloc);
void dump();
};
@ -233,7 +233,7 @@ class InstructionDataMap
: insData_()
{ }
bool init(MIRGenerator* gen, uint32_t numInstructions) {
MOZ_MUST_USE bool init(MIRGenerator* gen, uint32_t numInstructions) {
if (!insData_.init(gen->alloc(), numInstructions))
return false;
memset(&insData_[0], 0, sizeof(LNode*) * numInstructions);
@ -297,7 +297,7 @@ class RegisterAllocator
}
}
bool init();
MOZ_MUST_USE bool init();
TempAllocator& alloc() const {
return mir->alloc();

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

@ -69,10 +69,10 @@ class RematerializedFrame
// Rematerialize all remaining frames pointed to by |iter| into |frames|
// in older-to-younger order, e.g., frames[0] is the oldest frame.
static bool RematerializeInlineFrames(JSContext* cx, uint8_t* top,
InlineFrameIterator& iter,
MaybeReadFallback& fallback,
Vector<RematerializedFrame*>& frames);
static MOZ_MUST_USE bool RematerializeInlineFrames(JSContext* cx, uint8_t* top,
InlineFrameIterator& iter,
MaybeReadFallback& fallback,
Vector<RematerializedFrame*>& frames);
// Free a vector of RematerializedFrames; takes care to call the
// destructor. Also clears the vector.
@ -123,7 +123,7 @@ class RematerializedFrame
return scopeChain_;
}
void pushOnScopeChain(ScopeObject& scope);
bool initFunctionScopeObjects(JSContext* cx);
MOZ_MUST_USE bool initFunctionScopeObjects(JSContext* cx);
bool hasCallObj() const {
MOZ_ASSERT(callee()->needsCallObject());

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

@ -29,7 +29,7 @@ class SafepointWriter
public:
explicit SafepointWriter(uint32_t slotCount, uint32_t argumentCount);
bool init(TempAllocator& alloc);
MOZ_MUST_USE bool init(TempAllocator& alloc);
private:
// A safepoint entry is written in the order these functions appear.
@ -84,7 +84,7 @@ class SafepointReader
void advanceFromGcSlots();
void advanceFromValueSlots();
void advanceFromNunboxSlots();
bool getSlotFromBitmap(SafepointSlotEntry* entry);
MOZ_MUST_USE bool getSlotFromBitmap(SafepointSlotEntry* entry);
public:
SafepointReader(IonScript* script, const SafepointIndex* si);
@ -112,17 +112,17 @@ class SafepointReader
uint32_t osiReturnPointOffset() const;
// Returns true if a slot was read, false if there are no more slots.
bool getGcSlot(SafepointSlotEntry* entry);
MOZ_MUST_USE bool getGcSlot(SafepointSlotEntry* entry);
// Returns true if a slot was read, false if there are no more value slots.
bool getValueSlot(SafepointSlotEntry* entry);
MOZ_MUST_USE bool getValueSlot(SafepointSlotEntry* entry);
// Returns true if a nunbox slot was read, false if there are no more
// nunbox slots.
bool getNunboxSlot(LAllocation* type, LAllocation* payload);
MOZ_MUST_USE bool getNunboxSlot(LAllocation* type, LAllocation* payload);
// Returns true if a slot was read, false if there are no more slots.
bool getSlotsOrElementsSlot(SafepointSlotEntry* entry);
MOZ_MUST_USE bool getSlotsOrElementsSlot(SafepointSlotEntry* entry);
};
} // namespace jit

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

@ -8,13 +8,15 @@
#ifndef jit_ScalarReplacement_h
#define jit_ScalarReplacement_h
#include "mozilla/Attributes.h"
namespace js {
namespace jit {
class MIRGenerator;
class MIRGraph;
bool
MOZ_MUST_USE bool
ScalarReplacement(MIRGenerator* mir, MIRGraph& graph);
} // namespace jit

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

@ -829,7 +829,7 @@ ICStubCompiler::PushStubPayload(MacroAssembler& masm, Register scratch)
masm.adjustFrame(sizeof(intptr_t));
}
bool
void
ICStubCompiler::emitPostWriteBarrierSlot(MacroAssembler& masm, Register obj, ValueOperand val,
Register scratch, LiveGeneralRegisterSet saveRegs)
{
@ -851,7 +851,6 @@ ICStubCompiler::emitPostWriteBarrierSlot(MacroAssembler& masm, Register obj, Val
masm.PopRegsInMask(saveRegs);
masm.bind(&skipBarrier);
return true;
}
SharedStubInfo::SharedStubInfo(JSContext* cx, void* payload, ICEntry* icEntry)

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

@ -925,10 +925,10 @@ class ICUpdatedStub : public ICStub
{}
public:
bool initUpdatingChain(JSContext* cx, ICStubSpace* space);
MOZ_MUST_USE bool initUpdatingChain(JSContext* cx, ICStubSpace* space);
bool addUpdateStubForValue(JSContext* cx, HandleScript script, HandleObject obj, HandleId id,
HandleValue val);
MOZ_MUST_USE bool addUpdateStubForValue(JSContext* cx, HandleScript script, HandleObject obj,
HandleId id, HandleValue val);
void addOptimizedUpdateStub(ICStub* stub) {
if (firstUpdateStub_->isTypeUpdate_Fallback()) {
@ -1001,7 +1001,7 @@ class ICStubCompiler
(static_cast<int32_t>(kind) << 1);
}
virtual bool generateStubCode(MacroAssembler& masm) = 0;
virtual MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) = 0;
virtual void postGenerateStubCode(MacroAssembler& masm, Handle<JitCode*> genCode) {}
JitCode* getStubCode();
@ -1018,14 +1018,14 @@ class ICStubCompiler
void pushStubPayload(MacroAssembler& masm, Register scratch);
// Emits a tail call to a VMFunction wrapper.
bool tailCallVM(const VMFunction& fun, MacroAssembler& masm);
MOZ_MUST_USE bool tailCallVM(const VMFunction& fun, MacroAssembler& masm);
// Emits a normal (non-tail) call to a VMFunction wrapper.
bool callVM(const VMFunction& fun, MacroAssembler& masm);
MOZ_MUST_USE 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.
bool callTypeUpdateIC(MacroAssembler& masm, uint32_t objectOffset);
MOZ_MUST_USE 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
@ -1081,7 +1081,7 @@ class ICStubCompiler
}
protected:
bool emitPostWriteBarrierSlot(MacroAssembler& masm, Register obj, ValueOperand val,
void emitPostWriteBarrierSlot(MacroAssembler& masm, Register obj, ValueOperand val,
Register scratch, LiveGeneralRegisterSet saveRegs);
template <typename T, typename... Args>
@ -1166,8 +1166,9 @@ class ICMonitoredFallbackStub : public ICFallbackStub
fallbackMonitorStub_(nullptr) {}
public:
bool initMonitoringChain(JSContext* cx, ICStubSpace* space, ICStubCompiler::Engine engine);
bool addMonitorStubForValue(JSContext* cx, SharedStubInfo* info, HandleValue val);
MOZ_MUST_USE bool initMonitoringChain(JSContext* cx, ICStubSpace* space,
ICStubCompiler::Engine engine);
MOZ_MUST_USE bool addMonitorStubForValue(JSContext* cx, SharedStubInfo* info, HandleValue val);
inline ICTypeMonitor_Fallback* fallbackMonitorStub() const {
return fallbackMonitorStub_;
@ -1427,7 +1428,7 @@ class ICTypeMonitor_Fallback : public ICStub
// Create a new monitor stub for the type of the given value, and
// add it to this chain.
bool addMonitorStubForValue(JSContext* cx, SharedStubInfo* info, HandleValue val);
MOZ_MUST_USE bool addMonitorStubForValue(JSContext* cx, SharedStubInfo* info, HandleValue val);
void resetMonitorStubChain(Zone* zone);
@ -1437,7 +1438,7 @@ class ICTypeMonitor_Fallback : public ICStub
uint32_t argumentIndex_;
protected:
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, Engine engine, ICMonitoredFallbackStub* mainFallbackStub)
@ -1470,7 +1471,7 @@ class ICTypeMonitor_PrimitiveSet : public TypeCheckPrimitiveSetStub
public:
class Compiler : public TypeCheckPrimitiveSetStub::Compiler {
protected:
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, Engine engine, ICTypeMonitor_PrimitiveSet* existingStub,
@ -1514,7 +1515,7 @@ class ICTypeMonitor_SingleObject : public ICStub
class Compiler : public ICStubCompiler {
protected:
HandleObject obj_;
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, HandleObject obj)
@ -1548,7 +1549,7 @@ class ICTypeMonitor_ObjectGroup : public ICStub
class Compiler : public ICStubCompiler {
protected:
HandleObjectGroup group_;
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, HandleObjectGroup group)
@ -1600,7 +1601,7 @@ class ICBinaryArith_Fallback : public ICFallbackStub
// Compiler for this stub kind.
class Compiler : public ICStubCompiler {
protected:
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
explicit Compiler(JSContext* cx, Engine engine)
@ -1633,7 +1634,7 @@ class ICBinaryArith_Int32 : public ICStub
JSOp op_;
bool allowDouble_;
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE 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 {
@ -1665,7 +1666,7 @@ class ICBinaryArith_StringConcat : public ICStub
public:
class Compiler : public ICStubCompiler {
protected:
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
explicit Compiler(JSContext* cx, Engine engine)
@ -1696,7 +1697,7 @@ class ICBinaryArith_StringObjectConcat : public ICStub
class Compiler : public ICStubCompiler {
protected:
bool lhsIsString_;
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
virtual int32_t getKey() const {
return static_cast<int32_t>(engine_) |
@ -1728,7 +1729,7 @@ class ICBinaryArith_Double : public ICStub
public:
class Compiler : public ICMultiStubCompiler {
protected:
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, JSOp op, Engine engine)
@ -1770,7 +1771,7 @@ class ICBinaryArith_BooleanWithInt32 : public ICStub
JSOp op_;
bool lhsIsBool_;
bool rhsIsBool_;
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
virtual int32_t getKey() const {
return static_cast<int32_t>(engine_) |
@ -1815,7 +1816,7 @@ class ICBinaryArith_DoubleWithInt32 : public ICStub
class Compiler : public ICMultiStubCompiler {
protected:
bool lhsIsDouble_;
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
virtual int32_t getKey() const {
return static_cast<int32_t>(engine_) |
@ -1864,7 +1865,7 @@ class ICUnaryArith_Fallback : public ICFallbackStub
// Compiler for this stub kind.
class Compiler : public ICStubCompiler {
protected:
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
explicit Compiler(JSContext* cx, Engine engine)
@ -1888,7 +1889,7 @@ class ICUnaryArith_Int32 : public ICStub
public:
class Compiler : public ICMultiStubCompiler {
protected:
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, JSOp op, Engine engine)
@ -1912,7 +1913,7 @@ class ICUnaryArith_Double : public ICStub
public:
class Compiler : public ICMultiStubCompiler {
protected:
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, JSOp op, Engine engine)
@ -1956,7 +1957,7 @@ class ICCompare_Fallback : public ICFallbackStub
// Compiler for this stub kind.
class Compiler : public ICStubCompiler {
protected:
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
explicit Compiler(JSContext* cx, Engine engine)
@ -1979,7 +1980,7 @@ class ICCompare_Int32 : public ICStub
// Compiler for this stub kind.
class Compiler : public ICMultiStubCompiler {
protected:
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, JSOp op, Engine engine)
@ -2002,7 +2003,7 @@ class ICCompare_Double : public ICStub
public:
class Compiler : public ICMultiStubCompiler {
protected:
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, JSOp op, Engine engine)
@ -2032,7 +2033,7 @@ class ICCompare_NumberWithUndefined : public ICStub
class Compiler : public ICMultiStubCompiler {
protected:
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
bool lhsIsUndefined;
@ -2067,7 +2068,7 @@ class ICCompare_String : public ICStub
public:
class Compiler : public ICMultiStubCompiler {
protected:
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, JSOp op, Engine engine)
@ -2091,7 +2092,7 @@ class ICCompare_Boolean : public ICStub
public:
class Compiler : public ICMultiStubCompiler {
protected:
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, JSOp op, Engine engine)
@ -2115,7 +2116,7 @@ class ICCompare_Object : public ICStub
public:
class Compiler : public ICMultiStubCompiler {
protected:
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, JSOp op, Engine engine)
@ -2139,7 +2140,7 @@ class ICCompare_ObjectWithUndefined : public ICStub
public:
class Compiler : public ICMultiStubCompiler {
protected:
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
bool lhsIsUndefined;
bool compareWithNull;
@ -2185,7 +2186,7 @@ class ICCompare_Int32WithBoolean : public ICStub
protected:
JSOp op_;
bool lhsIsInt32_;
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
virtual int32_t getKey() const {
return static_cast<int32_t>(engine_) |
@ -2232,7 +2233,7 @@ IsPreliminaryObject(JSObject* obj);
void
StripPreliminaryObjectStubs(JSContext* cx, ICFallbackStub* stub);
bool
MOZ_MUST_USE bool
EffectlesslyLookupProperty(JSContext* cx, HandleObject obj, HandleId name,
MutableHandleObject holder, MutableHandleShape shape,
bool* checkDOMProxy=nullptr,
@ -2251,17 +2252,17 @@ IsCacheableGetPropReadSlot(JSObject* obj, JSObject* holder, Shape* shape, bool i
void
GetFixedOrDynamicSlotOffset(Shape* shape, bool* isFixed, uint32_t* offset);
bool
MOZ_MUST_USE bool
IsCacheableGetPropCall(JSContext* cx, JSObject* obj, JSObject* holder, Shape* shape,
bool* isScripted, bool* isTemporarilyUnoptimizable, bool isDOMProxy=false);
bool
MOZ_MUST_USE bool
UpdateExistingGetPropCallStubs(ICFallbackStub* fallbackStub,
ICStub::Kind kind,
HandleNativeObject holder,
HandleObject receiver,
HandleFunction getter);
bool
MOZ_MUST_USE bool
CheckHasNoSuchProperty(JSContext* cx, JSObject* obj, PropertyName* name,
JSObject** lastProto = nullptr, size_t* protoChainDepthOut = nullptr);
@ -2270,7 +2271,7 @@ GuardReceiverObject(MacroAssembler& masm, ReceiverGuard guard,
Register object, Register scratch,
size_t receiverGuardOffset, Label* failure);
bool
MOZ_MUST_USE bool
GetProtoShapes(JSObject* obj, size_t protoChainDepth, MutableHandle<ShapeVector> shapes);
void
@ -2285,7 +2286,7 @@ CheckDOMProxyExpandoDoesNotShadow(JSContext* cx, MacroAssembler& masm, Register
void
CheckForTypedObjectWithDetachedStorage(JSContext* cx, MacroAssembler& masm, Label* failure);
bool
MOZ_MUST_USE bool
DoCallNativeGetter(JSContext* cx, HandleFunction callee, HandleObject obj,
MutableHandleValue result);
@ -2327,7 +2328,7 @@ class ICGetProp_Fallback : public ICMonitoredFallbackStub
protected:
uint32_t returnOffset_;
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
void postGenerateStubCode(MacroAssembler& masm, Handle<JitCode*> code);
public:
@ -2359,7 +2360,7 @@ class ICGetProp_Generic : public ICMonitoredStub
class Compiler : public ICStubCompiler {
protected:
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
ICStub* firstMonitorStub_;
public:
explicit Compiler(JSContext* cx, Engine engine, ICStub* firstMonitorStub)
@ -2411,7 +2412,7 @@ class ICGetProp_Primitive : public ICMonitoredStub
bool isFixedSlot_;
uint32_t offset_;
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
protected:
virtual int32_t getKey() const {
@ -2452,7 +2453,7 @@ class ICGetProp_StringLength : public ICStub
public:
class Compiler : public ICStubCompiler {
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
explicit Compiler(JSContext* cx, Engine engine)
@ -2566,7 +2567,7 @@ class ICGetPropNativeCompiler : public ICStubCompiler
uint32_t offset_;
bool inputDefinitelyObject_;
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
protected:
virtual int32_t getKey() const {
@ -2746,7 +2747,7 @@ class ICGetProp_CallScripted : public ICGetPropCallGetter
class Compiler : public ICGetPropCallGetter::Compiler {
protected:
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, ICStub* firstMonitorStub, HandleObject obj,
@ -2821,7 +2822,7 @@ class ICGetPropCallNativeCompiler : public ICGetPropCallGetter::Compiler
{
bool inputDefinitelyObject_;
protected:
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
virtual int32_t getKey() const {
int32_t baseKey = ICGetPropCallGetter::Compiler::getKey();
@ -2934,9 +2935,9 @@ class ICGetPropCallDOMProxyNativeCompiler : public ICStubCompiler {
RootedFunction getter_;
uint32_t pcOffset_;
bool generateStubCode(MacroAssembler& masm, Address* internalStructAddr,
Address* generationAddr);
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm, Address* internalStructAddr,
Address* generationAddr);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
ICGetPropCallDOMProxyNativeCompiler(JSContext* cx, ICStub::Kind kind,
@ -2992,7 +2993,7 @@ class ICGetProp_DOMProxyShadowed : public ICMonitoredStub
RootedPropertyName name_;
uint32_t pcOffset_;
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, Engine engine, ICStub* firstMonitorStub, Handle<ProxyObject*> proxy,
@ -3024,7 +3025,7 @@ class ICGetProp_ArgumentsLength : public ICStub
protected:
Which which_;
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
virtual int32_t getKey() const {
return static_cast<int32_t>(engine_) |
@ -3055,7 +3056,7 @@ class ICGetProp_ArgumentsCallee : public ICMonitoredStub
class Compiler : public ICStubCompiler {
protected:
ICStub* firstMonitorStub_;
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, Engine engine, ICStub* firstMonitorStub)
@ -3090,7 +3091,7 @@ class ICNewArray_Fallback : public ICFallbackStub
public:
class Compiler : public ICStubCompiler {
RootedObjectGroup templateGroup;
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
Compiler(JSContext* cx, ObjectGroup* templateGroup, Engine engine)
@ -3136,7 +3137,7 @@ class ICNewObject_Fallback : public ICFallbackStub
public:
class Compiler : public ICStubCompiler {
bool generateStubCode(MacroAssembler& masm);
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
public:
explicit Compiler(JSContext* cx, Engine engine)

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

@ -8,13 +8,15 @@
#ifndef jit_Sink_h
#define jit_Sink_h
#include "mozilla/Attributes.h"
namespace js {
namespace jit {
class MIRGenerator;
class MIRGraph;
bool
MOZ_MUST_USE bool
Sink(MIRGenerator* mir, MIRGraph& graph);
} // namespace jit

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

@ -385,14 +385,14 @@ class SnapshotWriter
SnapshotOffset lastStart_;
public:
bool init();
MOZ_MUST_USE bool init();
SnapshotOffset startSnapshot(RecoverOffset recoverOffset, BailoutKind kind);
#ifdef TRACK_SNAPSHOTS
void trackSnapshot(uint32_t pcOpcode, uint32_t mirOpcode, uint32_t mirId,
uint32_t lirOpcode, uint32_t lirId);
#endif
bool add(const RValueAllocation& slot);
MOZ_MUST_USE bool add(const RValueAllocation& slot);
uint32_t allocWritten() const {
return allocWritten_;

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

@ -57,10 +57,10 @@ class StupidAllocator : public RegisterAllocator
{
}
bool go();
MOZ_MUST_USE bool go();
private:
bool init();
MOZ_MUST_USE bool init();
void syncForBlockEnd(LBlock* block, LInstruction* ins);
void allocateForInstruction(LInstruction* ins);

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

@ -901,7 +901,8 @@ bool
CallSetElementPolicy::adjustInputs(TempAllocator& alloc, MInstruction* ins)
{
// The first operand should be an object.
SingleObjectPolicy::staticAdjustInputs(alloc, ins);
if (!SingleObjectPolicy::staticAdjustInputs(alloc, ins))
return false;
// Box the index and value operands.
for (size_t i = 1, e = ins->numOperands(); i < e; i++) {
@ -918,7 +919,8 @@ InstanceOfPolicy::adjustInputs(TempAllocator& alloc, MInstruction* def)
{
// Box first operand if it isn't object
if (def->getOperand(0)->type() != MIRType::Object)
BoxPolicy<0>::staticAdjustInputs(alloc, def);
if (!BoxPolicy<0>::staticAdjustInputs(alloc, def))
return false;
return true;
}
@ -1016,7 +1018,8 @@ StoreUnboxedScalarPolicy::adjustValueInput(TempAllocator& alloc, MInstruction* i
bool
StoreUnboxedScalarPolicy::adjustInputs(TempAllocator& alloc, MInstruction* ins)
{
SingleObjectPolicy::staticAdjustInputs(alloc, ins);
if (!SingleObjectPolicy::staticAdjustInputs(alloc, ins))
return false;
MStoreUnboxedScalar* store = ins->toStoreUnboxedScalar();
MOZ_ASSERT(IsValidElementsType(store->elements(), store->offsetAdjustment()));
@ -1048,8 +1051,11 @@ StoreTypedArrayElementStaticPolicy::adjustInputs(TempAllocator& alloc, MInstruct
bool
StoreUnboxedObjectOrNullPolicy::adjustInputs(TempAllocator& alloc, MInstruction* ins)
{
ObjectPolicy<0>::staticAdjustInputs(alloc, ins);
ObjectPolicy<3>::staticAdjustInputs(alloc, ins);
if (!ObjectPolicy<0>::staticAdjustInputs(alloc, ins))
return false;
if (!ObjectPolicy<3>::staticAdjustInputs(alloc, ins))
return false;
// Change the value input to a ToObjectOrNull instruction if it might be
// a non-null primitive. Insert a post barrier for the instruction's object

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

@ -30,7 +30,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 bool adjustInputs(TempAllocator& alloc, MInstruction* def) = 0;
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) = 0;
};
struct TypeSpecializationData
@ -80,8 +80,8 @@ class BoxInputsPolicy final : public TypePolicy
{
public:
SPECIALIZATION_DATA_;
static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@ -90,28 +90,28 @@ class ArithPolicy final : public TypePolicy
{
public:
SPECIALIZATION_DATA_;
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
};
class AllDoublePolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
bool adjustInputs(TempAllocator& alloc, MInstruction* def);
MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def);
};
class BitwisePolicy final : public TypePolicy
{
public:
SPECIALIZATION_DATA_;
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
};
class ComparePolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
};
// Policy for MTest instructions.
@ -119,21 +119,21 @@ class TestPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
};
class TypeBarrierPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
};
class CallPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
};
// Policy for MPow. First operand Double; second Double or Int32.
@ -141,7 +141,7 @@ class PowPolicy final : public TypePolicy
{
public:
SPECIALIZATION_DATA_;
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
};
// Expect a string for operand Op. If the input is a Value, it is unboxed.
@ -150,8 +150,8 @@ class StringPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@ -162,8 +162,8 @@ class ConvertToStringPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@ -174,8 +174,8 @@ class BooleanPolicy final : private TypePolicy
{
public:
EMPTY_DATA_;
static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@ -186,8 +186,8 @@ class IntPolicy final : private TypePolicy
{
public:
EMPTY_DATA_;
static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@ -198,8 +198,8 @@ class ConvertToInt32Policy final : public TypePolicy
{
public:
EMPTY_DATA_;
static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@ -210,8 +210,8 @@ class TruncateToInt32Policy final : public TypePolicy
{
public:
EMPTY_DATA_;
static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@ -222,8 +222,8 @@ class DoublePolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@ -234,8 +234,8 @@ class Float32Policy final : public TypePolicy
{
public:
EMPTY_DATA_;
static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@ -247,7 +247,7 @@ class FloatingPointPolicy final : public TypePolicy
{
public:
SPECIALIZATION_DATA_;
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
};
template <unsigned Op>
@ -255,8 +255,8 @@ class NoFloatPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@ -268,7 +268,7 @@ class NoFloatPolicyAfter final : public TypePolicy
{
public:
EMPTY_DATA_;
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
};
// Box objects or strings as an input to a ToDouble instruction.
@ -276,8 +276,8 @@ class ToDoublePolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@ -287,8 +287,8 @@ class ToInt32Policy final : public TypePolicy
{
public:
EMPTY_DATA_;
static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@ -298,8 +298,8 @@ class ToStringPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@ -309,8 +309,8 @@ class ObjectPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins);
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override {
static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins);
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override {
return staticAdjustInputs(alloc, ins);
}
};
@ -326,8 +326,8 @@ class SimdScalarPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* def);
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override {
return staticAdjustInputs(alloc, def);
}
};
@ -336,7 +336,7 @@ class SimdAllPolicy final : public TypePolicy
{
public:
SPECIALIZATION_DATA_;
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
};
template <unsigned Op>
@ -344,21 +344,21 @@ class SimdPolicy final : public TypePolicy
{
public:
SPECIALIZATION_DATA_;
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
};
class SimdSelectPolicy final : public TypePolicy
{
public:
SPECIALIZATION_DATA_;
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
};
class SimdShufflePolicy final : public TypePolicy
{
public:
SPECIALIZATION_DATA_;
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
};
// SIMD value-type policy, use the returned type of the instruction to determine
@ -368,8 +368,8 @@ class SimdSameAsReturnedTypePolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins);
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override {
static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins);
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override {
return staticAdjustInputs(alloc, ins);
}
};
@ -379,8 +379,8 @@ class BoxPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins);
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override {
static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins);
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override {
return staticAdjustInputs(alloc, ins);
}
};
@ -391,8 +391,8 @@ class BoxExceptPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins);
bool adjustInputs(TempAllocator& alloc, MInstruction* ins) {
static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins);
MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) {
return staticAdjustInputs(alloc, ins);
}
};
@ -403,8 +403,8 @@ class CacheIdPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins);
bool adjustInputs(TempAllocator& alloc, MInstruction* ins) {
static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins);
MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) {
return staticAdjustInputs(alloc, ins);
}
};
@ -415,10 +415,10 @@ class MixPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins) {
static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins) {
return Lhs::staticAdjustInputs(alloc, ins) && Rhs::staticAdjustInputs(alloc, ins);
}
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override {
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override {
return staticAdjustInputs(alloc, ins);
}
};
@ -429,12 +429,12 @@ class Mix3Policy final : public TypePolicy
{
public:
EMPTY_DATA_;
static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins) {
static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins) {
return Policy1::staticAdjustInputs(alloc, ins) &&
Policy2::staticAdjustInputs(alloc, ins) &&
Policy3::staticAdjustInputs(alloc, ins);
}
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override {
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override {
return staticAdjustInputs(alloc, ins);
}
};
@ -445,13 +445,13 @@ class Mix4Policy : public TypePolicy
{
public:
EMPTY_DATA_;
static bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins) {
static MOZ_MUST_USE bool staticAdjustInputs(TempAllocator& alloc, MInstruction* ins) {
return Policy1::staticAdjustInputs(alloc, ins) &&
Policy2::staticAdjustInputs(alloc, ins) &&
Policy3::staticAdjustInputs(alloc, ins) &&
Policy4::staticAdjustInputs(alloc, ins);
}
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override {
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override {
return staticAdjustInputs(alloc, ins);
}
};
@ -460,7 +460,7 @@ class CallSetElementPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
};
// First operand will be boxed to a Value (except for an object)
@ -469,7 +469,7 @@ class InstanceOfPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
};
class StoreTypedArrayHolePolicy;
@ -478,36 +478,37 @@ class StoreTypedArrayElementStaticPolicy;
class StoreUnboxedScalarPolicy : public TypePolicy
{
private:
static bool adjustValueInput(TempAllocator& alloc, MInstruction* ins, Scalar::Type arrayType,
MDefinition* value, int valueOperand);
static MOZ_MUST_USE bool adjustValueInput(TempAllocator& alloc, MInstruction* ins,
Scalar::Type arrayType, MDefinition* value,
int valueOperand);
friend class StoreTypedArrayHolePolicy;
friend class StoreTypedArrayElementStaticPolicy;
public:
EMPTY_DATA_;
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
};
class StoreTypedArrayHolePolicy final : public StoreUnboxedScalarPolicy
{
public:
EMPTY_DATA_;
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
};
class StoreTypedArrayElementStaticPolicy final : public StoreUnboxedScalarPolicy
{
public:
EMPTY_DATA_;
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
};
class StoreUnboxedObjectOrNullPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* def) override;
};
// Accepts integers and doubles. Everything else is boxed.
@ -515,14 +516,14 @@ class ClampPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
};
class FilterTypeSetPolicy final : public TypePolicy
{
public:
EMPTY_DATA_;
virtual bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
virtual MOZ_MUST_USE bool adjustInputs(TempAllocator& alloc, MInstruction* ins) override;
};
#undef SPECIALIZATION_DATA_

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

@ -579,22 +579,29 @@ class AutoDetectInvalidation
}
};
bool InvokeFunction(JSContext* cx, HandleObject obj0, bool constructing, uint32_t argc,
Value* argv, MutableHandleValue rval);
bool InvokeFunctionShuffleNewTarget(JSContext* cx, HandleObject obj, uint32_t numActualArgs,
uint32_t numFormalArgs, Value* argv, MutableHandleValue rval);
MOZ_MUST_USE bool
InvokeFunction(JSContext* cx, HandleObject obj0, bool constructing, uint32_t argc, Value* argv,
MutableHandleValue rval);
MOZ_MUST_USE bool
InvokeFunctionShuffleNewTarget(JSContext* cx, HandleObject obj, uint32_t numActualArgs,
uint32_t numFormalArgs, Value* argv, MutableHandleValue rval);
bool CheckOverRecursed(JSContext* cx);
bool CheckOverRecursedWithExtra(JSContext* cx, BaselineFrame* frame,
uint32_t extra, uint32_t earlyCheck);
JSObject* BindVar(JSContext* cx, HandleObject scopeChain);
bool DefVar(JSContext* cx, HandlePropertyName dn, unsigned attrs, HandleObject scopeChain);
bool DefLexical(JSContext* cx, HandlePropertyName dn, unsigned attrs, HandleObject scopeChain);
bool DefGlobalLexical(JSContext* cx, HandlePropertyName dn, unsigned attrs);
bool MutatePrototype(JSContext* cx, HandlePlainObject obj, HandleValue value);
bool InitProp(JSContext* cx, HandleObject obj, HandlePropertyName name, HandleValue value,
jsbytecode* pc);
MOZ_MUST_USE bool
DefVar(JSContext* cx, HandlePropertyName dn, unsigned attrs, HandleObject scopeChain);
MOZ_MUST_USE bool
DefLexical(JSContext* cx, HandlePropertyName dn, unsigned attrs, HandleObject scopeChain);
MOZ_MUST_USE bool
DefGlobalLexical(JSContext* cx, HandlePropertyName dn, unsigned attrs);
MOZ_MUST_USE bool
MutatePrototype(JSContext* cx, HandlePlainObject obj, HandleValue value);
MOZ_MUST_USE bool
InitProp(JSContext* cx, HandleObject obj, HandlePropertyName name, HandleValue value,
jsbytecode* pc);
template<bool Equal>
bool LooselyEqual(JSContext* cx, MutableHandleValue lhs, MutableHandleValue rhs, bool* res);
@ -610,18 +617,21 @@ bool GreaterThanOrEqual(JSContext* cx, MutableHandleValue lhs, MutableHandleValu
template<bool Equal>
bool StringsEqual(JSContext* cx, HandleString left, HandleString right, bool* res);
bool ArrayPopDense(JSContext* cx, HandleObject obj, MutableHandleValue rval);
bool ArrayPushDense(JSContext* cx, HandleObject obj, HandleValue v, uint32_t* length);
bool ArrayShiftDense(JSContext* cx, HandleObject obj, MutableHandleValue rval);
MOZ_MUST_USE bool ArrayPopDense(JSContext* cx, HandleObject obj, MutableHandleValue rval);
MOZ_MUST_USE bool ArrayPushDense(JSContext* cx, HandleObject obj, HandleValue v, uint32_t* length);
MOZ_MUST_USE bool ArrayShiftDense(JSContext* cx, HandleObject obj, MutableHandleValue rval);
JSString* ArrayJoin(JSContext* cx, HandleObject array, HandleString sep);
bool CharCodeAt(JSContext* cx, HandleString str, int32_t index, uint32_t* code);
MOZ_MUST_USE bool
CharCodeAt(JSContext* cx, HandleString str, int32_t index, uint32_t* code);
JSFlatString* StringFromCharCode(JSContext* cx, int32_t code);
bool SetProperty(JSContext* cx, HandleObject obj, HandlePropertyName name, HandleValue value,
bool strict, jsbytecode* pc);
MOZ_MUST_USE bool
SetProperty(JSContext* cx, HandleObject obj, HandlePropertyName name, HandleValue value,
bool strict, jsbytecode* pc);
bool InterruptCheck(JSContext* cx);
MOZ_MUST_USE bool
InterruptCheck(JSContext* cx);
void* MallocWrapper(JSRuntime* rt, size_t nbytes);
JSObject* NewCallObject(JSContext* cx, HandleShape shape, HandleObjectGroup group,
@ -632,9 +642,11 @@ JSObject* NewStringObject(JSContext* cx, HandleString str);
bool OperatorIn(JSContext* cx, HandleValue key, HandleObject obj, bool* out);
bool OperatorInI(JSContext* cx, uint32_t index, HandleObject obj, bool* out);
bool GetIntrinsicValue(JSContext* cx, HandlePropertyName name, MutableHandleValue rval);
MOZ_MUST_USE bool
GetIntrinsicValue(JSContext* cx, HandlePropertyName name, MutableHandleValue rval);
bool CreateThis(JSContext* cx, HandleObject callee, HandleObject newTarget, MutableHandleValue rval);
MOZ_MUST_USE bool
CreateThis(JSContext* cx, HandleObject callee, HandleObject newTarget, MutableHandleValue rval);
void GetDynamicName(JSContext* cx, JSObject* scopeChain, JSString* str, Value* vp);
@ -644,60 +656,86 @@ void PostGlobalWriteBarrier(JSRuntime* rt, JSObject* obj);
uint32_t GetIndexFromString(JSString* str);
bool DebugPrologue(JSContext* cx, BaselineFrame* frame, jsbytecode* pc, bool* mustReturn);
bool DebugEpilogue(JSContext* cx, BaselineFrame* frame, jsbytecode* pc, bool ok);
bool DebugEpilogueOnBaselineReturn(JSContext* cx, BaselineFrame* frame, jsbytecode* pc);
MOZ_MUST_USE bool
DebugPrologue(JSContext* cx, BaselineFrame* frame, jsbytecode* pc, bool* mustReturn);
MOZ_MUST_USE bool
DebugEpilogue(JSContext* cx, BaselineFrame* frame, jsbytecode* pc, bool ok);
MOZ_MUST_USE bool
DebugEpilogueOnBaselineReturn(JSContext* cx, BaselineFrame* frame, jsbytecode* pc);
void FrameIsDebuggeeCheck(BaselineFrame* frame);
JSObject* CreateGenerator(JSContext* cx, BaselineFrame* frame);
bool NormalSuspend(JSContext* cx, HandleObject obj, BaselineFrame* frame, jsbytecode* pc,
uint32_t stackDepth);
bool FinalSuspend(JSContext* cx, HandleObject obj, BaselineFrame* frame, jsbytecode* pc);
bool InterpretResume(JSContext* cx, HandleObject obj, HandleValue val, HandlePropertyName kind,
MutableHandleValue rval);
bool DebugAfterYield(JSContext* cx, BaselineFrame* frame);
bool GeneratorThrowOrClose(JSContext* cx, BaselineFrame* frame, Handle<GeneratorObject*> genObj,
HandleValue arg, uint32_t resumeKind);
MOZ_MUST_USE bool
NormalSuspend(JSContext* cx, HandleObject obj, BaselineFrame* frame, jsbytecode* pc,
uint32_t stackDepth);
MOZ_MUST_USE bool
FinalSuspend(JSContext* cx, HandleObject obj, BaselineFrame* frame, jsbytecode* pc);
MOZ_MUST_USE bool
InterpretResume(JSContext* cx, HandleObject obj, HandleValue val, HandlePropertyName kind,
MutableHandleValue rval);
MOZ_MUST_USE bool
DebugAfterYield(JSContext* cx, BaselineFrame* frame);
MOZ_MUST_USE bool
GeneratorThrowOrClose(JSContext* cx, BaselineFrame* frame, Handle<GeneratorObject*> genObj,
HandleValue arg, uint32_t resumeKind);
bool GlobalNameConflictsCheckFromIon(JSContext* cx, HandleScript script);
bool InitGlobalOrEvalScopeObjects(JSContext* cx, BaselineFrame* frame);
bool InitFunctionScopeObjects(JSContext* cx, BaselineFrame* frame);
MOZ_MUST_USE bool
GlobalNameConflictsCheckFromIon(JSContext* cx, HandleScript script);
MOZ_MUST_USE bool
InitGlobalOrEvalScopeObjects(JSContext* cx, BaselineFrame* frame);
MOZ_MUST_USE bool
InitFunctionScopeObjects(JSContext* cx, BaselineFrame* frame);
bool NewArgumentsObject(JSContext* cx, BaselineFrame* frame, MutableHandleValue res);
MOZ_MUST_USE bool
NewArgumentsObject(JSContext* cx, BaselineFrame* frame, MutableHandleValue res);
JSObject* InitRestParameter(JSContext* cx, uint32_t length, Value* rest, HandleObject templateObj,
HandleObject res);
bool HandleDebugTrap(JSContext* cx, BaselineFrame* frame, uint8_t* retAddr, bool* mustReturn);
bool OnDebuggerStatement(JSContext* cx, BaselineFrame* frame, jsbytecode* pc, bool* mustReturn);
bool GlobalHasLiveOnDebuggerStatement(JSContext* cx);
MOZ_MUST_USE bool
HandleDebugTrap(JSContext* cx, BaselineFrame* frame, uint8_t* retAddr, bool* mustReturn);
MOZ_MUST_USE bool
OnDebuggerStatement(JSContext* cx, BaselineFrame* frame, jsbytecode* pc, bool* mustReturn);
MOZ_MUST_USE bool
GlobalHasLiveOnDebuggerStatement(JSContext* cx);
bool EnterWith(JSContext* cx, BaselineFrame* frame, HandleValue val,
Handle<StaticWithScope*> templ);
bool LeaveWith(JSContext* cx, BaselineFrame* frame);
MOZ_MUST_USE bool
EnterWith(JSContext* cx, BaselineFrame* frame, HandleValue val, Handle<StaticWithScope*> templ);
MOZ_MUST_USE bool
LeaveWith(JSContext* cx, BaselineFrame* frame);
bool PushBlockScope(JSContext* cx, BaselineFrame* frame, Handle<StaticBlockScope*> block);
bool PopBlockScope(JSContext* cx, BaselineFrame* frame);
bool DebugLeaveThenPopBlockScope(JSContext* cx, BaselineFrame* frame, jsbytecode* pc);
bool FreshenBlockScope(JSContext* cx, BaselineFrame* frame);
bool DebugLeaveThenFreshenBlockScope(JSContext* cx, BaselineFrame* frame, jsbytecode* pc);
bool DebugLeaveBlock(JSContext* cx, BaselineFrame* frame, jsbytecode* pc);
MOZ_MUST_USE bool
PushBlockScope(JSContext* cx, BaselineFrame* frame, Handle<StaticBlockScope*> block);
MOZ_MUST_USE bool
PopBlockScope(JSContext* cx, BaselineFrame* frame);
MOZ_MUST_USE bool
DebugLeaveThenPopBlockScope(JSContext* cx, BaselineFrame* frame, jsbytecode* pc);
MOZ_MUST_USE bool
FreshenBlockScope(JSContext* cx, BaselineFrame* frame);
MOZ_MUST_USE bool
DebugLeaveThenFreshenBlockScope(JSContext* cx, BaselineFrame* frame, jsbytecode* pc);
MOZ_MUST_USE bool
DebugLeaveBlock(JSContext* cx, BaselineFrame* frame, jsbytecode* pc);
bool InitBaselineFrameForOsr(BaselineFrame* frame, InterpreterFrame* interpFrame,
uint32_t numStackValues);
MOZ_MUST_USE bool
InitBaselineFrameForOsr(BaselineFrame* frame, InterpreterFrame* interpFrame,
uint32_t numStackValues);
JSObject* CreateDerivedTypedObj(JSContext* cx, HandleObject descr,
HandleObject owner, int32_t offset);
bool ArraySpliceDense(JSContext* cx, HandleObject obj, uint32_t start, uint32_t deleteCount);
MOZ_MUST_USE bool
ArraySpliceDense(JSContext* cx, HandleObject obj, uint32_t start, uint32_t deleteCount);
bool Recompile(JSContext* cx);
bool ForcedRecompile(JSContext* cx);
MOZ_MUST_USE bool
Recompile(JSContext* cx);
MOZ_MUST_USE bool
ForcedRecompile(JSContext* cx);
JSString* StringReplace(JSContext* cx, HandleString string, HandleString pattern,
HandleString repl);
bool SetDenseOrUnboxedArrayElement(JSContext* cx, HandleObject obj, int32_t index,
HandleValue value, bool strict);
MOZ_MUST_USE bool SetDenseOrUnboxedArrayElement(JSContext* cx, HandleObject obj, int32_t index,
HandleValue value, bool strict);
void AssertValidObjectPtr(JSContext* cx, JSObject* obj);
void AssertValidObjectOrNullPtr(JSContext* cx, JSObject* obj);
@ -733,13 +771,18 @@ IonMarkFunction(MIRType type)
bool ObjectIsCallable(JSObject* obj);
bool ObjectIsConstructor(JSObject* obj);
bool ThrowRuntimeLexicalError(JSContext* cx, unsigned errorNumber);
bool BaselineThrowUninitializedThis(JSContext* cx, BaselineFrame* frame);
bool ThrowBadDerivedReturn(JSContext* cx, HandleValue v);
MOZ_MUST_USE bool
ThrowRuntimeLexicalError(JSContext* cx, unsigned errorNumber);
MOZ_MUST_USE bool
BaselineThrowUninitializedThis(JSContext* cx, BaselineFrame* frame);
MOZ_MUST_USE bool
ThrowBadDerivedReturn(JSContext* cx, HandleValue v);
bool ThrowObjectCoercible(JSContext* cx, HandleValue v);
MOZ_MUST_USE bool
ThrowObjectCoercible(JSContext* cx, HandleValue v);
bool BaselineGetFunctionThis(JSContext* cx, BaselineFrame* frame, MutableHandleValue res);
MOZ_MUST_USE bool
BaselineGetFunctionThis(JSContext* cx, BaselineFrame* frame, MutableHandleValue res);
} // namespace jit
} // namespace js

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

@ -41,14 +41,14 @@ class ValueNumberer
public:
explicit VisibleValues(TempAllocator& alloc);
bool init();
MOZ_MUST_USE bool init();
typedef ValueSet::Ptr Ptr;
typedef ValueSet::AddPtr AddPtr;
Ptr findLeader(const MDefinition* def) const;
AddPtr findLeaderForAdd(MDefinition* def);
bool add(AddPtr p, MDefinition* def);
MOZ_MUST_USE bool add(AddPtr p, MDefinition* def);
void overwrite(AddPtr p, MDefinition* def);
void forget(const MDefinition* def);
void clear();
@ -78,36 +78,37 @@ class ValueNumberer
SetUseRemoved
};
bool handleUseReleased(MDefinition* def, UseRemovedOption useRemovedOption);
bool discardDefsRecursively(MDefinition* def);
bool releaseResumePointOperands(MResumePoint* resume);
bool releaseAndRemovePhiOperands(MPhi* phi);
bool releaseOperands(MDefinition* def);
bool discardDef(MDefinition* def);
bool processDeadDefs();
MOZ_MUST_USE bool handleUseReleased(MDefinition* def, UseRemovedOption useRemovedOption);
MOZ_MUST_USE bool discardDefsRecursively(MDefinition* def);
MOZ_MUST_USE bool releaseResumePointOperands(MResumePoint* resume);
MOZ_MUST_USE bool releaseAndRemovePhiOperands(MPhi* phi);
MOZ_MUST_USE bool releaseOperands(MDefinition* def);
MOZ_MUST_USE bool discardDef(MDefinition* def);
MOZ_MUST_USE bool processDeadDefs();
bool fixupOSROnlyLoop(MBasicBlock* block, MBasicBlock* backedge);
bool removePredecessorAndDoDCE(MBasicBlock* block, MBasicBlock* pred, size_t predIndex);
bool removePredecessorAndCleanUp(MBasicBlock* block, MBasicBlock* pred);
MOZ_MUST_USE bool fixupOSROnlyLoop(MBasicBlock* block, MBasicBlock* backedge);
MOZ_MUST_USE bool removePredecessorAndDoDCE(MBasicBlock* block, MBasicBlock* pred,
size_t predIndex);
MOZ_MUST_USE bool removePredecessorAndCleanUp(MBasicBlock* block, MBasicBlock* pred);
MDefinition* simplified(MDefinition* def) const;
MDefinition* leader(MDefinition* def);
bool hasLeader(const MPhi* phi, const MBasicBlock* phiBlock) const;
bool loopHasOptimizablePhi(MBasicBlock* header) const;
bool visitDefinition(MDefinition* def);
bool visitControlInstruction(MBasicBlock* block, const MBasicBlock* root);
bool visitUnreachableBlock(MBasicBlock* block);
bool visitBlock(MBasicBlock* block, const MBasicBlock* root);
bool visitDominatorTree(MBasicBlock* root);
bool visitGraph();
MOZ_MUST_USE bool visitDefinition(MDefinition* def);
MOZ_MUST_USE bool visitControlInstruction(MBasicBlock* block, const MBasicBlock* root);
MOZ_MUST_USE bool visitUnreachableBlock(MBasicBlock* block);
MOZ_MUST_USE bool visitBlock(MBasicBlock* block, const MBasicBlock* root);
MOZ_MUST_USE bool visitDominatorTree(MBasicBlock* root);
MOZ_MUST_USE bool visitGraph();
bool insertOSRFixups();
bool cleanupOSRFixups();
MOZ_MUST_USE bool insertOSRFixups();
MOZ_MUST_USE bool cleanupOSRFixups();
public:
ValueNumberer(MIRGenerator* mir, MIRGraph& graph);
bool init();
MOZ_MUST_USE bool init();
enum UpdateAliasAnalysisFlag {
DontUpdateAliasAnalysis,
@ -117,7 +118,7 @@ class ValueNumberer
// Optimize the graph, performing expression simplification and
// canonicalization, eliminating statically fully-redundant expressions,
// deleting dead instructions, and removing unreachable blocks.
bool run(UpdateAliasAnalysisFlag updateAliasAnalysis);
MOZ_MUST_USE bool run(UpdateAliasAnalysisFlag updateAliasAnalysis);
};
} // namespace jit

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

@ -529,7 +529,8 @@ CodeGeneratorShared::encodeAllocation(LSnapshot* snapshot, MDefinition* mir,
if (mir->isIncompleteObject())
alloc.setNeedSideEffect();
snapshots_.add(alloc);
masm.propagateOOM(snapshots_.add(alloc));
*allocIndex += mir->isRecoveredOnBailout() ? 0 : 1;
}