Title: [184510] trunk
Revision
184510
Author
[email protected]
Date
2015-05-18 13:41:54 -0700 (Mon, 18 May 2015)

Log Message

Add a Int-or-Boolean speculation to Branch
https://bugs.webkit.org/show_bug.cgi?id=145134

Reviewed by Benjamin Poulain.
        
Source/_javascript_Core:

After https://bugs.webkit.org/show_bug.cgi?id=126778 we no longer have a reason not to do the
int-or-boolean optimization that we already do everywhere else.

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

LayoutTests:

Added the reduced asm.js test case from https://bugs.webkit.org/show_bug.cgi?id=144136. We don't yet
run it as fast as we should but this is a big step.

* js/regress/script-tests/slow-ternaries.js: Added.
(.f):
(asmMod):
* js/regress/slow-ternaries-expected.txt: Added.
* js/regress/slow-ternaries.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (184509 => 184510)


--- trunk/LayoutTests/ChangeLog	2015-05-18 20:15:49 UTC (rev 184509)
+++ trunk/LayoutTests/ChangeLog	2015-05-18 20:41:54 UTC (rev 184510)
@@ -1,3 +1,19 @@
+2015-05-18  Filip Pizlo  <[email protected]>
+
+        Add a Int-or-Boolean speculation to Branch
+        https://bugs.webkit.org/show_bug.cgi?id=145134
+
+        Reviewed by Benjamin Poulain.
+        
+        Added the reduced asm.js test case from https://bugs.webkit.org/show_bug.cgi?id=144136. We don't yet
+        run it as fast as we should but this is a big step.
+
+        * js/regress/script-tests/slow-ternaries.js: Added.
+        (.f):
+        (asmMod):
+        * js/regress/slow-ternaries-expected.txt: Added.
+        * js/regress/slow-ternaries.html: Added.
+
 2015-05-17  Benjamin Poulain  <[email protected]>
 
         [JSC] Make StringRecursionChecker faster in the simple cases without any recursion

Added: trunk/LayoutTests/js/regress/script-tests/slow-ternaries.js (0 => 184510)


--- trunk/LayoutTests/js/regress/script-tests/slow-ternaries.js	                        (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/slow-ternaries.js	2015-05-18 20:41:54 UTC (rev 184510)
@@ -0,0 +1,16 @@
+var asmMod = function test (glob, env, b) {
+  'use asm';
+  const i8 = new glob.Int8Array(b);
+  function f() {
+    var i = 0; var r = 0;
+    for (i = 0; (i | 0) < 3000000; i = (i + 1) | 0) {
+      if ((i8[(i & 0xff) >> 0] | 0) == 1 ? ((i8[((i & 0xff) + 1) >> 0] | 0) == 2 ? ((i8[((i & 0xff) + 2) >> 0] | 0) == 3 ? (i8[((i & 0xff) + 3) >> 0] | 0) == 4 : 0) : 0) : 0)
+        r = 1;
+    }
+    return r | 0;
+  }
+  return f;
+};
+var buffer1 = new ArrayBuffer(64*1024);
+var asm1 = asmMod(this, {}, buffer1);
+for (var i = 0; i < 5; i++) asm1();

Added: trunk/LayoutTests/js/regress/slow-ternaries-expected.txt (0 => 184510)


--- trunk/LayoutTests/js/regress/slow-ternaries-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/regress/slow-ternaries-expected.txt	2015-05-18 20:41:54 UTC (rev 184510)
@@ -0,0 +1,10 @@
+JSRegress/slow-ternaries
+
+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/slow-ternaries.html (0 => 184510)


--- trunk/LayoutTests/js/regress/slow-ternaries.html	                        (rev 0)
+++ trunk/LayoutTests/js/regress/slow-ternaries.html	2015-05-18 20:41:54 UTC (rev 184510)
@@ -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 (184509 => 184510)


--- trunk/Source/_javascript_Core/ChangeLog	2015-05-18 20:15:49 UTC (rev 184509)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-05-18 20:41:54 UTC (rev 184510)
@@ -1,3 +1,16 @@
+2015-05-18  Filip Pizlo  <[email protected]>
+
+        Add a Int-or-Boolean speculation to Branch
+        https://bugs.webkit.org/show_bug.cgi?id=145134
+
+        Reviewed by Benjamin Poulain.
+        
+        After https://bugs.webkit.org/show_bug.cgi?id=126778 we no longer have a reason not to do the
+        int-or-boolean optimization that we already do everywhere else.
+
+        * dfg/DFGFixupPhase.cpp:
+        (JSC::DFG::FixupPhase::fixupNode):
+
 2015-05-18  Andreas Kling  <[email protected]>
 
         [JSC] Speed up URL encode/decode by using bitmaps instead of strchr().

Modified: trunk/Source/_javascript_Core/dfg/DFGFixupPhase.cpp (184509 => 184510)


--- trunk/Source/_javascript_Core/dfg/DFGFixupPhase.cpp	2015-05-18 20:15:49 UTC (rev 184509)
+++ trunk/Source/_javascript_Core/dfg/DFGFixupPhase.cpp	2015-05-18 20:41:54 UTC (rev 184510)
@@ -786,11 +786,8 @@
                 fixEdge<BooleanUse>(node->child1());
             else if (node->child1()->shouldSpeculateObjectOrOther())
                 fixEdge<ObjectOrOtherUse>(node->child1());
-            // FIXME: We should just be able to do shouldSpeculateInt32OrBoolean() and
-            // shouldSpeculateNumberOrBoolean() here now that
-            // https://bugs.webkit.org/show_bug.cgi?id=126778 is fixed.
-            else if (node->child1()->shouldSpeculateInt32())
-                fixEdge<Int32Use>(node->child1());
+            else if (node->child1()->shouldSpeculateInt32OrBoolean())
+                fixIntOrBooleanEdge(node->child1());
             else if (node->child1()->shouldSpeculateNumber())
                 fixEdge<DoubleRepUse>(node->child1());
             else if (node->child1()->shouldSpeculateString())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to