mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 891070 - IonMonkey: Reimplement MUrsh::canOverflow using range information. r=nbp
This commit is contained in:
parent
450e204ccf
commit
4538c73709
@ -1290,6 +1290,14 @@ MMul::canOverflow()
|
||||
return !range() || !range()->isInt32();
|
||||
}
|
||||
|
||||
bool
|
||||
MUrsh::canOverflow()
|
||||
{
|
||||
if (!canOverflow_)
|
||||
return false;
|
||||
return !range() || !range()->isInt32();
|
||||
}
|
||||
|
||||
static inline bool
|
||||
KnownNonStringPrimitive(MDefinition *op)
|
||||
{
|
||||
|
@ -2895,25 +2895,7 @@ class MUrsh : public MShiftInstruction
|
||||
|
||||
void infer(BaselineInspector *inspector, jsbytecode *pc);
|
||||
|
||||
bool canOverflow() {
|
||||
// solution is only negative when lhs < 0 and rhs & 0x1f == 0
|
||||
MDefinition *lhs = getOperand(0);
|
||||
MDefinition *rhs = getOperand(1);
|
||||
|
||||
if (lhs->isConstant()) {
|
||||
Value lhsv = lhs->toConstant()->value();
|
||||
if (lhsv.isInt32() && lhsv.toInt32() >= 0)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (rhs->isConstant()) {
|
||||
Value rhsv = rhs->toConstant()->value();
|
||||
if (rhsv.isInt32() && rhsv.toInt32() % 32 != 0)
|
||||
return false;
|
||||
}
|
||||
|
||||
return canOverflow_;
|
||||
}
|
||||
bool canOverflow();
|
||||
|
||||
bool fallible() {
|
||||
return canOverflow();
|
||||
|
Loading…
Reference in New Issue
Block a user