Changeset 174897 in webkit


Ignore:
Timestamp:
Oct 20, 2014 11:52:37 AM (10 years ago)
Author:
mark.lam@apple.com
Message:

Factor out JITCode::typeName() for debugging use.
<https://webkit.org/b/137888>

Reviewed by Geoffrey Garen.

JITCode's printInternal() currently decodes the JITType into a string and
prints it. This change factors out the part that decodes the JITType into
JITCode::typeName() so that we can call it from lldb while debugging to
quickly decode a JITType value.

  • jit/JITCode.cpp:

(JSC::JITCode::typeName):
(WTF::printInternal):

  • jit/JITCode.h:
Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r174896 r174897  
     12014-10-20  Mark Lam  <mark.lam@apple.com>
     2
     3        Factor out JITCode::typeName() for debugging use.
     4        <https://webkit.org/b/137888>
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        JITCode's printInternal() currently decodes the JITType into a string and
     9        prints it.  This change factors out the part that decodes the JITType into
     10        JITCode::typeName() so that we can call it from lldb while debugging to
     11        quickly decode a JITType value.
     12
     13        * jit/JITCode.cpp:
     14        (JSC::JITCode::typeName):
     15        (WTF::printInternal):
     16        * jit/JITCode.h:
     17
    1182014-10-20  Joseph Pecoraro  <pecoraro@apple.com>
    219
  • trunk/Source/JavaScriptCore/jit/JITCode.cpp

    r173600 r174897  
    4242JITCode::~JITCode()
    4343{
     44}
     45
     46const char* JITCode::typeName(JITType jitType)
     47{
     48    switch (jitType) {
     49    case None:
     50        return "None";
     51    case HostCallThunk:
     52        return "Host";
     53    case InterpreterThunk:
     54        return "LLInt";
     55    case BaselineJIT:
     56        return "Baseline";
     57    case DFGJIT:
     58        return "DFG";
     59    case FTLJIT:
     60        return "FTL";
     61    default:
     62        CRASH();
     63        return "";
     64    }
    4465}
    4566
     
    234255void printInternal(PrintStream& out, JSC::JITCode::JITType type)
    235256{
    236     switch (type) {
    237     case JSC::JITCode::None:
    238         out.print("None");
    239         return;
    240     case JSC::JITCode::HostCallThunk:
    241         out.print("Host");
    242         return;
    243     case JSC::JITCode::InterpreterThunk:
    244         out.print("LLInt");
    245         return;
    246     case JSC::JITCode::BaselineJIT:
    247         out.print("Baseline");
    248         return;
    249     case JSC::JITCode::DFGJIT:
    250         out.print("DFG");
    251         return;
    252     case JSC::JITCode::FTLJIT:
    253         out.print("FTL");
    254         return;
    255     default:
    256         CRASH();
    257         return;
    258     }
     257    out.print("%s", JSC::JITCode::typeName(type));
    259258}
    260259
  • trunk/Source/JavaScriptCore/jit/JITCode.h

    r173199 r174897  
    6363    };
    6464   
     65    static const char* typeName(JITType);
     66
    6567    static JITType bottomTierJIT()
    6668    {
Note: See TracChangeset for help on using the changeset viewer.