mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 995166 - IonMonkey: Add type policy to MFilterTypeSet, r=jandem
This commit is contained in:
parent
4ba994db93
commit
0d9bf57aa8
@ -9393,7 +9393,8 @@ class MGuardThreadExclusive
|
||||
};
|
||||
|
||||
class MFilterTypeSet
|
||||
: public MUnaryInstruction
|
||||
: public MUnaryInstruction,
|
||||
public FilterTypeSetPolicy
|
||||
{
|
||||
MFilterTypeSet(MDefinition *def, types::TemporaryTypeSet *types)
|
||||
: MUnaryInstruction(def)
|
||||
@ -9411,6 +9412,9 @@ class MFilterTypeSet
|
||||
return new(alloc) MFilterTypeSet(def, types);
|
||||
}
|
||||
|
||||
TypePolicy *typePolicy() {
|
||||
return this;
|
||||
}
|
||||
bool congruentTo(const MDefinition *def) const {
|
||||
return false;
|
||||
}
|
||||
|
@ -824,3 +824,34 @@ ClampPolicy::adjustInputs(TempAllocator &alloc, MInstruction *ins)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
FilterTypeSetPolicy::adjustInputs(TempAllocator &alloc, MInstruction *ins)
|
||||
{
|
||||
MOZ_ASSERT(ins->numOperands() == 1);
|
||||
|
||||
// Do nothing if already same type.
|
||||
if (ins->type() == ins->getOperand(0)->type())
|
||||
return true;
|
||||
|
||||
// Box input if ouput type is MIRType_Value
|
||||
if (ins->type() == MIRType_Value) {
|
||||
ins->replaceOperand(0, boxAt(alloc, ins, ins->getOperand(0)));
|
||||
return true;
|
||||
}
|
||||
|
||||
// For simplicity just mark output type as MIRType_Value if input type
|
||||
// is MIRType_Value. It should be possible to unbox, but we need to
|
||||
// add extra code for Undefined/Null.
|
||||
if (ins->getOperand(0)->type() == MIRType_Value) {
|
||||
ins->setResultType(MIRType_Value);
|
||||
return true;
|
||||
}
|
||||
|
||||
// In all other cases we will definitely bail, since types don't
|
||||
// correspond. Just box and mark output as MIRType_Value.
|
||||
ins->replaceOperand(0, boxAt(alloc, ins, ins->getOperand(0)));
|
||||
ins->setResultType(MIRType_Value);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -327,6 +327,12 @@ class ClampPolicy : public BoxInputsPolicy
|
||||
bool adjustInputs(TempAllocator &alloc, MInstruction *ins);
|
||||
};
|
||||
|
||||
class FilterTypeSetPolicy : public BoxInputsPolicy
|
||||
{
|
||||
public:
|
||||
bool adjustInputs(TempAllocator &alloc, MInstruction *ins);
|
||||
};
|
||||
|
||||
static inline bool
|
||||
CoercesToDouble(MIRType type)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user