mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 891070 - IonMonkey: Implement range analysis for nodes with Boolean return types. r=nbp
This commit is contained in:
parent
e31c6db7ca
commit
7014cbc07c
@ -387,6 +387,8 @@ Range::Range(const MDefinition *def)
|
||||
|
||||
if (def->type() == MIRType_Int32)
|
||||
truncate();
|
||||
else if (def->type() == MIRType_Boolean)
|
||||
truncateToBoolean();
|
||||
}
|
||||
|
||||
const int64_t RANGE_INF_MAX = (int64_t) JSVAL_INT_MAX + 1;
|
||||
@ -1491,6 +1493,14 @@ Range::truncate()
|
||||
set(l, h, false, 32);
|
||||
}
|
||||
|
||||
void
|
||||
Range::truncateToBoolean()
|
||||
{
|
||||
if (isBoolean())
|
||||
return;
|
||||
set(0, 1, false, 1);
|
||||
}
|
||||
|
||||
bool
|
||||
MDefinition::truncate()
|
||||
{
|
||||
|
@ -258,6 +258,9 @@ class Range : public TempObject {
|
||||
inline bool isInt32() const {
|
||||
return !isLowerInfinite() && !isUpperInfinite();
|
||||
}
|
||||
inline bool isBoolean() const {
|
||||
return lower() >= 0 && upper() <= 1;
|
||||
}
|
||||
|
||||
inline bool hasRoundingErrors() const {
|
||||
return isDecimal() || exponent() >= MaxTruncatableExponent;
|
||||
@ -340,6 +343,9 @@ class Range : public TempObject {
|
||||
// Truncate the range to an Int32 range.
|
||||
void truncate();
|
||||
|
||||
// Truncate the range to a Boolean range.
|
||||
void truncateToBoolean();
|
||||
|
||||
// Set the exponent by using the precise range analysis on the full
|
||||
// range of Int32 values. This might shrink the exponent after some
|
||||
// operations.
|
||||
|
Loading…
Reference in New Issue
Block a user