mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1116591 - Make every MIR opcode's typePolicy() member function consult op::thisTypePolicy(), never the global thisTypePolicy() method. r=nbp
This commit is contained in:
parent
d9d18f02aa
commit
7d06ab3c2d
252
js/src/jit/MIR.h
252
js/src/jit/MIR.h
@ -979,7 +979,9 @@ class MAryInstruction : public MInstruction
|
||||
}
|
||||
};
|
||||
|
||||
class MNullaryInstruction : public MAryInstruction<0>
|
||||
class MNullaryInstruction
|
||||
: public MAryInstruction<0>,
|
||||
public NoTypePolicy::Data
|
||||
{ };
|
||||
|
||||
class MUnaryInstruction : public MAryInstruction<1>
|
||||
@ -1315,7 +1317,9 @@ class MConstant : public MNullaryInstruction
|
||||
};
|
||||
|
||||
// Generic constructor of SIMD valuesX4.
|
||||
class MSimdValueX4 : public MQuaternaryInstruction
|
||||
class MSimdValueX4
|
||||
: public MQuaternaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
protected:
|
||||
MSimdValueX4(MIRType type, MDefinition *x, MDefinition *y, MDefinition *z, MDefinition *w)
|
||||
@ -1360,7 +1364,9 @@ class MSimdValueX4 : public MQuaternaryInstruction
|
||||
};
|
||||
|
||||
// Generic constructor of SIMD valuesX4.
|
||||
class MSimdSplatX4 : public MUnaryInstruction
|
||||
class MSimdSplatX4
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
protected:
|
||||
MSimdSplatX4(MIRType type, MDefinition *v)
|
||||
@ -1400,7 +1406,8 @@ class MSimdSplatX4 : public MUnaryInstruction
|
||||
};
|
||||
|
||||
// A constant SIMD value.
|
||||
class MSimdConstant : public MNullaryInstruction
|
||||
class MSimdConstant
|
||||
: public MNullaryInstruction
|
||||
{
|
||||
SimdConstant value_;
|
||||
|
||||
@ -1435,7 +1442,9 @@ class MSimdConstant : public MNullaryInstruction
|
||||
};
|
||||
|
||||
// Converts all lanes of a given vector into the type of another vector
|
||||
class MSimdConvert : public MUnaryInstruction
|
||||
class MSimdConvert
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
MSimdConvert(MDefinition *obj, MIRType fromType, MIRType toType)
|
||||
: MUnaryInstruction(obj)
|
||||
@ -1463,7 +1472,9 @@ class MSimdConvert : public MUnaryInstruction
|
||||
};
|
||||
|
||||
// Casts bits of a vector input to another SIMD type (doesn't generate code).
|
||||
class MSimdReinterpretCast : public MUnaryInstruction
|
||||
class MSimdReinterpretCast
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
MSimdReinterpretCast(MDefinition *obj, MIRType fromType, MIRType toType)
|
||||
: MUnaryInstruction(obj)
|
||||
@ -1491,7 +1502,9 @@ class MSimdReinterpretCast : public MUnaryInstruction
|
||||
};
|
||||
|
||||
// Extracts a lane element from a given vector type, given by its lane symbol.
|
||||
class MSimdExtractElement : public MUnaryInstruction
|
||||
class MSimdExtractElement
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
protected:
|
||||
SimdLane lane_;
|
||||
@ -1533,7 +1546,9 @@ class MSimdExtractElement : public MUnaryInstruction
|
||||
};
|
||||
|
||||
// Replaces the datum in the given lane by a scalar value of the same type.
|
||||
class MSimdInsertElement : public MBinaryInstruction
|
||||
class MSimdInsertElement
|
||||
: public MBinaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
private:
|
||||
SimdLane lane_;
|
||||
@ -1583,7 +1598,9 @@ class MSimdInsertElement : public MBinaryInstruction
|
||||
};
|
||||
|
||||
// Extracts the sign bits from a given vector, returning an MIRType_Int32.
|
||||
class MSimdSignMask : public MUnaryInstruction
|
||||
class MSimdSignMask
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
protected:
|
||||
explicit MSimdSignMask(MDefinition *obj)
|
||||
@ -1651,7 +1668,10 @@ class MSimdShuffleBase
|
||||
// Applies a shuffle operation to the input, putting the input lanes as
|
||||
// indicated in the output register's lanes. This implements the SIMD.js
|
||||
// "shuffle" function, that takes one vector and one mask.
|
||||
class MSimdSwizzle : public MUnaryInstruction, public MSimdShuffleBase
|
||||
class MSimdSwizzle
|
||||
: public MUnaryInstruction,
|
||||
public MSimdShuffleBase,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
protected:
|
||||
MSimdSwizzle(MDefinition *obj, MIRType type,
|
||||
@ -1694,7 +1714,10 @@ class MSimdSwizzle : public MUnaryInstruction, public MSimdShuffleBase
|
||||
// Applies a shuffle operation to the inputs, selecting the 2 first lanes of the
|
||||
// output from lanes of the first input, and the 2 last lanes of the output from
|
||||
// lanes of the second input.
|
||||
class MSimdShuffle : public MBinaryInstruction, public MSimdShuffleBase
|
||||
class MSimdShuffle
|
||||
: public MBinaryInstruction,
|
||||
public MSimdShuffleBase,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
MSimdShuffle(MDefinition *lhs, MDefinition *rhs, MIRType type,
|
||||
uint32_t laneX, uint32_t laneY, uint32_t laneZ, uint32_t laneW)
|
||||
@ -1750,7 +1773,9 @@ class MSimdShuffle : public MBinaryInstruction, public MSimdShuffleBase
|
||||
ALLOW_CLONE(MSimdShuffle)
|
||||
};
|
||||
|
||||
class MSimdUnaryArith : public MUnaryInstruction
|
||||
class MSimdUnaryArith
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
public:
|
||||
enum Operation {
|
||||
@ -1799,7 +1824,9 @@ class MSimdUnaryArith : public MUnaryInstruction
|
||||
// Compares each value of a SIMD vector to each corresponding lane's value of
|
||||
// another SIMD vector, and returns a int32x4 vector containing the results of
|
||||
// the comparison: all bits are set to 1 if the comparison is true, 0 otherwise.
|
||||
class MSimdBinaryComp : public MBinaryInstruction
|
||||
class MSimdBinaryComp
|
||||
: public MBinaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
public:
|
||||
enum Operation {
|
||||
@ -1878,7 +1905,9 @@ class MSimdBinaryComp : public MBinaryInstruction
|
||||
ALLOW_CLONE(MSimdBinaryComp)
|
||||
};
|
||||
|
||||
class MSimdBinaryArith : public MBinaryInstruction
|
||||
class MSimdBinaryArith
|
||||
: public MBinaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
public:
|
||||
enum Operation {
|
||||
@ -1945,7 +1974,9 @@ class MSimdBinaryArith : public MBinaryInstruction
|
||||
ALLOW_CLONE(MSimdBinaryArith)
|
||||
};
|
||||
|
||||
class MSimdBinaryBitwise : public MBinaryInstruction
|
||||
class MSimdBinaryBitwise
|
||||
: public MBinaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
public:
|
||||
enum Operation {
|
||||
@ -1991,7 +2022,9 @@ class MSimdBinaryBitwise : public MBinaryInstruction
|
||||
ALLOW_CLONE(MSimdBinaryBitwise)
|
||||
};
|
||||
|
||||
class MSimdShift : public MBinaryInstruction
|
||||
class MSimdShift
|
||||
: public MBinaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
public:
|
||||
enum Operation {
|
||||
@ -2034,7 +2067,9 @@ class MSimdShift : public MBinaryInstruction
|
||||
ALLOW_CLONE(MSimdShift)
|
||||
};
|
||||
|
||||
class MSimdSelect : public MTernaryInstruction
|
||||
class MSimdSelect
|
||||
: public MTernaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
bool isElementWise_;
|
||||
|
||||
@ -2372,7 +2407,9 @@ class MAryControlInstruction : public MControlInstruction
|
||||
};
|
||||
|
||||
// Jump to the start of another basic block.
|
||||
class MGoto : public MAryControlInstruction<0, 1>
|
||||
class MGoto
|
||||
: public MAryControlInstruction<0, 1>,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
explicit MGoto(MBasicBlock *target) {
|
||||
setSuccessor(0, target);
|
||||
@ -2466,7 +2503,8 @@ class MTest
|
||||
// method. This allows IonBuilder to insert fake CFG edges to magically protect
|
||||
// control flow for try-catch blocks.
|
||||
class MGotoWithFake
|
||||
: public MAryControlInstruction<0, 2>
|
||||
: public MAryControlInstruction<0, 2>,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
MGotoWithFake(MBasicBlock *successor, MBasicBlock *fake)
|
||||
{
|
||||
@ -2579,7 +2617,9 @@ typedef AlwaysTenured<JSScript*> AlwaysTenuredScript;
|
||||
typedef AlwaysTenured<PropertyName*> AlwaysTenuredPropertyName;
|
||||
typedef AlwaysTenured<Shape*> AlwaysTenuredShape;
|
||||
|
||||
class MNewArray : public MUnaryInstruction
|
||||
class MNewArray
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
private:
|
||||
// Number of space to allocate for the array.
|
||||
@ -2734,7 +2774,9 @@ class MNewArrayDynamicLength
|
||||
}
|
||||
};
|
||||
|
||||
class MNewObject : public MUnaryInstruction
|
||||
class MNewObject
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
gc::InitialHeap initialHeap_;
|
||||
bool templateObjectIsClassPrototype_;
|
||||
@ -2795,7 +2837,9 @@ class MNewObject : public MUnaryInstruction
|
||||
};
|
||||
|
||||
// Could be allocating either a new array or a new object.
|
||||
class MNewPar : public MUnaryInstruction
|
||||
class MNewPar
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
AlwaysTenuredNativeObject templateObject_;
|
||||
|
||||
@ -3504,7 +3548,9 @@ class MBail : public MNullaryInstruction
|
||||
}
|
||||
};
|
||||
|
||||
class MUnreachable : public MAryControlInstruction<0, 0>
|
||||
class MUnreachable
|
||||
: public MAryControlInstruction<0, 0>,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
public:
|
||||
INSTRUCTION_HEADER(Unreachable)
|
||||
@ -3518,7 +3564,9 @@ class MUnreachable : public MAryControlInstruction<0, 0>
|
||||
}
|
||||
};
|
||||
|
||||
class MAssertFloat32 : public MUnaryInstruction
|
||||
class MAssertFloat32
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
protected:
|
||||
bool mustBeFloat32_;
|
||||
@ -3826,7 +3874,9 @@ class MCompare
|
||||
};
|
||||
|
||||
// Takes a typed value and returns an untyped value.
|
||||
class MBox : public MUnaryInstruction
|
||||
class MBox
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
MBox(TempAllocator &alloc, MDefinition *ins)
|
||||
: MUnaryInstruction(ins)
|
||||
@ -4030,7 +4080,8 @@ class MGuardString
|
||||
};
|
||||
|
||||
class MAssertRange
|
||||
: public MUnaryInstruction
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
// This is the range checked by the assertion. Don't confuse this with the
|
||||
// range_ member or the range() accessor. Since MAssertRange doesn't return
|
||||
@ -4066,7 +4117,8 @@ class MAssertRange
|
||||
// Caller-side allocation of |this| for |new|:
|
||||
// Given a templateobject, construct |this| for JSOP_NEW
|
||||
class MCreateThisWithTemplate
|
||||
: public MUnaryInstruction
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
gc::InitialHeap initialHeap_;
|
||||
|
||||
@ -4477,7 +4529,8 @@ class MToFloat32
|
||||
|
||||
// Converts a uint32 to a double (coming from asm.js).
|
||||
class MAsmJSUnsignedToDouble
|
||||
: public MUnaryInstruction
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
explicit MAsmJSUnsignedToDouble(MDefinition *def)
|
||||
: MUnaryInstruction(def)
|
||||
@ -4503,7 +4556,8 @@ class MAsmJSUnsignedToDouble
|
||||
|
||||
// Converts a uint32 to a float32 (coming from asm.js).
|
||||
class MAsmJSUnsignedToFloat32
|
||||
: public MUnaryInstruction
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
explicit MAsmJSUnsignedToFloat32(MDefinition *def)
|
||||
: MUnaryInstruction(def)
|
||||
@ -6022,7 +6076,8 @@ class MConcat
|
||||
};
|
||||
|
||||
class MConcatPar
|
||||
: public MTernaryInstruction
|
||||
: public MTernaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
MConcatPar(MDefinition *cx, MDefinition *left, MDefinition *right)
|
||||
: MTernaryInstruction(cx, left, right)
|
||||
@ -6234,7 +6289,10 @@ class MLoadArrowThis
|
||||
}
|
||||
};
|
||||
|
||||
class MPhi MOZ_FINAL : public MDefinition, public InlineListNode<MPhi>
|
||||
class MPhi MOZ_FINAL
|
||||
: public MDefinition,
|
||||
public InlineListNode<MPhi>,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
js::Vector<MUse, 2, JitAllocPolicy> inputs_;
|
||||
|
||||
@ -6417,7 +6475,9 @@ class MPhi MOZ_FINAL : public MDefinition, public InlineListNode<MPhi>
|
||||
|
||||
// The goal of a Beta node is to split a def at a conditionally taken
|
||||
// branch, so that uses dominated by it have a different name.
|
||||
class MBeta : public MUnaryInstruction
|
||||
class MBeta
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
private:
|
||||
// This is the range induced by a comparison and branch in a preceding
|
||||
@ -6451,7 +6511,9 @@ class MBeta : public MUnaryInstruction
|
||||
|
||||
// MIR representation of a Value on the OSR BaselineFrame.
|
||||
// The Value is indexed off of OsrFrameReg.
|
||||
class MOsrValue : public MUnaryInstruction
|
||||
class MOsrValue
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
private:
|
||||
ptrdiff_t frameOffset_;
|
||||
@ -6484,7 +6546,9 @@ class MOsrValue : public MUnaryInstruction
|
||||
|
||||
// MIR representation of a JSObject scope chain pointer on the OSR BaselineFrame.
|
||||
// The pointer is indexed off of OsrFrameReg.
|
||||
class MOsrScopeChain : public MUnaryInstruction
|
||||
class MOsrScopeChain
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
private:
|
||||
explicit MOsrScopeChain(MOsrEntry *entry)
|
||||
@ -6506,7 +6570,9 @@ class MOsrScopeChain : public MUnaryInstruction
|
||||
|
||||
// MIR representation of a JSObject ArgumentsObject pointer on the OSR BaselineFrame.
|
||||
// The pointer is indexed off of OsrFrameReg.
|
||||
class MOsrArgumentsObject : public MUnaryInstruction
|
||||
class MOsrArgumentsObject
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
private:
|
||||
explicit MOsrArgumentsObject(MOsrEntry *entry)
|
||||
@ -6528,7 +6594,9 @@ class MOsrArgumentsObject : public MUnaryInstruction
|
||||
|
||||
// MIR representation of the return value on the OSR BaselineFrame.
|
||||
// The Value is indexed off of OsrFrameReg.
|
||||
class MOsrReturnValue : public MUnaryInstruction
|
||||
class MOsrReturnValue
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
private:
|
||||
explicit MOsrReturnValue(MOsrEntry *entry)
|
||||
@ -6549,7 +6617,8 @@ class MOsrReturnValue : public MUnaryInstruction
|
||||
};
|
||||
|
||||
// Check the current frame for over-recursion past the global stack limit.
|
||||
class MCheckOverRecursed : public MNullaryInstruction
|
||||
class MCheckOverRecursed
|
||||
: public MNullaryInstruction
|
||||
{
|
||||
public:
|
||||
INSTRUCTION_HEADER(CheckOverRecursed)
|
||||
@ -6561,7 +6630,9 @@ class MCheckOverRecursed : public MNullaryInstruction
|
||||
|
||||
// Check the current frame for over-recursion past the global stack limit.
|
||||
// Uses the per-thread recursion limit.
|
||||
class MCheckOverRecursedPar : public MUnaryInstruction
|
||||
class MCheckOverRecursedPar
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
explicit MCheckOverRecursedPar(MDefinition *cx)
|
||||
: MUnaryInstruction(cx)
|
||||
@ -6584,7 +6655,9 @@ class MCheckOverRecursedPar : public MUnaryInstruction
|
||||
};
|
||||
|
||||
// Check for an interrupt (or rendezvous) in parallel mode.
|
||||
class MInterruptCheckPar : public MUnaryInstruction
|
||||
class MInterruptCheckPar
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
explicit MInterruptCheckPar(MDefinition *cx)
|
||||
: MUnaryInstruction(cx)
|
||||
@ -6629,7 +6702,8 @@ class MInterruptCheck : public MNullaryInstruction
|
||||
// Check whether we need to fire the interrupt handler at loop headers and
|
||||
// function prologues in asm.js. Generated only if we can't use implicit
|
||||
// interrupt checks with signal handlers.
|
||||
class MAsmJSInterruptCheck : public MNullaryInstruction
|
||||
class MAsmJSInterruptCheck
|
||||
: public MNullaryInstruction
|
||||
{
|
||||
Label *interruptExit_;
|
||||
CallSiteDesc funcDesc_;
|
||||
@ -6704,7 +6778,9 @@ class MThrowUninitializedLexical : public MNullaryInstruction
|
||||
};
|
||||
|
||||
// If not defined, set a global variable to |undefined|.
|
||||
class MDefVar : public MUnaryInstruction
|
||||
class MDefVar
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
AlwaysTenuredPropertyName name_; // Target name to be defined.
|
||||
unsigned attrs_; // Attributes to be set.
|
||||
@ -6740,7 +6816,9 @@ class MDefVar : public MUnaryInstruction
|
||||
}
|
||||
};
|
||||
|
||||
class MDefFun : public MUnaryInstruction
|
||||
class MDefFun
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
AlwaysTenuredFunction fun_;
|
||||
|
||||
@ -7261,7 +7339,8 @@ class MConstantElements : public MNullaryInstruction
|
||||
|
||||
// Passes through an object's elements, after ensuring it is entirely doubles.
|
||||
class MConvertElementsToDoubles
|
||||
: public MUnaryInstruction
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
explicit MConvertElementsToDoubles(MDefinition *elements)
|
||||
: MUnaryInstruction(elements)
|
||||
@ -7375,7 +7454,8 @@ class MMaybeCopyElementsForWrite
|
||||
|
||||
// Load the initialized length from an elements header.
|
||||
class MInitializedLength
|
||||
: public MUnaryInstruction
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
explicit MInitializedLength(MDefinition *elements)
|
||||
: MUnaryInstruction(elements)
|
||||
@ -7409,7 +7489,8 @@ class MInitializedLength
|
||||
// Store to the initialized length in an elements header. Note the input is an
|
||||
// *index*, one less than the desired length.
|
||||
class MSetInitializedLength
|
||||
: public MAryInstruction<2>
|
||||
: public MAryInstruction<2>,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
MSetInitializedLength(MDefinition *elements, MDefinition *index) {
|
||||
initOperand(0, elements);
|
||||
@ -7438,7 +7519,8 @@ class MSetInitializedLength
|
||||
|
||||
// Load the array length from an elements header.
|
||||
class MArrayLength
|
||||
: public MUnaryInstruction
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
explicit MArrayLength(MDefinition *elements)
|
||||
: MUnaryInstruction(elements)
|
||||
@ -7472,7 +7554,8 @@ class MArrayLength
|
||||
// Store to the length in an elements header. Note the input is an *index*, one
|
||||
// less than the desired length.
|
||||
class MSetArrayLength
|
||||
: public MAryInstruction<2>
|
||||
: public MAryInstruction<2>,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
MSetArrayLength(MDefinition *elements, MDefinition *index) {
|
||||
initOperand(0, elements);
|
||||
@ -7608,7 +7691,8 @@ class MTypedObjectElements
|
||||
|
||||
// Inlined version of the js::SetTypedObjectOffset() intrinsic.
|
||||
class MSetTypedObjectOffset
|
||||
: public MBinaryInstruction
|
||||
: public MBinaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
private:
|
||||
MSetTypedObjectOffset(MDefinition *object, MDefinition *offset)
|
||||
@ -7711,7 +7795,8 @@ class MNot
|
||||
// in a bounds check must not be negative, or the wrong result may be computed
|
||||
// (unsigned comparisons may be used).
|
||||
class MBoundsCheck
|
||||
: public MBinaryInstruction
|
||||
: public MBinaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
// Range over which to perform the bounds check, may be modified by GVN.
|
||||
int32_t minimum_;
|
||||
@ -7772,7 +7857,8 @@ class MBoundsCheck
|
||||
|
||||
// Bailout if index < minimum.
|
||||
class MBoundsCheckLower
|
||||
: public MUnaryInstruction
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
int32_t minimum_;
|
||||
bool fallible_;
|
||||
@ -8906,7 +8992,9 @@ class MStoreTypedArrayElementStatic :
|
||||
|
||||
// Compute an "effective address", i.e., a compound computation of the form:
|
||||
// base + index * scale + displacement
|
||||
class MEffectiveAddress : public MBinaryInstruction
|
||||
class MEffectiveAddress
|
||||
: public MBinaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
MEffectiveAddress(MDefinition *base, MDefinition *index, Scale scale, int32_t displacement)
|
||||
: MBinaryInstruction(base, index), scale_(scale), displacement_(displacement)
|
||||
@ -9946,7 +10034,8 @@ class MForkJoinContext
|
||||
// Calls the ForkJoinGetSlice stub, used for inlining the eponymous intrinsic.
|
||||
// Only applicable in ParallelExecution.
|
||||
class MForkJoinGetSlice
|
||||
: public MUnaryInstruction
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
explicit MForkJoinGetSlice(MDefinition *cx)
|
||||
: MUnaryInstruction(cx)
|
||||
@ -10893,7 +10982,8 @@ class MIteratorMore
|
||||
};
|
||||
|
||||
class MIsNoIter
|
||||
: public MUnaryInstruction
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
explicit MIsNoIter(MDefinition *def)
|
||||
: MUnaryInstruction(def)
|
||||
@ -11556,7 +11646,9 @@ class MNewRunOnceCallObject : public MNewCallObjectBase
|
||||
}
|
||||
};
|
||||
|
||||
class MNewCallObjectPar : public MUnaryInstruction
|
||||
class MNewCallObjectPar
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
AlwaysTenured<CallObject*> templateObj_;
|
||||
|
||||
@ -11675,7 +11767,9 @@ class MEnclosingScope : public MLoadFixedSlot
|
||||
// Creates a dense array of the given length.
|
||||
//
|
||||
// Note: the template object should be an *empty* dense array!
|
||||
class MNewDenseArrayPar : public MBinaryInstruction
|
||||
class MNewDenseArrayPar
|
||||
: public MBinaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
AlwaysTenured<ArrayObject*> templateObject_;
|
||||
|
||||
@ -12204,7 +12298,9 @@ class MDebugger : public MNullaryInstruction
|
||||
}
|
||||
};
|
||||
|
||||
class MAsmJSNeg : public MUnaryInstruction
|
||||
class MAsmJSNeg
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
MAsmJSNeg(MDefinition *op, MIRType type)
|
||||
: MUnaryInstruction(op)
|
||||
@ -12235,7 +12331,10 @@ class MAsmJSHeapAccess
|
||||
void removeBoundsCheck() { needsBoundsCheck_ = false; }
|
||||
};
|
||||
|
||||
class MAsmJSLoadHeap : public MUnaryInstruction, public MAsmJSHeapAccess
|
||||
class MAsmJSLoadHeap
|
||||
: public MUnaryInstruction,
|
||||
public MAsmJSHeapAccess,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
MemoryBarrierBits barrierBefore_;
|
||||
MemoryBarrierBits barrierAfter_;
|
||||
@ -12301,7 +12400,10 @@ class MAsmJSLoadHeap : public MUnaryInstruction, public MAsmJSHeapAccess
|
||||
bool mightAlias(const MDefinition *def) const;
|
||||
};
|
||||
|
||||
class MAsmJSStoreHeap : public MBinaryInstruction, public MAsmJSHeapAccess
|
||||
class MAsmJSStoreHeap
|
||||
: public MBinaryInstruction,
|
||||
public MAsmJSHeapAccess,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
MemoryBarrierBits barrierBefore_;
|
||||
MemoryBarrierBits barrierAfter_;
|
||||
@ -12339,7 +12441,10 @@ class MAsmJSStoreHeap : public MBinaryInstruction, public MAsmJSHeapAccess
|
||||
}
|
||||
};
|
||||
|
||||
class MAsmJSCompareExchangeHeap : public MTernaryInstruction, public MAsmJSHeapAccess
|
||||
class MAsmJSCompareExchangeHeap
|
||||
: public MTernaryInstruction,
|
||||
public MAsmJSHeapAccess,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
MAsmJSCompareExchangeHeap(Scalar::Type vt, MDefinition *ptr, MDefinition *oldv, MDefinition *newv,
|
||||
bool needsBoundsCheck)
|
||||
@ -12369,7 +12474,10 @@ class MAsmJSCompareExchangeHeap : public MTernaryInstruction, public MAsmJSHeapA
|
||||
}
|
||||
};
|
||||
|
||||
class MAsmJSAtomicBinopHeap : public MBinaryInstruction, public MAsmJSHeapAccess
|
||||
class MAsmJSAtomicBinopHeap
|
||||
: public MBinaryInstruction,
|
||||
public MAsmJSHeapAccess,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
AtomicOp op_;
|
||||
|
||||
@ -12436,7 +12544,9 @@ class MAsmJSLoadGlobalVar : public MNullaryInstruction
|
||||
bool mightAlias(const MDefinition *def) const;
|
||||
};
|
||||
|
||||
class MAsmJSStoreGlobalVar : public MUnaryInstruction
|
||||
class MAsmJSStoreGlobalVar
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
MAsmJSStoreGlobalVar(unsigned globalDataOffset, MDefinition *v)
|
||||
: MUnaryInstruction(v), globalDataOffset_(globalDataOffset)
|
||||
@ -12459,7 +12569,9 @@ class MAsmJSStoreGlobalVar : public MUnaryInstruction
|
||||
}
|
||||
};
|
||||
|
||||
class MAsmJSLoadFuncPtr : public MUnaryInstruction
|
||||
class MAsmJSLoadFuncPtr
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
MAsmJSLoadFuncPtr(unsigned globalDataOffset, MDefinition *index)
|
||||
: MUnaryInstruction(index), globalDataOffset_(globalDataOffset)
|
||||
@ -12529,7 +12641,9 @@ class MAsmJSParameter : public MNullaryInstruction
|
||||
ABIArg abi() const { return abi_; }
|
||||
};
|
||||
|
||||
class MAsmJSReturn : public MAryControlInstruction<1, 0>
|
||||
class MAsmJSReturn
|
||||
: public MAryControlInstruction<1, 0>,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
explicit MAsmJSReturn(MDefinition *ins) {
|
||||
initOperand(0, ins);
|
||||
@ -12542,7 +12656,9 @@ class MAsmJSReturn : public MAryControlInstruction<1, 0>
|
||||
}
|
||||
};
|
||||
|
||||
class MAsmJSVoidReturn : public MAryControlInstruction<0, 0>
|
||||
class MAsmJSVoidReturn
|
||||
: public MAryControlInstruction<0, 0>,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
public:
|
||||
INSTRUCTION_HEADER(AsmJSVoidReturn);
|
||||
@ -12551,7 +12667,9 @@ class MAsmJSVoidReturn : public MAryControlInstruction<0, 0>
|
||||
}
|
||||
};
|
||||
|
||||
class MAsmJSPassStackArg : public MUnaryInstruction
|
||||
class MAsmJSPassStackArg
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
MAsmJSPassStackArg(uint32_t spOffset, MDefinition *ins)
|
||||
: MUnaryInstruction(ins),
|
||||
@ -12576,7 +12694,9 @@ class MAsmJSPassStackArg : public MUnaryInstruction
|
||||
}
|
||||
};
|
||||
|
||||
class MAsmJSCall MOZ_FINAL : public MVariadicInstruction
|
||||
class MAsmJSCall MOZ_FINAL
|
||||
: public MVariadicInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
public:
|
||||
class Callee {
|
||||
|
@ -1048,13 +1048,11 @@ namespace jit {
|
||||
|
||||
namespace {
|
||||
|
||||
// Default function visited by the C++ lookup rules, if the MIR Instruction does
|
||||
// not inherit from a TypePolicy::Data type.
|
||||
static TypePolicy *
|
||||
thisTypePolicy()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
// For extra-good measure in case an unqualified use is ever introduced. (The
|
||||
// main use in the macro below is explicitly qualified so as not to consult
|
||||
// this scope and find this function.)
|
||||
inline TypePolicy *
|
||||
thisTypePolicy() MOZ_DELETE;
|
||||
|
||||
static MIRType
|
||||
thisTypeSpecialization()
|
||||
@ -1073,16 +1071,15 @@ MGetElementCache::thisTypePolicy()
|
||||
}
|
||||
|
||||
// For each MIR Instruction, this macro define the |typePolicy| method which is
|
||||
// using the |thisTypePolicy| function. We use the C++ lookup rules to select
|
||||
// the right |thisTypePolicy| member. The |thisTypePolicy| function can either
|
||||
// be a member of the MIR Instruction, such as done for MGetElementCache, or a
|
||||
// member inherited from the TypePolicy::Data structure, or at last the global
|
||||
// with the same name if the instruction has no TypePolicy.
|
||||
// using the |thisTypePolicy| method. The |thisTypePolicy| method is either a
|
||||
// member of the MIR Instruction, such as with MGetElementCache, a member
|
||||
// inherited from the TypePolicy::Data structure, or a member inherited from
|
||||
// NoTypePolicy if the MIR instruction has no type policy.
|
||||
#define DEFINE_MIR_TYPEPOLICY_MEMBERS_(op) \
|
||||
TypePolicy * \
|
||||
js::jit::M##op::typePolicy() \
|
||||
{ \
|
||||
return thisTypePolicy(); \
|
||||
return M##op::thisTypePolicy(); \
|
||||
} \
|
||||
\
|
||||
MIRType \
|
||||
|
@ -65,6 +65,17 @@ struct TypeSpecializationData
|
||||
|
||||
#define SPECIALIZATION_DATA_ INHERIT_DATA_(TypeSpecializationData)
|
||||
|
||||
class NoTypePolicy
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
static TypePolicy *thisTypePolicy() {
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class BoxInputsPolicy MOZ_FINAL : public TypePolicy
|
||||
{
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user