mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-05 23:07:31 +09:00
Change inlining of intrinsics.
This commit is contained in:
parent
dca3b936bf
commit
8f16d02c34
16 changed files with 206 additions and 40 deletions
|
|
@ -13192,6 +13192,48 @@ class MHasClass
|
|||
}
|
||||
};
|
||||
|
||||
class MGuardToClass
|
||||
: public MUnaryInstruction,
|
||||
public SingleObjectPolicy::Data
|
||||
{
|
||||
const Class* class_;
|
||||
|
||||
MGuardToClass(MDefinition* object, const Class* clasp, MIRType resultType)
|
||||
: MUnaryInstruction(object)
|
||||
, class_(clasp)
|
||||
{
|
||||
MOZ_ASSERT(object->type() == MIRType::Object ||
|
||||
(object->type() == MIRType::Value && object->mightBeType(MIRType::Object)));
|
||||
MOZ_ASSERT(resultType == MIRType::Object || resultType == MIRType::ObjectOrNull);
|
||||
setResultType(resultType);
|
||||
setMovable();
|
||||
if (resultType == MIRType::Object) {
|
||||
// We will bail out if the class type is incorrect,
|
||||
// so we need to ensure we don't eliminate this instruction
|
||||
setGuard();
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
INSTRUCTION_HEADER(GuardToClass)
|
||||
TRIVIAL_NEW_WRAPPERS
|
||||
NAMED_OPERANDS((0, object))
|
||||
|
||||
const Class* getClass() const {
|
||||
return class_;
|
||||
}
|
||||
AliasSet getAliasSet() const override {
|
||||
return AliasSet::None();
|
||||
}
|
||||
bool congruentTo(const MDefinition* ins) const override {
|
||||
if (!ins->isGuardToClass())
|
||||
return false;
|
||||
if (getClass() != ins->toGuardToClass()->getClass())
|
||||
return false;
|
||||
return congruentIfOperandsEqual(ins);
|
||||
}
|
||||
};
|
||||
|
||||
class MCheckReturn
|
||||
: public MBinaryInstruction,
|
||||
public BoxInputsPolicy::Data
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue