Ignore:
Timestamp:
Feb 12, 2019, 6:30:13 PM (6 years ago)
Author:
[email protected]
Message:

Make B3Value::returnsBool() more precise
https://bugs.webkit.org/show_bug.cgi?id=194457

Reviewed by Saam Barati.

It is currently used repeatedly in B3ReduceStrength, as well as once in B3LowerToAir.
It has a needlessly complex rule for BitAnd, and has no rule for other easy cases such as BitOr or Select.
No new tests added as this should be indirectly tested by the already existing tests.

  • b3/B3Value.cpp:

(JSC::B3::Value::returnsBool const):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/b3/B3Value.cpp

    r239427 r241335  
    500500        return asInt32() == 0 || asInt32() == 1;
    501501    case BitAnd:
    502         return child(1)->isInt32(1)
    503             || (child(0)->returnsBool() && child(1)->hasInt() && child(1)->asInt() & 1);
     502        return child(0)->returnsBool() || child(1)->returnsBool();
     503    case BitOr:
     504    case BitXor:
     505        return child(0)->returnsBool() && child(1)->returnsBool();
     506    case Select:
     507        return child(1)->returnsBool() && child(2)->returnsBool();
     508    case Identity:
     509        return child(0)->returnsBool();
    504510    case Equal:
    505511    case NotEqual:
Note: See TracChangeset for help on using the changeset viewer.