Source/JavaScriptCore: Re-landing <http://trac.webkit.org/changeset/148999>

    Filled out more cases of branch folding in bytecode when emitting
    expressions into a branching context
    https://bugs.webkit.org/show_bug.cgi?id=115057

    Reviewed by Phil Pizlo.

We can't fold the number == 1 case to boolean because all non-zero numbers
down-cast to true, but only 1 is == to true.

Source/WTF: Filled out more cases of branch folding in bytecode when emitting expressions into a branching context
https://bugs.webkit.org/show_bug.cgi?id=115057

Reviewed by Filip Pizlo.

Added a helper constructor for TriState so clients can make one without
branching or making assumptions about the integer values of TriStates.

* wtf/TriState.h:
(WTF::triState):
(WTF):

LayoutTests: Re-landing <http://trac.webkit.org/changeset/148999>

    Filled out more cases of branch folding in bytecode when emitting
    expressions into a branching context
    https://bugs.webkit.org/show_bug.cgi?id=115057

    Reviewed by Phil Pizlo.

Added a more exhaustive correctness test.

* fast/js/branch-fold-correctness-expected.txt: Added.
* fast/js/branch-fold-correctness.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149236 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed