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):
(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.