Title: [282664] trunk/Source/_javascript_Core
Revision
282664
Author
justin_mich...@apple.com
Date
2021-09-17 08:58:10 -0700 (Fri, 17 Sep 2021)

Log Message

Improve access case printing and show inline capacity for structures
https://bugs.webkit.org/show_bug.cgi?id=230357

Reviewed by Saam Barati.

This just makes the printing of access cases slightly more readable.

* bytecode/AccessCase.cpp:
(JSC::AccessCase::dump const):
* bytecode/AccessCase.h:
(JSC::AccessCase::dumpImpl const):
* bytecode/GetterSetterAccessCase.cpp:
(JSC::GetterSetterAccessCase::dumpImpl const):
* bytecode/GetterSetterAccessCase.h:
* bytecode/InstanceOfAccessCase.cpp:
(JSC::InstanceOfAccessCase::dumpImpl const):
* bytecode/InstanceOfAccessCase.h:
* bytecode/ProxyableAccessCase.cpp:
(JSC::ProxyableAccessCase::dumpImpl const):
* bytecode/ProxyableAccessCase.h:
* heap/Heap.cpp:
(JSC::Heap::runEndPhase):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::dumpInContextAssumingStructure const):
* runtime/Structure.cpp:
(JSC::Structure::dump const):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (282663 => 282664)


--- trunk/Source/_javascript_Core/ChangeLog	2021-09-17 15:56:53 UTC (rev 282663)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-09-17 15:58:10 UTC (rev 282664)
@@ -1,5 +1,34 @@
 2021-09-17  Justin Michaud  <justin_mich...@apple.com>
 
+        Improve access case printing and show inline capacity for structures
+        https://bugs.webkit.org/show_bug.cgi?id=230357
+
+        Reviewed by Saam Barati.
+
+        This just makes the printing of access cases slightly more readable.
+
+        * bytecode/AccessCase.cpp:
+        (JSC::AccessCase::dump const):
+        * bytecode/AccessCase.h:
+        (JSC::AccessCase::dumpImpl const):
+        * bytecode/GetterSetterAccessCase.cpp:
+        (JSC::GetterSetterAccessCase::dumpImpl const):
+        * bytecode/GetterSetterAccessCase.h:
+        * bytecode/InstanceOfAccessCase.cpp:
+        (JSC::InstanceOfAccessCase::dumpImpl const):
+        * bytecode/InstanceOfAccessCase.h:
+        * bytecode/ProxyableAccessCase.cpp:
+        (JSC::ProxyableAccessCase::dumpImpl const):
+        * bytecode/ProxyableAccessCase.h:
+        * heap/Heap.cpp:
+        (JSC::Heap::runEndPhase):
+        * runtime/JSCJSValue.cpp:
+        (JSC::JSValue::dumpInContextAssumingStructure const):
+        * runtime/Structure.cpp:
+        (JSC::Structure::dump const):
+
+2021-09-17  Justin Michaud  <justin_mich...@apple.com>
+
         PutByVal and PutPrivateName ICs should emit a write barrier if a butterfly might be allocated
         https://bugs.webkit.org/show_bug.cgi?id=230378
 

Modified: trunk/Source/_javascript_Core/bytecode/AccessCase.cpp (282663 => 282664)


--- trunk/Source/_javascript_Core/bytecode/AccessCase.cpp	2021-09-17 15:56:53 UTC (rev 282663)
+++ trunk/Source/_javascript_Core/bytecode/AccessCase.cpp	2021-09-17 15:58:10 UTC (rev 282664)
@@ -853,8 +853,9 @@
 
 void AccessCase::dump(PrintStream& out) const
 {
-    out.print("\n", m_type, ":(");
+    out.print("\n", m_type, ": {");
 
+    Indenter indent;
     CommaPrinter comma;
 
     out.print(comma, m_state);
@@ -863,21 +864,25 @@
     if (isValidOffset(m_offset))
         out.print(comma, "offset = ", m_offset);
 
+    ++indent;
+
     if (m_polyProtoAccessChain) {
-        out.print(comma, "prototype access chain = ");
+        out.print("\n", indent, "prototype access chain = ");
         m_polyProtoAccessChain->dump(structure(), out);
     } else {
         if (m_type == Transition || m_type == Delete || m_type == SetPrivateBrand)
-            out.print(comma, "structure = ", pointerDump(structure()), " -> ", pointerDump(newStructure()));
+            out.print("\n", indent, "from structure = ", pointerDump(structure()),
+                "\n", indent, "to structure = ", pointerDump(newStructure()));
         else if (m_structure)
-            out.print(comma, "structure = ", pointerDump(m_structure.get()));
+            out.print("\n", indent, "structure = ", pointerDump(m_structure.get()));
     }
 
     if (!m_conditionSet.isEmpty())
-        out.print(comma, "conditions = ", m_conditionSet);
+        out.print("\n", indent, "conditions = ", m_conditionSet);
 
-    dumpImpl(out, comma);
-    out.print(")");
+    dumpImpl(out, comma, indent);
+
+    out.print("}");
 }
 
 bool AccessCase::visitWeak(VM& vm) const

