Title: [183629] trunk
Revision
183629
Author
fpi...@apple.com
Date
2015-04-30 10:36:26 -0700 (Thu, 30 Apr 2015)

Log Message

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/_javascript_Core:

        
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.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (183628 => 183629)


--- trunk/LayoutTests/ChangeLog	2015-04-30 17:21:55 UTC (rev 183628)
+++ trunk/LayoutTests/ChangeLog	2015-04-30 17:36:26 UTC (rev 183629)
@@ -1,3 +1,77 @@
+2015-04-29  Filip Pizlo  <fpi...@apple.com>
+
+        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.
+
+        * 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.
+
 2015-04-30  Brent Fulgham  <bfulg...@apple.com>
 
         [Mac] Expand test infrastructure to support scrolling tests (Part 3)

Added: trunk/LayoutTests/js/regress/is-boolean-fold-expected.txt (0 => 183629)


--- trunk/LayoutTests/js/regress/is-boolean-fold-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-boolean-fold-expected.txt	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,10 @@
+JSRegress/is-boolean-fold
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/regress/is-boolean-fold-tricky-expected.txt (0 => 183629)


--- trunk/LayoutTests/js/regress/is-boolean-fold-tricky-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-boolean-fold-tricky-expected.txt	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,10 @@
+JSRegress/is-boolean-fold-tricky
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/regress/is-boolean-fold-tricky.html (0 => 183629)


--- trunk/LayoutTests/js/regress/is-boolean-fold-tricky.html	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-boolean-fold-tricky.html	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/js/regress/is-boolean-fold.html (0 => 183629)


--- trunk/LayoutTests/js/regress/is-boolean-fold.html	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-boolean-fold.html	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/js/regress/is-function-fold-expected.txt (0 => 183629)


--- trunk/LayoutTests/js/regress/is-function-fold-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-function-fold-expected.txt	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,10 @@
+JSRegress/is-function-fold
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/regress/is-function-fold-tricky-expected.txt (0 => 183629)


--- trunk/LayoutTests/js/regress/is-function-fold-tricky-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-function-fold-tricky-expected.txt	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,10 @@
+JSRegress/is-function-fold-tricky
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/regress/is-function-fold-tricky-internal-function-expected.txt (0 => 183629)


--- trunk/LayoutTests/js/regress/is-function-fold-tricky-internal-function-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-function-fold-tricky-internal-function-expected.txt	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,10 @@
+JSRegress/is-function-fold-tricky-internal-function
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/regress/is-function-fold-tricky-internal-function.html (0 => 183629)


--- trunk/LayoutTests/js/regress/is-function-fold-tricky-internal-function.html	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-function-fold-tricky-internal-function.html	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/js/regress/is-function-fold-tricky.html (0 => 183629)


--- trunk/LayoutTests/js/regress/is-function-fold-tricky.html	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-function-fold-tricky.html	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/js/regress/is-function-fold.html (0 => 183629)


--- trunk/LayoutTests/js/regress/is-function-fold.html	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-function-fold.html	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/js/regress/is-number-fold-expected.txt (0 => 183629)


--- trunk/LayoutTests/js/regress/is-number-fold-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-number-fold-expected.txt	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,10 @@
+JSRegress/is-number-fold
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/regress/is-number-fold-tricky-expected.txt (0 => 183629)


--- trunk/LayoutTests/js/regress/is-number-fold-tricky-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-number-fold-tricky-expected.txt	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,10 @@
+JSRegress/is-number-fold-tricky
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/regress/is-number-fold-tricky.html (0 => 183629)


--- trunk/LayoutTests/js/regress/is-number-fold-tricky.html	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-number-fold-tricky.html	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/js/regress/is-number-fold.html (0 => 183629)


--- trunk/LayoutTests/js/regress/is-number-fold.html	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-number-fold.html	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/js/regress/is-object-or-null-fold-expected.txt (0 => 183629)


--- trunk/LayoutTests/js/regress/is-object-or-null-fold-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-object-or-null-fold-expected.txt	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,10 @@
+JSRegress/is-object-or-null-fold
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/regress/is-object-or-null-fold-functions-expected.txt (0 => 183629)


--- trunk/LayoutTests/js/regress/is-object-or-null-fold-functions-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-object-or-null-fold-functions-expected.txt	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,10 @@
+JSRegress/is-object-or-null-fold-functions
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/regress/is-object-or-null-fold-functions.html (0 => 183629)


