[JSC] DFG ToNumber should support Boolean in fixup
authorysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 18 Aug 2019 01:50:46 +0000 (01:50 +0000)
committerysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 18 Aug 2019 01:50:46 +0000 (01:50 +0000)
commitc7f02f31d02fc2b2195721d97224d90b9fc0401e
treea0b84872e4e15b9fe8e68ab8f14d2bf67479a4aa
parenta2b0674b8cde1f739447ca348b40c122f515601e
[JSC] DFG ToNumber should support Boolean in fixup
https://bugs.webkit.org/show_bug.cgi?id=200864

Reviewed by Mark Lam.

JSTests:

* microbenchmarks/to-number-boolean.js: Added.
(test):
* stress/to-number-boolean-int32.js: Added.
(shouldBe):
(test):
(check):
* stress/to-number-boolean.js: Added.
(shouldBe):
(test):
(check):
* stress/to-number-int32.js: Added.
(shouldBe):
(test):
(check):

Source/JavaScriptCore:

ToNumber should speculate on Boolean, or BooleanOrInt32 in fixup phase to optimize it.

                                  ToT                     Patched

    to-number-boolean      897.6430+-26.8843    ^     87.4802+-5.2831        ^ definitely 10.2611x faster

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupToNumber):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248825 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/microbenchmarks/to-number-boolean.js [new file with mode: 0644]
JSTests/stress/to-number-boolean-int32.js [new file with mode: 0644]
JSTests/stress/to-number-boolean.js [new file with mode: 0644]
JSTests/stress/to-number-int32.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGFixupPhase.cpp