Modified: trunk/Source/_javascript_Core/bytecode/AccessCase.h (282663 => 282664)


--- trunk/Source/_javascript_Core/bytecode/AccessCase.h	2021-09-17 15:56:53 UTC (rev 282663)
+++ trunk/Source/_javascript_Core/bytecode/AccessCase.h	2021-09-17 15:58:10 UTC (rev 282664)
@@ -246,7 +246,7 @@
     bool canReplace(const AccessCase& other) const;
 
     void dump(PrintStream& out) const;
-    virtual void dumpImpl(PrintStream&, CommaPrinter&) const { }
+    virtual void dumpImpl(PrintStream&, CommaPrinter&, Indenter&) const { }
 
     virtual ~AccessCase();
 

Modified: trunk/Source/_javascript_Core/bytecode/GetterSetterAccessCase.cpp (282663 => 282664)


--- trunk/Source/_javascript_Core/bytecode/GetterSetterAccessCase.cpp	2021-09-17 15:56:53 UTC (rev 282663)
+++ trunk/Source/_javascript_Core/bytecode/GetterSetterAccessCase.cpp	2021-09-17 15:58:10 UTC (rev 282664)
@@ -112,9 +112,9 @@
     return Base::alternateBase();
 }
 
-void GetterSetterAccessCase::dumpImpl(PrintStream& out, CommaPrinter& comma) const
+void GetterSetterAccessCase::dumpImpl(PrintStream& out, CommaPrinter& comma, Indenter& indent) const
 {
-    Base::dumpImpl(out, comma);
+    Base::dumpImpl(out, comma, indent);
     out.print(comma, "customSlotBase = ", RawPointer(customSlotBase()));
     if (callLinkInfo())
         out.print(comma, "callLinkInfo = ", RawPointer(callLinkInfo()));

Modified: trunk/Source/_javascript_Core/bytecode/GetterSetterAccessCase.h (282663 => 282664)


--- trunk/Source/_javascript_Core/bytecode/GetterSetterAccessCase.h	2021-09-17 15:56:53 UTC (rev 282663)
+++ trunk/Source/_javascript_Core/bytecode/GetterSetterAccessCase.h	2021-09-17 15:58:10 UTC (rev 282664)
@@ -62,7 +62,7 @@
         const ObjectPropertyConditionSet&, RefPtr<PolyProtoAccessChain>&&, bool viaProxy = false,
         FunctionPtr<CustomAccessorPtrTag> customSetter = nullptr, JSObject* customSlotBase = nullptr);
 
-    void dumpImpl(PrintStream&, CommaPrinter&) const final;
+    void dumpImpl(PrintStream&, CommaPrinter&, Indenter&) const final;
     Ref<AccessCase> clone() const final;
 
     ~GetterSetterAccessCase() final;

Modified: trunk/Source/_javascript_Core/bytecode/InstanceOfAccessCase.cpp (282663 => 282664)


--- trunk/Source/_javascript_Core/bytecode/InstanceOfAccessCase.cpp	2021-09-17 15:56:53 UTC (rev 282663)
+++ trunk/Source/_javascript_Core/bytecode/InstanceOfAccessCase.cpp	2021-09-17 15:58:10 UTC (rev 282664)
@@ -39,9 +39,9 @@
     return adoptRef(*new InstanceOfAccessCase(vm, owner, accessType, structure, conditionSet, prototype));
 }
 
-void InstanceOfAccessCase::dumpImpl(PrintStream& out, CommaPrinter& comma) const
+void InstanceOfAccessCase::dumpImpl(PrintStream& out, CommaPrinter& comma, Indenter& indent) const
 {
-    Base::dumpImpl(out, comma);
+    Base::dumpImpl(out, comma, indent);
     out.print(comma, "prototype = ", JSValue(prototype()));
 }
 

Modified: trunk/Source/_javascript_Core/bytecode/InstanceOfAccessCase.h (282663 => 282664)


--- trunk/Source/_javascript_Core/bytecode/InstanceOfAccessCase.h	2021-09-17 15:56:53 UTC (rev 282663)
+++ trunk/Source/_javascript_Core/bytecode/InstanceOfAccessCase.h	2021-09-17 15:58:10 UTC (rev 282664)
@@ -42,7 +42,7 @@
     
     JSObject* prototype() const { return m_prototype.get(); }
     
