Ignore:
Timestamp:
May 14, 2012, 4:45:45 PM (13 years ago)
Author:
[email protected]
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):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/MarkStack.cpp

    r116822 r117013  
    3838#include "Structure.h"
    3939#include "WriteBarrier.h"
     40#include <wtf/DataLog.h>
    4041#include <wtf/MainThread.h>
    4142
     
    536537void MarkStack::validate(JSCell* cell)
    537538{
    538     if (!cell)
     539    if (!cell) {
     540        dataLog("cell is NULL\n");
    539541        CRASH();
    540 
    541     if (!cell->structure())
     542    }
     543
     544    if (!cell->structure()) {
     545        dataLog("cell at %p has a null structure\n" , cell);
    542546        CRASH();
     547    }
    543548
    544549    // Both the cell's structure, and the cell's structure's structure should be the Structure Structure.
    545550    // I hate this sentence.
    546     if (cell->structure()->structure()->JSCell::classInfo() != cell->structure()->JSCell::classInfo())
     551    if (cell->structure()->structure()->JSCell::classInfo() != cell->structure()->JSCell::classInfo()) {
     552        const char* parentClassName = 0;
     553        const char* ourClassName = 0;
     554        if (cell->structure()->structure() && cell->structure()->structure()->JSCell::classInfo())
     555            parentClassName = cell->structure()->structure()->JSCell::classInfo()->className;
     556        if (cell->structure()->JSCell::classInfo())
     557            ourClassName = cell->structure()->JSCell::classInfo()->className;
     558        dataLog("parent structure (%p <%s>) of cell at %p doesn't match cell's structure (%p <%s>)\n",
     559                cell->structure()->structure(), parentClassName, cell, cell->structure(), ourClassName);
    547560        CRASH();
     561    }
    548562}
    549563#else
Note: See TracChangeset for help on using the changeset viewer.