Title: [208078] trunk/Source/_javascript_Core
Revision
208078
Author
utatane....@gmail.com
Date
2016-10-28 16:19:06 -0700 (Fri, 28 Oct 2016)

Log Message

[DOMJIT] Include identifier name in CallDOMGetter to dump it
https://bugs.webkit.org/show_bug.cgi?id=164161

Reviewed by Mark Lam.

This patch adds an identifier number to CallDOMGetterData and use it when dumping the data.
CallDOMGetter did not include identifier. It made CallDOMGetter super hard to debug when dumping DFG graph.

The dump becomes like this.

    CallDOMGetter(Cell:@21, JS|MustGen|UseAsOther, Nonboolint32, id0{customGetter}, domJIT = 0x42f8a0, R:World, W:Heap, Exits, ClobbersExit, bc#15)  predicting Nonboolint32

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleDOMJITGetter):
(JSC::DFG::ByteCodeParser::handleGetById):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):
* dfg/DFGNode.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (208077 => 208078)


--- trunk/Source/_javascript_Core/ChangeLog	2016-10-28 22:57:10 UTC (rev 208077)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-10-28 23:19:06 UTC (rev 208078)
@@ -1,5 +1,26 @@
 2016-10-28  Yusuke Suzuki  <utatane....@gmail.com>
 
+        [DOMJIT] Include identifier name in CallDOMGetter to dump it
+        https://bugs.webkit.org/show_bug.cgi?id=164161
+
+        Reviewed by Mark Lam.
+
+        This patch adds an identifier number to CallDOMGetterData and use it when dumping the data.
+        CallDOMGetter did not include identifier. It made CallDOMGetter super hard to debug when dumping DFG graph.
+
+        The dump becomes like this.
+
+            CallDOMGetter(Cell:@21, JS|MustGen|UseAsOther, Nonboolint32, id0{customGetter}, domJIT = 0x42f8a0, R:World, W:Heap, Exits, ClobbersExit, bc#15)  predicting Nonboolint32
+
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::handleDOMJITGetter):
+        (JSC::DFG::ByteCodeParser::handleGetById):
+        * dfg/DFGGraph.cpp:
+        (JSC::DFG::Graph::dump):
+        * dfg/DFGNode.h:
+
+2016-10-28  Yusuke Suzuki  <utatane....@gmail.com>
+
         [DOMJIT] Rename CallDOM to CallDOMGetter
         https://bugs.webkit.org/show_bug.cgi?id=164157
 

Modified: trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp (208077 => 208078)


--- trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2016-10-28 22:57:10 UTC (rev 208077)
+++ trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2016-10-28 23:19:06 UTC (rev 208078)
@@ -219,7 +219,7 @@
     bool handleConstantInternalFunction(Node* callTargetNode, int resultOperand, InternalFunction*, int registerOffset, int argumentCountIncludingThis, CodeSpecializationKind, SpeculatedType, const ChecksFunctor& insertChecks);
     Node* handlePutByOffset(Node* base, unsigned identifier, PropertyOffset, const InferredType::Descriptor&, Node* value);
     Node* handleGetByOffset(SpeculatedType, Node* base, unsigned identifierNumber, PropertyOffset, const InferredType::Descriptor&, NodeType = GetByOffset);
-    bool handleDOMJITGetter(int resultOperand, const GetByIdVariant&, Node* thisNode, SpeculatedType prediction);
+    bool handleDOMJITGetter(int resultOperand, const GetByIdVariant&, Node* thisNode, unsigned identifierNumber, SpeculatedType prediction);
 
     // Create a presence ObjectPropertyCondition based on some known offset and structure set. Does not
     // check the validity of the condition, but it may return a null one if it encounters a contradiction.
@@ -2680,7 +2680,7 @@
         node->clearFlags(NodeMustGenerate);
 }
 
-bool ByteCodeParser::handleDOMJITGetter(int resultOperand, const GetByIdVariant& variant, Node* thisNode, SpeculatedType prediction)
+bool ByteCodeParser::handleDOMJITGetter(int resultOperand, const GetByIdVariant& variant, Node* thisNode, unsigned identifierNumber, SpeculatedType prediction)
 {
     if (!variant.domJIT())
         return false;
@@ -2704,6 +2704,7 @@
 
     callDOMGetterData->domJIT = domJIT;
     callDOMGetterData->patchpoint = callDOMGetterPatchpoint.ptr();
+    callDOMGetterData->identifierNumber = identifierNumber;
 
     Node* callDOMGetterNode = nullptr;
     // GlobalObject of thisNode is always used to create a DOMWrapper.
@@ -3318,7 +3319,7 @@
         ASSERT(!getByIdStatus.makesCalls());
         GetByIdVariant variant = getByIdStatus[0];
         ASSERT(variant.domJIT());
-        if (handleDOMJITGetter(destinationOperand, variant, base, prediction)) {
+        if (handleDOMJITGetter(destinationOperand, variant, base, identifierNumber, prediction)) {
             if (m_graph.compilation())
                 m_graph.compilation()->noticeInlinedGetById();
             return;

Modified: trunk/Source/_javascript_Core/dfg/DFGGraph.cpp (208077 => 208078)


--- trunk/Source/_javascript_Core/dfg/DFGGraph.cpp	2016-10-28 22:57:10 UTC (rev 208077)
+++ trunk/Source/_javascript_Core/dfg/DFGGraph.cpp	2016-10-28 23:19:06 UTC (rev 208078)
@@ -348,6 +348,11 @@
         out.print(", offset = ", data->offset, ", mandatoryMinimum = ", data->mandatoryMinimum);
         out.print(", limit = ", data->limit);
     }
+    if (node->hasCallDOMGetterData()) {
+        CallDOMGetterData* data = ""
+        out.print(comma, "id", data->identifierNumber, "{", identifiers()[data->identifierNumber], "}");
+        out.print(", domJIT = ", RawPointer(data->domJIT));
+    }
     if (node->isConstant())
         out.print(comma, pointerDumpInContext(node->constant(), context));
     if (node->isJump())

Modified: trunk/Source/_javascript_Core/dfg/DFGNode.h (208077 => 208078)


--- trunk/Source/_javascript_Core/dfg/DFGNode.h	2016-10-28 22:57:10 UTC (rev 208077)
+++ trunk/Source/_javascript_Core/dfg/DFGNode.h	2016-10-28 23:19:06 UTC (rev 208078)
@@ -235,6 +235,7 @@
 struct CallDOMGetterData {
     DOMJIT::GetterSetter* domJIT { nullptr };
     DOMJIT::CallDOMGetterPatchpoint* patchpoint { nullptr };
+    unsigned identifierNumber { 0 };
 };
 
 // === Node ===
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to