-    void dumpImpl(PrintStream&, CommaPrinter&) const final;
+    void dumpImpl(PrintStream&, CommaPrinter&, Indenter&) const final;
     Ref<AccessCase> clone() const final;
     
     ~InstanceOfAccessCase() final;

Modified: trunk/Source/_javascript_Core/bytecode/ProxyableAccessCase.cpp (282663 => 282664)


--- trunk/Source/_javascript_Core/bytecode/ProxyableAccessCase.cpp	2021-09-17 15:56:53 UTC (rev 282663)
+++ trunk/Source/_javascript_Core/bytecode/ProxyableAccessCase.cpp	2021-09-17 15:58:10 UTC (rev 282664)
@@ -55,9 +55,9 @@
     return result;
 }
 
-void ProxyableAccessCase::dumpImpl(PrintStream& out, CommaPrinter& comma) const
+void ProxyableAccessCase::dumpImpl(PrintStream& out, CommaPrinter& comma, Indenter& indent) const
 {
-    Base::dumpImpl(out, comma);
+    Base::dumpImpl(out, comma, indent);
     out.print(comma, "viaProxy = ", viaProxy());
     out.print(comma, "additionalSet = ", RawPointer(additionalSet()));
 }

Modified: trunk/Source/_javascript_Core/bytecode/ProxyableAccessCase.h (282663 => 282664)


--- trunk/Source/_javascript_Core/bytecode/ProxyableAccessCase.h	2021-09-17 15:56:53 UTC (rev 282663)
+++ trunk/Source/_javascript_Core/bytecode/ProxyableAccessCase.h	2021-09-17 15:58:10 UTC (rev 282664)
@@ -40,7 +40,7 @@
     static Ref<AccessCase> create(VM&, JSCell*, AccessType, CacheableIdentifier, PropertyOffset, Structure*, const ObjectPropertyConditionSet& = ObjectPropertyConditionSet(),
         bool viaProxy = false, WatchpointSet* additionalSet = nullptr, RefPtr<PolyProtoAccessChain>&& = nullptr);
 
-    void dumpImpl(PrintStream&, CommaPrinter&) const override;
+    void dumpImpl(PrintStream&, CommaPrinter&, Indenter&) const override;
     Ref<AccessCase> clone() const override;
 
     ~ProxyableAccessCase() override;

Modified: trunk/Source/_javascript_Core/runtime/JSCJSValue.cpp (282663 => 282664)


--- trunk/Source/_javascript_Core/runtime/JSCJSValue.cpp	2021-09-17 15:56:53 UTC (rev 282663)
+++ trunk/Source/_javascript_Core/runtime/JSCJSValue.cpp	2021-09-17 15:58:10 UTC (rev 282664)
@@ -313,7 +313,7 @@
             out.print("BigInt[heap-allocated]: addr=", RawPointer(asCell()), ", length=", jsCast<JSBigInt*>(asCell())->length(), ", sign=", jsCast<JSBigInt*>(asCell())->sign());
         else if (structure->classInfo()->isSubClassOf(JSObject::info())) {
             out.print("Object: ", RawPointer(asCell()));
-            out.print(" with butterfly ", RawPointer(asObject(asCell())->butterfly()));
+            out.print(" with butterfly ", RawPointer(asObject(asCell())->butterfly()), "(base=", RawPointer(asObject(asCell())->butterfly()->base(structure)), ")");
             out.print(" (Structure ", inContext(*structure, context), ")");
         } else {
             out.print("Cell: ", RawPointer(asCell()));

Modified: trunk/Source/_javascript_Core/runtime/Structure.cpp (282663 => 282664)


--- trunk/Source/_javascript_Core/runtime/Structure.cpp	2021-09-17 15:56:53 UTC (rev 282663)
+++ trunk/Source/_javascript_Core/runtime/Structure.cpp	2021-09-17 15:58:10 UTC (rev 282664)
@@ -1322,8 +1322,12 @@
 
 void Structure::dump(PrintStream& out) const
 {
-    out.print(RawPointer(this), ":[", RawPointer(reinterpret_cast<void*>(id())), ", ", classInfo()->className, ", {");
-    
+    auto* structureID = reinterpret_cast<void*>(id());
+    out.print(RawPointer(this), ":[", RawPointer(structureID),
+        "/", (uint32_t)(reinterpret_cast<uintptr_t>(structureID)), ", ",
+        classInfo()->className, ", (", inlineSize(), "/", inlineCapacity(), ", ",
+        outOfLineSize(), "/", outOfLineCapacity(), "){");
+
     CommaPrinter comma;
     
     const_cast<Structure*>(this)->forEachPropertyConcurrently(
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to