DFG Is<Blah> versions of TypeOf should fold based on proven input type
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Apr 2015 17:36:26 +0000 (17:36 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Apr 2015 17:36:26 +0000 (17:36 +0000)
commit38ede22d0e155e2b3a39fc35d1ad5ba6fbd79c1a
tree515e48669b90b362873d43a032fdce6a068f4e26
parent6940fed5bd24d77429a52087659b672f136192b8
DFG Is<Blah> versions of TypeOf should fold based on proven input type
https://bugs.webkit.org/show_bug.cgi?id=144409

Reviewed by Geoffrey Garen.
Source/JavaScriptCore:

We were missing some obvious folding opportunities here. I don't know how this affects real
code, but in general, we like to ensure that our constant folding is comprehensive. So this
is more about placating my static analysis OCD than anything else.

I added a bunch of speed/correctness tests for this in LayoutTests/js/regress.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):

LayoutTests:

* js/regress/is-boolean-fold-expected.txt: Added.
* js/regress/is-boolean-fold-tricky-expected.txt: Added.
* js/regress/is-boolean-fold-tricky.html: Added.
* js/regress/is-boolean-fold.html: Added.
* js/regress/is-function-fold-expected.txt: Added.
* js/regress/is-function-fold-tricky-expected.txt: Added.
* js/regress/is-function-fold-tricky-internal-function-expected.txt: Added.
* js/regress/is-function-fold-tricky-internal-function.html: Added.
* js/regress/is-function-fold-tricky.html: Added.
* js/regress/is-function-fold.html: Added.
* js/regress/is-number-fold-expected.txt: Added.
* js/regress/is-number-fold-tricky-expected.txt: Added.
* js/regress/is-number-fold-tricky.html: Added.
* js/regress/is-number-fold.html: Added.
* js/regress/is-object-or-null-fold-expected.txt: Added.
* js/regress/is-object-or-null-fold-functions-expected.txt: Added.
* js/regress/is-object-or-null-fold-functions.html: Added.
* js/regress/is-object-or-null-fold-less-tricky-expected.txt: Added.
* js/regress/is-object-or-null-fold-less-tricky.html: Added.
* js/regress/is-object-or-null-fold-tricky-expected.txt: Added.
* js/regress/is-object-or-null-fold-tricky.html: Added.
* js/regress/is-object-or-null-fold.html: Added.
* js/regress/is-object-or-null-trickier-function-expected.txt: Added.
* js/regress/is-object-or-null-trickier-function.html: Added.
* js/regress/is-object-or-null-trickier-internal-function-expected.txt: Added.
* js/regress/is-object-or-null-trickier-internal-function.html: Added.
* js/regress/is-object-or-null-tricky-function-expected.txt: Added.
* js/regress/is-object-or-null-tricky-function.html: Added.
* js/regress/is-object-or-null-tricky-internal-function-expected.txt: Added.
* js/regress/is-object-or-null-tricky-internal-function.html: Added.
* js/regress/is-string-fold-expected.txt: Added.
* js/regress/is-string-fold-tricky-expected.txt: Added.
* js/regress/is-string-fold-tricky.html: Added.
* js/regress/is-string-fold.html: Added.
* js/regress/is-undefined-fold-expected.txt: Added.
* js/regress/is-undefined-fold-tricky-expected.txt: Added.
* js/regress/is-undefined-fold-tricky.html: Added.
* js/regress/is-undefined-fold.html: Added.
* js/regress/script-tests/is-boolean-fold-tricky.js: Added.
* js/regress/script-tests/is-boolean-fold.js: Added.
* js/regress/script-tests/is-function-fold-tricky-internal-function.js: Added.
* js/regress/script-tests/is-function-fold-tricky.js: Added.
(func):
(func2):
* js/regress/script-tests/is-function-fold.js: Added.
(value1):
* js/regress/script-tests/is-number-fold-tricky.js: Added.
* js/regress/script-tests/is-number-fold.js: Added.
* js/regress/script-tests/is-object-or-null-fold-functions.js: Added.
(value2):
* js/regress/script-tests/is-object-or-null-fold-less-tricky.js: Added.
* js/regress/script-tests/is-object-or-null-fold-tricky.js: Added.
* js/regress/script-tests/is-object-or-null-fold.js: Added.
* js/regress/script-tests/is-object-or-null-trickier-function.js: Added.
(func):
(func2):
* js/regress/script-tests/is-object-or-null-trickier-internal-function.js: Added.
* js/regress/script-tests/is-object-or-null-tricky-function.js: Added.
(func):
* js/regress/script-tests/is-object-or-null-tricky-internal-function.js: Added.
* js/regress/script-tests/is-string-fold-tricky.js: Added.
* js/regress/script-tests/is-string-fold.js: Added.
* js/regress/script-tests/is-undefined-fold-tricky.js: Added.
* js/regress/script-tests/is-undefined-fold.js: Added.
* js/regress/sink-function-expected.txt: Added.
* js/regress/sink-function.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183629 268f45cc-cd09-0410-ab3c-d52691b4dbfc
62 files changed:
LayoutTests/ChangeLog
LayoutTests/js/regress/is-boolean-fold-expected.txt [new file with mode: 0644]
LayoutTests/js/regress/is-boolean-fold-tricky-expected.txt [new file with mode: 0644]
LayoutTests/js/regress/is-boolean-fold-tricky.html [new file with mode: 0644]
LayoutTests/js/regress/is-boolean-fold.html [new file with mode: 0644]
LayoutTests/js/regress/is-function-fold-expected.txt [new file with mode: 0644]
LayoutTests/js/regress/is-function-fold-tricky-expected.txt [new file with mode: 0644]
LayoutTests/js/regress/is-function-fold-tricky-internal-function-expected.txt [new file with mode: 0644]
LayoutTests/js/regress/is-function-fold-tricky-internal-function.html [new file with mode: 0644]
LayoutTests/js/regress/is-function-fold-tricky.html [new file with mode: 0644]
LayoutTests/js/regress/is-function-fold.html [new file with mode: 0644]
LayoutTests/js/regress/is-number-fold-expected.txt [new file with mode: 0644]
LayoutTests/js/regress/is-number-fold-tricky-expected.txt [new file with mode: 0644]
LayoutTests/js/regress/is-number-fold-tricky.html [new file with mode: 0644]
LayoutTests/js/regress/is-number-fold.html [new file with mode: 0644]
LayoutTests/js/regress/is-object-or-null-fold-expected.txt [new file with mode: 0644]
LayoutTests/js/regress/is-object-or-null-fold-functions-expected.txt [new file with mode: 0644]
LayoutTests/js/regress/is-object-or-null-fold-functions.html [new file with mode: 0644]
LayoutTests/js/regress/is-object-or-null-fold-less-tricky-expected.txt [new file with mode: 0644]
LayoutTests/js/regress/is-object-or-null-fold-less-tricky.html [new file with mode: 0644]
LayoutTests/js/regress/is-object-or-null-fold-tricky-expected.txt [new file with mode: 0644]
LayoutTests/js/regress/is-object-or-null-fold-tricky.html [new file with mode: 0644]
LayoutTests/js/regress/is-object-or-null-fold.html [new file with mode: 0644]
LayoutTests/js/regress/is-object-or-null-trickier-function-expected.txt [new file with mode: 0644]
LayoutTests/js/regress/is-object-or-null-trickier-function.html [new file with mode: 0644]
LayoutTests/js/regress/is-object-or-null-trickier-internal-function-expected.txt [new file with mode: 0644]
LayoutTests/js/regress/is-object-or-null-trickier-internal-function.html [new file with mode: 0644]
LayoutTests/js/regress/is-object-or-null-tricky-function-expected.txt [new file with mode: 0644]
LayoutTests/js/regress/is-object-or-null-tricky-function.html [new file with mode: 0644]
LayoutTests/js/regress/is-object-or-null-tricky-internal-function-expected.txt [new file with mode: 0644]
LayoutTests/js/regress/is-object-or-null-tricky-internal-function.html [new file with mode: 0644]
LayoutTests/js/regress/is-string-fold-expected.txt [new file with mode: 0644]
LayoutTests/js/regress/is-string-fold-tricky-expected.txt [new file with mode: 0644]
LayoutTests/js/regress/is-string-fold-tricky.html [new file with mode: 0644]
LayoutTests/js/regress/is-string-fold.html [new file with mode: 0644]
LayoutTests/js/regress/is-undefined-fold-expected.txt [new file with mode: 0644]
LayoutTests/js/regress/is-undefined-fold-tricky-expected.txt [new file with mode: 0644]
LayoutTests/js/regress/is-undefined-fold-tricky.html [new file with mode: 0644]
LayoutTests/js/regress/is-undefined-fold.html [new file with mode: 0644]
LayoutTests/js/regress/script-tests/is-boolean-fold-tricky.js [new file with mode: 0644]
LayoutTests/js/regress/script-tests/is-boolean-fold.js [new file with mode: 0644]
LayoutTests/js/regress/script-tests/is-function-fold-tricky-internal-function.js [new file with mode: 0644]
LayoutTests/js/regress/script-tests/is-function-fold-tricky.js [new file with mode: 0644]
LayoutTests/js/regress/script-tests/is-function-fold.js [new file with mode: 0644]
LayoutTests/js/regress/script-tests/is-number-fold-tricky.js [new file with mode: 0644]
LayoutTests/js/regress/script-tests/is-number-fold.js [new file with mode: 0644]
LayoutTests/js/regress/script-tests/is-object-or-null-fold-functions.js [new file with mode: 0644]
LayoutTests/js/regress/script-tests/is-object-or-null-fold-less-tricky.js [new file with mode: 0644]
LayoutTests/js/regress/script-tests/is-object-or-null-fold-tricky.js [new file with mode: 0644]
LayoutTests/js/regress/script-tests/is-object-or-null-fold.js [new file with mode: 0644]
LayoutTests/js/regress/script-tests/is-object-or-null-trickier-function.js [new file with mode: 0644]
LayoutTests/js/regress/script-tests/is-object-or-null-trickier-internal-function.js [new file with mode: 0644]
LayoutTests/js/regress/script-tests/is-object-or-null-tricky-function.js [new file with mode: 0644]
LayoutTests/js/regress/script-tests/is-object-or-null-tricky-internal-function.js [new file with mode: 0644]
LayoutTests/js/regress/script-tests/is-string-fold-tricky.js [new file with mode: 0644]
LayoutTests/js/regress/script-tests/is-string-fold.js [new file with mode: 0644]
LayoutTests/js/regress/script-tests/is-undefined-fold-tricky.js [new file with mode: 0644]
LayoutTests/js/regress/script-tests/is-undefined-fold.js [new file with mode: 0644]
LayoutTests/js/regress/sink-function-expected.txt [new file with mode: 0644]
LayoutTests/js/regress/sink-function.html [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h