Title: [197761] releases/WebKitGTK/webkit-2.12/Source/_javascript_Core
Revision
197761
Author
[email protected]
Date
2016-03-08 06:23:18 -0800 (Tue, 08 Mar 2016)

Log Message

Merge r197542 - Octane/regexp's Exec function should benefit from array length accessor inlining
https://bugs.webkit.org/show_bug.cgi?id=154994

Reviewed by Benjamin Poulain.

It does:

    var thingy = blahbitty.blah;
    if (thingy)
        foo = thingy.length;

So, 'thingy' is SpecArray | SpecOther, which prevents the array length accessor inlining from
kicking in. Our strategy for this elsewhere in the DFG is to allow a one-time speculation that
we won't see SpecOther, since *usually* we see SpecOther mixed with other stuff in cases like
this where there is some null check guarding the code.

This gives another slight speed-up on Octane/regexp.

* bytecode/SpeculatedType.h:
(JSC::isCellSpeculation):
(JSC::isCellOrOtherSpeculation):
(JSC::isNotCellSpeculation):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::shouldSpeculateCell):
(JSC::DFG::Node::shouldSpeculateCellOrOther):
(JSC::DFG::Node::shouldSpeculateNotCell):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/ChangeLog (197760 => 197761)


--- releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/ChangeLog	2016-03-08 13:57:58 UTC (rev 197760)
+++ releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/ChangeLog	2016-03-08 14:23:18 UTC (rev 197761)
@@ -1,5 +1,36 @@
 2016-03-03  Filip Pizlo  <[email protected]>
 
+        Octane/regexp's Exec function should benefit from array length accessor inlining
+        https://bugs.webkit.org/show_bug.cgi?id=154994
+
+        Reviewed by Benjamin Poulain.
+
+        It does:
+
+            var thingy = blahbitty.blah;
+            if (thingy)
+                foo = thingy.length;
+
+        So, 'thingy' is SpecArray | SpecOther, which prevents the array length accessor inlining from
+        kicking in. Our strategy for this elsewhere in the DFG is to allow a one-time speculation that
+        we won't see SpecOther, since *usually* we see SpecOther mixed with other stuff in cases like
+        this where there is some null check guarding the code.
+
+        This gives another slight speed-up on Octane/regexp.
+
+        * bytecode/SpeculatedType.h:
+        (JSC::isCellSpeculation):
+        (JSC::isCellOrOtherSpeculation):
+        (JSC::isNotCellSpeculation):
+        * dfg/DFGFixupPhase.cpp:
+        (JSC::DFG::FixupPhase::fixupNode):
+        * dfg/DFGNode.h:
+        (JSC::DFG::Node::shouldSpeculateCell):
+        (JSC::DFG::Node::shouldSpeculateCellOrOther):
+        (JSC::DFG::Node::shouldSpeculateNotCell):
+
+2016-03-03  Filip Pizlo  <[email protected]>
+
         DFG should be able to compile StringReplace
         https://bugs.webkit.org/show_bug.cgi?id=154979
 

Modified: releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/bytecode/SpeculatedType.h (197760 => 197761)


--- releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/bytecode/SpeculatedType.h	2016-03-08 13:57:58 UTC (rev 197760)
+++ releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/bytecode/SpeculatedType.h	2016-03-08 14:23:18 UTC (rev 197761)
@@ -104,6 +104,11 @@
     return !!(value & SpecCell) && !(value & ~SpecCell);
 }
 
+inline bool isCellOrOtherSpeculation(SpeculatedType value)
+{
+    return !!value && !(value & ~(SpecCell | SpecOther));
+}
+
 inline bool isNotCellSpeculation(SpeculatedType value)
 {
     return !(value & SpecCell) && value;

Modified: releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/dfg/DFGFixupPhase.cpp (197760 => 197761)


--- releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/dfg/DFGFixupPhase.cpp	2016-03-08 13:57:58 UTC (rev 197760)
+++ releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/dfg/DFGFixupPhase.cpp	2016-03-08 14:23:18 UTC (rev 197761)
@@ -1064,12 +1064,12 @@
 
         case GetById:
         case GetByIdFlush: {
-            if (!node->child1()->shouldSpeculateCell())
-                break;
-
-            // If we hadn't exited because of BadCache, BadIndexingType, or ExoticObjectMode, then
-            // leave this as a GetById.
-            if (!m_graph.hasExitSite(node->origin.semantic, BadCache)
+            // FIXME: This should be done in the ByteCodeParser based on reading the
+            // PolymorphicAccess, which will surely tell us that this is a AccessCase::ArrayLength.
+            // https://bugs.webkit.org/show_bug.cgi?id=154990
+            if (node->child1()->shouldSpeculateCellOrOther()
+                && !m_graph.hasExitSite(node->origin.semantic, BadType)
+                && !m_graph.hasExitSite(node->origin.semantic, BadCache)
                 && !m_graph.hasExitSite(node->origin.semantic, BadIndexingType)
                 && !m_graph.hasExitSite(node->origin.semantic, ExoticObjectMode)) {
                 auto uid = m_graph.identifiers()[node->identifierNumber()];
@@ -1078,7 +1078,9 @@
                     break;
                 }
             }
-            fixEdge<CellUse>(node->child1());
+
+            if (node->child1()->shouldSpeculateCell())
+                fixEdge<CellUse>(node->child1());
             break;
         }
             

Modified: releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/dfg/DFGNode.h (197760 => 197761)


--- releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/dfg/DFGNode.h	2016-03-08 13:57:58 UTC (rev 197760)
+++ releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/dfg/DFGNode.h	2016-03-08 14:23:18 UTC (rev 197761)
@@ -2067,6 +2067,11 @@
         return isCellSpeculation(prediction());
     }
     
+    bool shouldSpeculateCellOrOther()
+    {
+        return isCellOrOtherSpeculation(prediction());
+    }
+    
     bool shouldSpeculateNotCell()
     {
         return isNotCellSpeculation(prediction());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to