--- trunk/LayoutTests/js/regress/is-object-or-null-fold-functions.html	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-object-or-null-fold-functions.html	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/js/regress/is-object-or-null-fold-less-tricky-expected.txt (0 => 183629)


--- trunk/LayoutTests/js/regress/is-object-or-null-fold-less-tricky-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-object-or-null-fold-less-tricky-expected.txt	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,10 @@
+JSRegress/is-object-or-null-fold-less-tricky
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/regress/is-object-or-null-fold-less-tricky.html (0 => 183629)


--- trunk/LayoutTests/js/regress/is-object-or-null-fold-less-tricky.html	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-object-or-null-fold-less-tricky.html	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/js/regress/is-object-or-null-fold-tricky-expected.txt (0 => 183629)


--- trunk/LayoutTests/js/regress/is-object-or-null-fold-tricky-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-object-or-null-fold-tricky-expected.txt	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,10 @@
+JSRegress/is-object-or-null-fold-tricky
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/regress/is-object-or-null-fold-tricky.html (0 => 183629)


--- trunk/LayoutTests/js/regress/is-object-or-null-fold-tricky.html	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-object-or-null-fold-tricky.html	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/js/regress/is-object-or-null-fold.html (0 => 183629)


--- trunk/LayoutTests/js/regress/is-object-or-null-fold.html	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-object-or-null-fold.html	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/js/regress/is-object-or-null-trickier-function-expected.txt (0 => 183629)


--- trunk/LayoutTests/js/regress/is-object-or-null-trickier-function-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-object-or-null-trickier-function-expected.txt	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,10 @@
+JSRegress/is-object-or-null-trickier-function
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/regress/is-object-or-null-trickier-function.html (0 => 183629)


--- trunk/LayoutTests/js/regress/is-object-or-null-trickier-function.html	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-object-or-null-trickier-function.html	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/js/regress/is-object-or-null-trickier-internal-function-expected.txt (0 => 183629)


--- trunk/LayoutTests/js/regress/is-object-or-null-trickier-internal-function-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-object-or-null-trickier-internal-function-expected.txt	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,10 @@
+JSRegress/is-object-or-null-trickier-internal-function
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/regress/is-object-or-null-trickier-internal-function.html (0 => 183629)


--- trunk/LayoutTests/js/regress/is-object-or-null-trickier-internal-function.html	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-object-or-null-trickier-internal-function.html	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/js/regress/is-object-or-null-tricky-function-expected.txt (0 => 183629)


--- trunk/LayoutTests/js/regress/is-object-or-null-tricky-function-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-object-or-null-tricky-function-expected.txt	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,10 @@
+JSRegress/is-object-or-null-tricky-function
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/regress/is-object-or-null-tricky-function.html (0 => 183629)


--- trunk/LayoutTests/js/regress/is-object-or-null-tricky-function.html	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-object-or-null-tricky-function.html	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/js/regress/is-object-or-null-tricky-internal-function-expected.txt (0 => 183629)


--- trunk/LayoutTests/js/regress/is-object-or-null-tricky-internal-function-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-object-or-null-tricky-internal-function-expected.txt	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,10 @@
+JSRegress/is-object-or-null-tricky-internal-function
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/regress/is-object-or-null-tricky-internal-function.html (0 => 183629)


--- trunk/LayoutTests/js/regress/is-object-or-null-tricky-internal-function.html	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-object-or-null-tricky-internal-function.html	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/js/regress/is-string-fold-expected.txt (0 => 183629)


--- trunk/LayoutTests/js/regress/is-string-fold-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-string-fold-expected.txt	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,10 @@
+JSRegress/is-string-fold
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/regress/is-string-fold-tricky-expected.txt (0 => 183629)


--- trunk/LayoutTests/js/regress/is-string-fold-tricky-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-string-fold-tricky-expected.txt	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,10 @@
+JSRegress/is-string-fold-tricky
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/regress/is-string-fold-tricky.html (0 => 183629)


--- trunk/LayoutTests/js/regress/is-string-fold-tricky.html	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-string-fold-tricky.html	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/js/regress/is-string-fold.html (0 => 183629)


--- trunk/LayoutTests/js/regress/is-string-fold.html	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-string-fold.html	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/js/regress/is-undefined-fold-expected.txt (0 => 183629)


