mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 1355943 - Constant fold ion type-barrier. r=h4writer
This commit is contained in:
parent
b1373744cb
commit
f560973ff4
@ -2272,6 +2272,22 @@ MTypeBarrier::congruentTo(const MDefinition* def) const
|
|||||||
return congruentIfOperandsEqual(other);
|
return congruentIfOperandsEqual(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MDefinition*
|
||||||
|
MTypeBarrier::foldsTo(TempAllocator& alloc)
|
||||||
|
{
|
||||||
|
MIRType type = resultTypeSet()->getKnownMIRType();
|
||||||
|
if (type == MIRType::Value || type == MIRType::Object)
|
||||||
|
return this;
|
||||||
|
|
||||||
|
if (!input()->isConstant())
|
||||||
|
return this;
|
||||||
|
|
||||||
|
if (input()->type() != type)
|
||||||
|
return this;
|
||||||
|
|
||||||
|
return input();
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
void
|
void
|
||||||
MPhi::assertLoopPhi() const
|
MPhi::assertLoopPhi() const
|
||||||
|
@ -12825,6 +12825,7 @@ class MTypeBarrier
|
|||||||
BarrierKind barrierKind() const {
|
BarrierKind barrierKind() const {
|
||||||
return barrierKind_;
|
return barrierKind_;
|
||||||
}
|
}
|
||||||
|
MDefinition* foldsTo(TempAllocator& alloc) override;
|
||||||
|
|
||||||
bool alwaysBails() const {
|
bool alwaysBails() const {
|
||||||
// If mirtype of input doesn't agree with mirtype of barrier,
|
// If mirtype of input doesn't agree with mirtype of barrier,
|
||||||
|
Loading…
Reference in New Issue
Block a user