Title: [197331] releases/WebKitGTK/webkit-2.12/Source/_javascript_Core
Revision
197331
Author
[email protected]
Date
2016-02-29 02:33:41 -0800 (Mon, 29 Feb 2016)

Log Message

Merge r197196 - Folding of OverridesHasInstance DFG nodes shoud happen in constant folding not fixup
https://bugs.webkit.org/show_bug.cgi?id=154743

Reviewed by Mark Lam.

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

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/ChangeLog (197330 => 197331)


--- releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/ChangeLog	2016-02-29 10:26:31 UTC (rev 197330)
+++ releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/ChangeLog	2016-02-29 10:33:41 UTC (rev 197331)
@@ -1,3 +1,15 @@
+2016-02-26  Keith Miller  <[email protected]>
+
+        Folding of OverridesHasInstance DFG nodes shoud happen in constant folding not fixup
+        https://bugs.webkit.org/show_bug.cgi?id=154743
+
+        Reviewed by Mark Lam.
+
+        * dfg/DFGConstantFoldingPhase.cpp:
+        (JSC::DFG::ConstantFoldingPhase::foldConstants):
+        * dfg/DFGFixupPhase.cpp:
+        (JSC::DFG::FixupPhase::fixupNode):
+
 2016-02-26  Benjamin Poulain  <[email protected]>
 
         [JSC] Add32(Imm, Tmp, Tmp) does not ZDef the destination if Imm is zero

Modified: releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/dfg/DFGConstantFoldingPhase.cpp (197330 => 197331)


--- releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/dfg/DFGConstantFoldingPhase.cpp	2016-02-29 10:26:31 UTC (rev 197330)
+++ releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/dfg/DFGConstantFoldingPhase.cpp	2016-02-29 10:33:41 UTC (rev 197331)
@@ -553,6 +553,24 @@
                 break;
             }
 
+            case OverridesHasInstance: {
+                if (!node->child2().node()->isCellConstant())
+                    break;
+
+                if (node->child2().node()->asCell() != m_graph.globalObjectFor(node->origin.semantic)->functionProtoHasInstanceSymbolFunction()) {
+                    m_graph.convertToConstant(node, jsBoolean(true));
+                    changed = true;
+
+                } else if (!m_graph.hasExitSite(node->origin.semantic, BadTypeInfoFlags)) {
+                    // We optimistically assume that we will not see a function that has a custom instanceof operation as they should be rare.
+                    m_insertionSet.insertNode(indexInBlock, SpecNone, CheckTypeInfoFlags, node->origin, OpInfo(ImplementsDefaultHasInstance), Edge(node->child1().node(), CellUse));
+                    m_graph.convertToConstant(node, jsBoolean(false));
+                    changed = true;
+                }
+                
+                break;
+            }
+
             case Check: {
                 alreadyHandled = true;
                 m_interpreter.execute(indexInBlock);

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


--- releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/dfg/DFGFixupPhase.cpp	2016-02-29 10:26:31 UTC (rev 197330)
+++ releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/dfg/DFGFixupPhase.cpp	2016-02-29 10:33:41 UTC (rev 197331)
@@ -1093,26 +1093,7 @@
             break;
         }
 
-        case OverridesHasInstance: {
-            if (node->child2().node()->isCellConstant()) {
-                if (node->child2().node()->asCell() != m_graph.globalObjectFor(node->origin.semantic)->functionProtoHasInstanceSymbolFunction()) {
-
-                    m_graph.convertToConstant(node, jsBoolean(true));
-                    break;
-                }
-
-                if (!m_graph.hasExitSite(node->origin.semantic, BadTypeInfoFlags)) {
-                    // Here we optimistically assume that we will not see an bound/C-API function here.
-                    m_insertionSet.insertNode(m_indexInBlock, SpecNone, CheckTypeInfoFlags, node->origin, OpInfo(ImplementsDefaultHasInstance), Edge(node->child1().node(), CellUse));
-                    m_graph.convertToConstant(node, jsBoolean(false));
-                    break;
-                }
-            }
-
-            fixEdge<CellUse>(node->child1());
-            break;
-        }
-            
+        case OverridesHasInstance:
         case CheckStructure:
         case CheckCell:
         case CreateThis:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to