Title: [117013] trunk/Source/_javascript_Core
Revision
117013
Author
[email protected]
Date
2012-05-14 16:45:45 -0700 (Mon, 14 May 2012)

Log Message

Increase Debug Logging in MarkStack::validate()
https://bugs.webkit.org/show_bug.cgi?id=86408

Rubber-stamped by Filip Pizlo.

Added some descriptive debug messages for the conditions and
values when a cell validation fails.

* heap/MarkStack.cpp:
(JSC::MarkStack::validate):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (117012 => 117013)


--- trunk/Source/_javascript_Core/ChangeLog	2012-05-14 23:37:39 UTC (rev 117012)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-05-14 23:45:45 UTC (rev 117013)
@@ -1,3 +1,16 @@
+2012-05-14  Michael Saboff  <[email protected]>
+
+        Increase Debug Logging in MarkStack::validate()
+        https://bugs.webkit.org/show_bug.cgi?id=86408
+
+        Rubber-stamped by Filip Pizlo.
+
+        Added some descriptive debug messages for the conditions and
+        values when a cell validation fails.
+
+        * heap/MarkStack.cpp:
+        (JSC::MarkStack::validate):
+
 2012-05-14  Carlos Garcia Campos  <[email protected]>
 
         Unreviewed. Fix make distcheck.

Modified: trunk/Source/_javascript_Core/heap/MarkStack.cpp (117012 => 117013)


--- trunk/Source/_javascript_Core/heap/MarkStack.cpp	2012-05-14 23:37:39 UTC (rev 117012)
+++ trunk/Source/_javascript_Core/heap/MarkStack.cpp	2012-05-14 23:45:45 UTC (rev 117013)
@@ -37,6 +37,7 @@
 #include "ScopeChain.h"
 #include "Structure.h"
 #include "WriteBarrier.h"
+#include <wtf/DataLog.h>
 #include <wtf/MainThread.h>
 
 namespace JSC {
@@ -535,16 +536,29 @@
 #if ENABLE(GC_VALIDATION)
 void MarkStack::validate(JSCell* cell)
 {
-    if (!cell)
+    if (!cell) {
+        dataLog("cell is NULL\n");
         CRASH();
+    }
 
-    if (!cell->structure())
+    if (!cell->structure()) {
+        dataLog("cell at %p has a null structure\n" , cell);
         CRASH();
+    }
 
     // Both the cell's structure, and the cell's structure's structure should be the Structure Structure.
     // I hate this sentence.
-    if (cell->structure()->structure()->JSCell::classInfo() != cell->structure()->JSCell::classInfo())
+    if (cell->structure()->structure()->JSCell::classInfo() != cell->structure()->JSCell::classInfo()) {
+        const char* parentClassName = 0;
+        const char* ourClassName = 0;
+        if (cell->structure()->structure() && cell->structure()->structure()->JSCell::classInfo())
+            parentClassName = cell->structure()->structure()->JSCell::classInfo()->className;
+        if (cell->structure()->JSCell::classInfo())
+            ourClassName = cell->structure()->JSCell::classInfo()->className;
+        dataLog("parent structure (%p <%s>) of cell at %p doesn't match cell's structure (%p <%s>)\n",
+                cell->structure()->structure(), parentClassName, cell, cell->structure(), ourClassName);
         CRASH();
+    }
 }
 #else
 void MarkStack::validate(JSCell*)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to