--- trunk/LayoutTests/js/regress/is-undefined-fold-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-undefined-fold-expected.txt	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,10 @@
+JSRegress/is-undefined-fold
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/regress/is-undefined-fold-tricky-expected.txt (0 => 183629)


--- trunk/LayoutTests/js/regress/is-undefined-fold-tricky-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-undefined-fold-tricky-expected.txt	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,10 @@
+JSRegress/is-undefined-fold-tricky
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/regress/is-undefined-fold-tricky.html (0 => 183629)


--- trunk/LayoutTests/js/regress/is-undefined-fold-tricky.html	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-undefined-fold-tricky.html	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/js/regress/is-undefined-fold.html (0 => 183629)


--- trunk/LayoutTests/js/regress/is-undefined-fold.html	                        (rev 0)
+++ trunk/LayoutTests/js/regress/is-undefined-fold.html	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/js/regress/script-tests/is-boolean-fold-tricky.js (0 => 183629)


--- trunk/LayoutTests/js/regress/script-tests/is-boolean-fold-tricky.js	                        (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/is-boolean-fold-tricky.js	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+var object = {};
+(function() {
+    var result = 0;
+    for (var i = 0; i < 1000000; ++i) {
+        var value1 = (i & 1) ? true : false;
+        var value2 = (i & 1) ? "hello" : object;
+        result += (typeof value1 == "boolean");
+        result += (typeof value2 == "boolean") << 1;
+    }
+    if (result != 1000000)
+        throw "Error: bad result: " + result;
+})();

Added: trunk/LayoutTests/js/regress/script-tests/is-boolean-fold.js (0 => 183629)


--- trunk/LayoutTests/js/regress/script-tests/is-boolean-fold.js	                        (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/is-boolean-fold.js	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,11 @@
+var value1 = true;
+var value2 = "hello";
+(function() {
+    var result = 0;
+    for (var i = 0; i < 1000000; ++i) {
+        result += (typeof value1 == "boolean");
+        result += (typeof value2 == "boolean") << 1;
+    }
+    if (result != 1000000)
+        throw "Error: bad result: " + result;
+})();

Added: trunk/LayoutTests/js/regress/script-tests/is-function-fold-tricky-internal-function.js (0 => 183629)


--- trunk/LayoutTests/js/regress/script-tests/is-function-fold-tricky-internal-function.js	                        (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/is-function-fold-tricky-internal-function.js	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+var object = {};
+(function() {
+    var result = 0;
+    for (var i = 0; i < 1000000; ++i) {
+        var value1 = (i & 1) ? Map : Set;
+        var value2 = (i & 1) ? object : "hello";
+        result += (typeof value1 == "function");
+        result += (typeof value2 == "function") << 1;
+    }
+    if (result != 1000000)
+        throw "Error: bad result: " + result;
+})();

Added: trunk/LayoutTests/js/regress/script-tests/is-function-fold-tricky.js (0 => 183629)


--- trunk/LayoutTests/js/regress/script-tests/is-function-fold-tricky.js	                        (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/is-function-fold-tricky.js	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,14 @@
+var object = {};
+var func = function() { };
+var func2 = function() { return 42; };
+(function() {
+    var result = 0;
+    for (var i = 0; i < 1000000; ++i) {
+        var value1 = (i & 1) ? func : func2;
+        var value2 = (i & 1) ? object : "hello";
+        result += (typeof value1 == "function");
+        result += (typeof value2 == "function") << 1;
+    }
+    if (result != 1000000)
+        throw "Error: bad result: " + result;
+})();

Added: trunk/LayoutTests/js/regress/script-tests/is-function-fold.js (0 => 183629)


--- trunk/LayoutTests/js/regress/script-tests/is-function-fold.js	                        (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/is-function-fold.js	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,11 @@
+var value1 = function() { };
+var value2 = 42;
+(function() {
+    var result = 0;
+    for (var i = 0; i < 1000000; ++i) {
+        result += (typeof value1 == "function");
+        result += (typeof value2 == "function") << 1;
+    }
+    if (result != 1000000)
+        throw "Error: bad result: " + result;
+})();

Added: trunk/LayoutTests/js/regress/script-tests/is-number-fold-tricky.js (0 => 183629)


--- trunk/LayoutTests/js/regress/script-tests/is-number-fold-tricky.js	                        (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/is-number-fold-tricky.js	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+var object = {};
+(function() {
+    var result = 0;
+    for (var i = 0; i < 1000000; ++i) {
+        var value1 = (i & 1) ? 42.5 : 42;
+        var value2 = (i & 1) ? "hello" : object;
+        result += (typeof value1 == "number");
+        result += (typeof value2 == "number") << 1;
+    }
+    if (result != 1000000)
+        throw "Error: bad result: " + result;
+})();

Added: trunk/LayoutTests/js/regress/script-tests/is-number-fold.js (0 => 183629)


--- trunk/LayoutTests/js/regress/script-tests/is-number-fold.js	                        (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/is-number-fold.js	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,11 @@
+var value1 = 42;
+var value2 = "hello";
+(function() {
+    var result = 0;
+    for (var i = 0; i < 1000000; ++i) {
+        result += (typeof value1 == "number");
+        result += (typeof value2 == "number") << 1;
+    }
+    if (result != 1000000)
+        throw "Error: bad result: " + result;
+})();

Added: trunk/LayoutTests/js/regress/script-tests/is-object-or-null-fold-functions.js (0 => 183629)


--- trunk/LayoutTests/js/regress/script-tests/is-object-or-null-fold-functions.js	                        (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/is-object-or-null-fold-functions.js	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,11 @@
+var value1 = {};
+var value2 = function() { };
+(function() {
+    var result = 0;
+    for (var i = 0; i < 1000000; ++i) {
+        result += (typeof value1 == "object");
+        result += (typeof value2 == "object") << 1;
+    }
+    if (result != 1000000)
+        throw "Error: bad result: " + result;
+})();

Added: trunk/LayoutTests/js/regress/script-tests/is-object-or-null-fold-less-tricky.js (0 => 183629)


--- trunk/LayoutTests/js/regress/script-tests/is-object-or-null-fold-less-tricky.js	                        (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/is-object-or-null-fold-less-tricky.js	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,13 @@
+var object = {};
+var array = [];
+(function() {
+    var result = 0;
+    for (var i = 0; i < 1000000; ++i) {
+        var value1 = (i & 1) ? array : object;
+        var value2 = (i & 1) ? 42 : "hello";
+        result += (typeof value1 == "object");
+        result += (typeof value2 == "object") << 1;
+    }
+    if (result != 1000000)
+        throw "Error: bad result: " + result;
+})();

Added: trunk/LayoutTests/js/regress/script-tests/is-object-or-null-fold-tricky.js (0 => 183629)


--- trunk/LayoutTests/js/regress/script-tests/is-object-or-null-fold-tricky.js	                        (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/is-object-or-null-fold-tricky.js	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+var object = {};
+(function() {
+    var result = 0;
+    for (var i = 0; i < 1000000; ++i) {
+        var value1 = (i & 1) ? null : object;
+        var value2 = (i & 1) ? 42 : "hello";
+        result += (typeof value1 == "object");
+        result += (typeof value2 == "object") << 1;
+    }
+    if (result != 1000000)
+        throw "Error: bad result: " + result;
+})();

Added: trunk/LayoutTests/js/regress/script-tests/is-object-or-null-fold.js (0 => 183629)


--- trunk/LayoutTests/js/regress/script-tests/is-object-or-null-fold.js	                        (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/is-object-or-null-fold.js	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,11 @@
+var value1 = {};
+var value2 = 42;
+(function() {
+    var result = 0;
+    for (var i = 0; i < 1000000; ++i) {
+        result += (typeof value1 == "object");
+        result += (typeof value2 == "object") << 1;
+    }
+    if (result != 1000000)
+        throw "Error: bad result: " + result;
+})();

Added: trunk/LayoutTests/js/regress/script-tests/is-object-or-null-trickier-function.js (0 => 183629)


--- trunk/LayoutTests/js/regress/script-tests/is-object-or-null-trickier-function.js	                        (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/is-object-or-null-trickier-function.js	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,15 @@
+var object = {};
+var array = [];
+var func = function() { };
+var func2 = function() { return 32; };
+(function() {
+    var result = 0;
+    for (var i = 0; i < 1000000; ++i) {
+        var value1 = (i & 1) ? array : object;
+        var value2 = (i & 1) ? func : func2;
+        result += (typeof value1 == "object");
+        result += (typeof value2 == "object") << 1;
+    }
+    if (result != 1000000)
+        throw "Error: bad result: " + result;
+})();

Added: trunk/LayoutTests/js/regress/script-tests/is-object-or-null-trickier-internal-function.js (0 => 183629)


--- trunk/LayoutTests/js/regress/script-tests/is-object-or-null-trickier-internal-function.js	                        (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/is-object-or-null-trickier-internal-function.js	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,13 @@
+var object = {};
+var array = [];
+(function() {
+    var result = 0;
+    for (var i = 0; i < 1000000; ++i) {
+        var value1 = (i & 1) ? array : object;
+        var value2 = (i & 1) ? Map : Set;
+        result += (typeof value1 == "object");
+        result += (typeof value2 == "object") << 1;
+    }
+    if (result != 1000000)
+        throw "Error: bad result: " + result;
+})();

Added: trunk/LayoutTests/js/regress/script-tests/is-object-or-null-tricky-function.js (0 => 183629)


--- trunk/LayoutTests/js/regress/script-tests/is-object-or-null-tricky-function.js	                        (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/is-object-or-null-tricky-function.js	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,14 @@
+var object = {};
+var array = [];
+var func = function() { };
+(function() {
+    var result = 0;
+    for (var i = 0; i < 1000000; ++i) {
+        var value1 = (i & 1) ? array : object;
+        var value2 = (i & 1) ? func : "hello";
+        result += (typeof value1 == "object");
+        result += (typeof value2 == "object") << 1;
+    }
+    if (result != 1000000)
+        throw "Error: bad result: " + result;
+})();

Added: trunk/LayoutTests/js/regress/script-tests/is-object-or-null-tricky-internal-function.js (0 => 183629)


--- trunk/LayoutTests/js/regress/script-tests/is-object-or-null-tricky-internal-function.js	                        (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/is-object-or-null-tricky-internal-function.js	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,13 @@
+var object = {};
+var array = [];
+(function() {
+    var result = 0;
+    for (var i = 0; i < 1000000; ++i) {
+        var value1 = (i & 1) ? array : object;
+        var value2 = (i & 1) ? Map : "hello";
+        result += (typeof value1 == "object");
+        result += (typeof value2 == "object") << 1;
+    }
+    if (result != 1000000)
+        throw "Error: bad result: " + result;
+})();

Added: trunk/LayoutTests/js/regress/script-tests/is-string-fold-tricky.js (0 => 183629)


--- trunk/LayoutTests/js/regress/script-tests/is-string-fold-tricky.js	                        (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/is-string-fold-tricky.js	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+var object = {};
+(function() {
+    var result = 0;
+    for (var i = 0; i < 1000000; ++i) {
+        var value1 = (i & 1) ? "hello" : "world";
+        var value2 = (i & 1) ? 42 : object;
+        result += (typeof value1 == "string");
+        result += (typeof value2 == "string") << 1;
+    }
+    if (result != 1000000)
+        throw "Error: bad result: " + result;
+})();

Added: trunk/LayoutTests/js/regress/script-tests/is-string-fold.js (0 => 183629)


--- trunk/LayoutTests/js/regress/script-tests/is-string-fold.js	                        (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/is-string-fold.js	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,11 @@
+var value1 = "hello";
+var value2 = 42;
+(function() {
+    var result = 0;
+    for (var i = 0; i < 1000000; ++i) {
+        result += (typeof value1 == "string");
+        result += (typeof value2 == "string") << 1;
+    }
+    if (result != 1000000)
+        throw "Error: bad result: " + result;
+})();

Added: trunk/LayoutTests/js/regress/script-tests/is-undefined-fold-tricky.js (0 => 183629)


--- trunk/LayoutTests/js/regress/script-tests/is-undefined-fold-tricky.js	                        (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/is-undefined-fold-tricky.js	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+var object = {};
+(function() {
+    var result = 0;
+    for (var i = 0; i < 1000000; ++i) {
+        var value1 = void 0;
+        var value2 = (i & 1) ? "hello" : object;
+        result += (typeof value1 == "undefined");
+        result += (typeof value2 == "undefined") << 1;
+    }
+    if (result != 1000000)
+        throw "Error: bad result: " + result;
+})();

Added: trunk/LayoutTests/js/regress/script-tests/is-undefined-fold.js (0 => 183629)


--- trunk/LayoutTests/js/regress/script-tests/is-undefined-fold.js	                        (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/is-undefined-fold.js	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,11 @@
+var value1 = void 0;
+var value2 = "hello";
+(function() {
+    var result = 0;
+    for (var i = 0; i < 1000000; ++i) {
+        result += (typeof value1 == "undefined");
+        result += (typeof value2 == "undefined") << 1;
+    }
+    if (result != 1000000)
+        throw "Error: bad result: " + result;
+})();

Added: trunk/LayoutTests/js/regress/sink-function-expected.txt (0 => 183629)


--- trunk/LayoutTests/js/regress/sink-function-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/regress/sink-function-expected.txt	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,10 @@
+JSRegress/sink-function
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/regress/sink-function.html (0 => 183629)


--- trunk/LayoutTests/js/regress/sink-function.html	                        (rev 0)
+++ trunk/LayoutTests/js/regress/sink-function.html	2015-04-30 17:36:26 UTC (rev 183629)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>

Modified: trunk/Source/_javascript_Core/ChangeLog (183628 => 183629)


--- trunk/Source/_javascript_Core/ChangeLog	2015-04-30 17:21:55 UTC (rev 183628)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-04-30 17:36:26 UTC (rev 183629)
@@ -1,3 +1,19 @@
+2015-04-29  Filip Pizlo  <fpi...@apple.com>
+
+        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.
+        
+        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):
+
 2015-04-30  Yusuke Suzuki  <utatane....@gmail.com>
 
         Use the default hash value for Symbolized StringImpl

Modified: trunk/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h (183628 => 183629)


--- trunk/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h	2015-04-30 17:21:55 UTC (rev 183628)
+++ trunk/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h	2015-04-30 17:36:26 UTC (rev 183629)
@@ -834,35 +834,58 @@
     case IsObject:
     case IsObjectOrNull:
     case IsFunction: {
-        JSValue child = forNode(node->child1()).value();
-        if (child) {
+        AbstractValue child = forNode(node->child1());
+        if (child.value()) {
             bool constantWasSet = true;
             switch (node->op()) {
             case IsUndefined:
                 setConstant(node, jsBoolean(
-                    child.isCell()
-                    ? child.asCell()->structure()->masqueradesAsUndefined(m_codeBlock->globalObjectFor(node->origin.semantic))
-                    : child.isUndefined()));
+                    child.value().isCell()
+                    ? child.value().asCell()->structure()->masqueradesAsUndefined(m_codeBlock->globalObjectFor(node->origin.semantic))
+                    : child.value().isUndefined()));
                 break;
             case IsBoolean:
-                setConstant(node, jsBoolean(child.isBoolean()));
+                setConstant(node, jsBoolean(child.value().isBoolean()));
                 break;
             case IsNumber:
-                setConstant(node, jsBoolean(child.isNumber()));
+                setConstant(node, jsBoolean(child.value().isNumber()));
                 break;
             case IsString:
-                setConstant(node, jsBoolean(isJSString(child)));
+                setConstant(node, jsBoolean(isJSString(child.value())));
                 break;
             case IsObject:
-                setConstant(node, jsBoolean(child.isObject()));
+                setConstant(node, jsBoolean(child.value().isObject()));
                 break;
             case IsObjectOrNull:
-                if (child.isNull() || !child.isObject()) {
-                    setConstant(node, jsBoolean(child.isNull()));
-                    break;
-                }
-                constantWasSet = false;
+                if (child.value().isObject()) {
+                    JSObject* object = asObject(child.value());
+                    if (object->type() == JSFunctionType)
+                        setConstant(node, jsBoolean(false));
+                    else if (!(object->inlineTypeFlags() & TypeOfShouldCallGetCallData))
+                        setConstant(node, jsBoolean(!child.value().asCell()->structure()->masqueradesAsUndefined(m_codeBlock->globalObjectFor(node->origin.semantic))));
+                    else {
+                        // FIXME: This could just call getCallData.
+                        // https://bugs.webkit.org/show_bug.cgi?id=144457
+                        constantWasSet = false;
+                    }
+                } else
+                    setConstant(node, jsBoolean(child.value().isNull()));
                 break;
+            case IsFunction:
+                if (child.value().isObject()) {
+                    JSObject* object = asObject(child.value());
+                    if (object->type() == JSFunctionType)
+                        setConstant(node, jsBoolean(true));
+                    else if (!(object->inlineTypeFlags() & TypeOfShouldCallGetCallData))
+                        setConstant(node, jsBoolean(false));
+                    else {
+                        // FIXME: This could just call getCallData.
+                        // https://bugs.webkit.org/show_bug.cgi?id=144457
+                        constantWasSet = false;
+                    }
+                } else
+                    setConstant(node, jsBoolean(false));
+                break;
             default:
                 constantWasSet = false;
                 break;
@@ -870,7 +893,112 @@
             if (constantWasSet)
                 break;
         }
-
+        
+        bool constantWasSet = false;
+        switch (node->op()) {
+        case IsUndefined:
+            // FIXME: Use the masquerades-as-undefined watchpoint thingy.
+            // https://bugs.webkit.org/show_bug.cgi?id=144456
+            
+            if (!(child.m_type & (SpecOther | SpecObjectOther))) {
+                setConstant(node, jsBoolean(false));
+                constantWasSet = true;
+                break;
+            }
+            
+            break;
+        case IsBoolean:
+            if (!(child.m_type & ~SpecBoolean)) {
+                setConstant(node, jsBoolean(true));
+                constantWasSet = true;
+                break;
+            }
+            
+            if (!(child.m_type & SpecBoolean)) {
+                setConstant(node, jsBoolean(false));
+                constantWasSet = true;
+                break;
+            }
+            
+            break;
+        case IsNumber:
+            if (!(child.m_type & ~SpecFullNumber)) {
+                setConstant(node, jsBoolean(true));
+                constantWasSet = true;
+                break;
+            }
+            
+            if (!(child.m_type & SpecFullNumber)) {
+                setConstant(node, jsBoolean(false));
+                constantWasSet = true;
+                break;
+            }
+            
+            break;
+        case IsString:
+            if (!(child.m_type & ~SpecString)) {
+                setConstant(node, jsBoolean(true));
+                constantWasSet = true;
+                break;
+            }
+            
+            if (!(child.m_type & SpecString)) {
+                setConstant(node, jsBoolean(false));
+                constantWasSet = true;
+                break;
+            }
+            
+            break;
+        case IsObject:
+            if (!(child.m_type & ~SpecObject)) {
+                setConstant(node, jsBoolean(true));
+                constantWasSet = true;
+                break;
+            }
+            
+            if (!(child.m_type & SpecObject)) {
+                setConstant(node, jsBoolean(false));
+                constantWasSet = true;
+                break;
+            }
+            
+            break;
+        case IsObjectOrNull:
+            // FIXME: Use the masquerades-as-undefined watchpoint thingy.
+            // https://bugs.webkit.org/show_bug.cgi?id=144456
+            
+            if (!(child.m_type & ~(SpecObject - SpecObjectOther - SpecFunction))) {
+                setConstant(node, jsBoolean(true));
+                constantWasSet = true;
+                break;
+            }
+            
+            if (!(child.m_type & (SpecObject - SpecFunction))) {
+                setConstant(node, jsBoolean(false));
+                constantWasSet = true;
+                break;
+            }
+            
+            break;
+        case IsFunction:
+            if (!(child.m_type & ~SpecFunction)) {
+                setConstant(node, jsBoolean(true));
+                constantWasSet = true;
+                break;
+            }
+            
+            if (!(child.m_type & (SpecFunction | SpecObjectOther))) {
+                setConstant(node, jsBoolean(false));
+                constantWasSet = true;
+                break;
+            }
+            break;
+        default:
+            break;
+        }
+        if (constantWasSet)
+            break;
+        
         forNode(node).setType(SpecBoolean);
         break;
     }
@@ -894,8 +1022,10 @@
             setConstant(node, *m_graph.freeze(vm->smallStrings.stringString()));
             break;
         }
-        
-        if (isFinalObjectSpeculation(abstractChild.m_type) || isArraySpeculation(abstractChild.m_type) || isDirectArgumentsSpeculation(abstractChild.m_type) || isScopedArgumentsSpeculation(abstractChild.m_type)) {
+
+        // FIXME: We could use the masquerades-as-undefined watchpoint here.
+        // https://bugs.webkit.org/show_bug.cgi?id=144456
+        if (!(abstractChild.m_type & ~(SpecObject - SpecObjectOther))) {
             setConstant(node, *m_graph.freeze(vm->smallStrings.objectString()));
             break;
         }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to