Issue #1894 - Part 4: Implement IonMonkey support for nullish coalescing

Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1566141
This commit is contained in:
FranklinDM 2022-05-20 15:38:43 +08:00 • committed by roytam1
commit 5812721809
12 changed files with 123 additions and 16 deletions

View file

@ -13156,6 +13156,30 @@ class MIsObject
return AliasSet::None();
}
};
class MIsNullOrUndefined
: public MUnaryInstruction,
public BoxInputsPolicy::Data
{
explicit MIsNullOrUndefined(MDefinition* object)
: MUnaryInstruction(object)
{
setResultType(MIRType::Boolean);
setMovable();
}
public:
INSTRUCTION_HEADER(IsNullOrUndefined)
TRIVIAL_NEW_WRAPPERS
NAMED_OPERANDS((0, object))
bool congruentTo(const MDefinition* ins) const override {
return congruentIfOperandsEqual(ins);
}
AliasSet getAliasSet() const override {
return AliasSet::None();
}
};
class MHasClass
: public MUnaryInstruction,