Changeset 156830 in webkit


Ignore:
Timestamp:
Oct 3, 2013 1:43:07 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

DFG: ConstProp the pattern ValueToInt32(Bool(x)) -> Int32(x)
https://bugs.webkit.org/show_bug.cgi?id=122263

Patch by Nadav Rotem <nrotem@apple.com> on 2013-10-03
Reviewed by Geoffrey Garen.

  • dfg/DFGAbstractInterpreterInlines.h:

(JSC::DFG::::executeEffects):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r156823 r156830  
     12013-10-03  Nadav Rotem  <nrotem@apple.com>
     2
     3        DFG: ConstProp the pattern ValueToInt32(Bool(x)) -> Int32(x)
     4        https://bugs.webkit.org/show_bug.cgi?id=122263
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        * dfg/DFGAbstractInterpreterInlines.h:
     9        (JSC::DFG::::executeEffects):
     10
    1112013-10-02  Dan Bernstein  <mitz@apple.com>
    212
  • trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h

    r156594 r156830  
    286286    case ValueToInt32: {
    287287        JSValue child = forNode(node->child1()).value();
    288         if (child && child.isNumber()) {
    289             if (child.isInt32())
    290                 setConstant(node, child);
    291             else
    292                 setConstant(node, JSValue(JSC::toInt32(child.asDouble())));
    293             break;
     288        if (child) {
     289            if (child.isNumber()) {
     290                if (child.isInt32())
     291                    setConstant(node, child);
     292                else
     293                    setConstant(node, JSValue(JSC::toInt32(child.asDouble())));
     294                break;
     295            }
     296            if (child.isBoolean()) {
     297                setConstant(node, JSValue(child.asBoolean()));
     298                break;
     299            }
    294300        }
    295301       
Note: See TracChangeset for help on using the changeset viewer.