Bug 137888 - Factor out JITCode::typeName() for debugging use
Summary: Factor out JITCode::typeName() for debugging use
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords:
Depends on:
Blocks: 139274
  Show dependency treegraph
 
Reported: 2014-10-20 11:41 PDT by Mark Lam
Modified: 2014-12-04 16:45 PST (History)
0 users

See Also:


Attachments
the patch. (2.74 KB, patch)
2014-10-20 11:44 PDT, Mark Lam
ggaren: review-
Details | Formatted Diff | Diff
updated patch (2.80 KB, patch)
2014-10-20 11:48 PDT, Mark Lam
ggaren: review+
Details | Formatted Diff | Diff
follow up patch to fix use of PrintStream::print(). (1.09 KB, patch)
2014-12-04 16:39 PST, Mark Lam
mark.lam: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.