Bug 137888

Summary: Factor out JITCode::typeName() for debugging use
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 139274    
Attachments:
Description Flags
the patch.
ggaren: review-
updated patch
ggaren: review+
follow up patch to fix use of PrintStream::print(). mark.lam: review-

Description Mark Lam 2014-10-20 11:41:42 PDT
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.
Comment 1 Mark Lam 2014-10-20 11:44:36 PDT
Created attachment 240133 [details]
the patch.
Comment 2 Geoffrey Garen 2014-10-20 11:47:09 PDT
Comment on attachment 240133 [details]
the patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=240133&action=review

> Source/JavaScriptCore/jit/JITCode.cpp:54
> +    case None: return "None";
> +    case HostCallThunk: return "Host";
> +    case InterpreterThunk: return "LLInt";
> +    case BaselineJIT: return "Baseline";
> +    case DFGJIT: return "DFG";
> +    case FTLJIT: return "FTL";

Coding style is wrong here. Please reuse the existing style.
Comment 3 Mark Lam 2014-10-20 11:48:55 PDT
Created attachment 240134 [details]
updated patch
Comment 4 Geoffrey Garen 2014-10-20 11:50:28 PDT
Comment on attachment 240134 [details]
updated patch

r=me
Comment 5 Mark Lam 2014-10-20 11:53:30 PDT
Thanks for the review.  Landed in r174897: <http://trac.webkit.org/r174897>.
Comment 6 Filip Pizlo 2014-12-04 15:48:10 PST
Comment on attachment 240134 [details]
updated patch

View in context: https://bugs.webkit.org/attachment.cgi?id=240134&action=review

> Source/JavaScriptCore/ChangeLog:9
> +        JITCode's printInternal() currently decodes the JITType into a string and
> +        prints it.  This change factors out the part that decodes the JITType into

Why can't lldb call this directly?

> Source/JavaScriptCore/jit/JITCode.cpp:257
> +    out.print("%s", JSC::JITCode::typeName(type));

This is wrong.  PrintStream::print() doesn't take a format string.
Comment 7 Mark Lam 2014-12-04 16:39:08 PST
Created attachment 242597 [details]
follow up patch to fix use of PrintStream::print().
Comment 8 Mark Lam 2014-12-04 16:45:15 PST
Comment on attachment 242597 [details]
follow up patch to fix use of PrintStream::print().

Fix already addressed in https://bugs.webkit.org/show_bug.cgi?id=139274.