Changeset 93238 in webkit


Ignore:
Timestamp:
Aug 17, 2011 1:54:32 PM (13 years ago)
Author:
fpizlo@apple.com
Message:

JSC verbose debugging output sometimes doesn't work as expected.
https://bugs.webkit.org/show_bug.cgi?id=66107

Reviewed by Gavin Barraclough.

Hardened the CodeBlock::dump() code so that it no longer crashes. Improved
the DFG verbose code so that it prints slightly more useful information.

  • assembler/LinkBuffer.h:

(JSC::LinkBuffer::debugSize):

  • bytecode/CodeBlock.cpp:

(JSC::valueToSourceString):
(JSC::CodeBlock::dump):

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::numberOfRegExps):

  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::link):

Location:
trunk/Source/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r93189 r93238  
     12011-08-17  Filip Pizlo  <fpizlo@apple.com>
     2
     3        JSC verbose debugging output sometimes doesn't work as expected.
     4        https://bugs.webkit.org/show_bug.cgi?id=66107
     5
     6        Reviewed by Gavin Barraclough.
     7       
     8        Hardened the CodeBlock::dump() code so that it no longer crashes.  Improved
     9        the DFG verbose code so that it prints slightly more useful information.
     10
     11        * assembler/LinkBuffer.h:
     12        (JSC::LinkBuffer::debugSize):
     13        * bytecode/CodeBlock.cpp:
     14        (JSC::valueToSourceString):
     15        (JSC::CodeBlock::dump):
     16        * bytecode/CodeBlock.h:
     17        (JSC::CodeBlock::numberOfRegExps):
     18        * dfg/DFGJITCompiler.cpp:
     19        (JSC::DFG::JITCompiler::link):
     20
    1212011-08-16  Michael Saboff  <msaboff@apple.com>
    222
  • trunk/Source/JavaScriptCore/assembler/LinkBuffer.h

    r90426 r93238  
    205205    {
    206206        return m_code;
     207    }
     208   
     209    size_t debugSize()
     210    {
     211        return m_size;
    207212    }
    208213#endif
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r91952 r93238  
    7777        return makeUString("\"", escapeQuotes(val.toString(exec)), "\"");
    7878
    79     return val.toString(exec);
     79    return val.description();
    8080}
    8181
     
    543543            int r0 = (++it)->u.operand;
    544544            int re0 = (++it)->u.operand;
    545             printf("[%4d] new_regexp\t %s, %s\n", location, registerName(exec, r0).data(), regexpName(re0, regexp(re0)).data());
     545            printf("[%4d] new_regexp\t %s, ", location, registerName(exec, r0).data());
     546            if (r0 >=0 && r0 < (int)numberOfRegExps())
     547                printf("%s\n", regexpName(re0, regexp(re0)).data());
     548            else
     549                printf("bad_regexp(%d)\n", re0);
    546550            break;
    547551        }
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.h

    r91706 r93238  
    472472            return size;
    473473        }
     474        unsigned numberOfRegExps() const
     475        {
     476            if (!m_rareData)
     477                return 0;
     478            return m_rareData->m_regexps.size();
     479        }
    474480        RegExp* regexp(int index) const { ASSERT(m_rareData); return m_rareData->m_regexps[index].get(); }
    475481
  • trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp

    r93010 r93238  
    868868    // Link the code, populate data in CodeBlock data structures.
    869869#if DFG_DEBUG_VERBOSE
    870     fprintf(stderr, "JIT code start at %p\n", linkBuffer.debugAddress());
     870    fprintf(stderr, "JIT code start at [%p, %p)\n", linkBuffer.debugAddress(), static_cast<char*>(linkBuffer.debugAddress()) + linkBuffer.debugSize());
    871871#endif
    872872
Note: See TracChangeset for help on using the changeset viewer.