Bug 132437 - Add a DFG function whitelist
Summary: Add a DFG function whitelist
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 Hahnenberg
URL:
Keywords:
: 131004 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-05-01 13:03 PDT by Mark Hahnenberg
Modified: 2014-05-22 15:42 PDT (History)
7 users (show)

See Also:


Attachments
Patch (19.25 KB, patch)
2014-05-01 13:05 PDT, Mark Hahnenberg
no flags Details | Formatted Diff | Diff
Patch (23.03 KB, patch)
2014-05-01 15:07 PDT, Mark Hahnenberg
no flags Details | Formatted Diff | Diff
Patch (23.39 KB, patch)
2014-05-01 17:31 PDT, Mark Hahnenberg
no flags Details | Formatted Diff | Diff
Patch (23.42 KB, patch)
2014-05-01 17:39 PDT, Mark Hahnenberg
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hahnenberg 2014-05-01 13:03:15 PDT
Often times when debugging using bytecode ranges isn't enough to narrow down to the particular DFG block that's causing issues. We should add the ability to whitelist specific functions specified in a file to enable further filtering without having to recompile.
Comment 1 Mark Hahnenberg 2014-05-01 13:05:19 PDT
Created attachment 230605 [details]
Patch
Comment 2 WebKit Commit Bot 2014-05-01 13:06:56 PDT
Attachment 230605 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/Options.h:313:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
Total errors found: 1 in 10 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Mark Hahnenberg 2014-05-01 13:20:19 PDT
Boo, apparently strnstr and fgetln are BSD-only. So lame.
Comment 4 Geoffrey Garen 2014-05-01 14:17:06 PDT
Comment on attachment 230605 [details]
Patch

Plz fix.
Comment 5 Mark Hahnenberg 2014-05-01 15:07:22 PDT
Created attachment 230615 [details]
Patch
Comment 6 WebKit Commit Bot 2014-05-01 15:09:13 PDT
Attachment 230615 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/Options.h:313:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
Total errors found: 1 in 13 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Mark Hahnenberg 2014-05-01 15:09:39 PDT
Comment on attachment 230615 [details]
Patch

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

> Source/JavaScriptCore/bytecode/CodeBlock.cpp:3596
> +    if (!profile)
> +        dataLog("Got null profile for bytecode ", bytecodeOffset, " in code block ", *this, "\n");

Remove.
Comment 8 Mark Hahnenberg 2014-05-01 15:11:20 PDT
Comment on attachment 230615 [details]
Patch

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

> Source/JavaScriptCore/dfg/DFGCapabilities.h:88
> +    if (mightCompileFunctionForCall(codeBlock))
> +        return capabilityLevel(codeBlock);
> +    if (mightInlineFunctionForCall(codeBlock))
> +        return leastUpperBound(CanInline, capabilityLevel(codeBlock));
> +    return CannotCompile;

We should rearrange this to check both mightCompile/mightInline, then do the CodeBlock capability check accordingly.
Comment 9 Mark Hahnenberg 2014-05-01 17:31:33 PDT
Created attachment 230633 [details]
Patch
Comment 10 WebKit Commit Bot 2014-05-01 17:33:02 PDT
Attachment 230633 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/Options.h:313:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
Total errors found: 1 in 13 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 11 Mark Hahnenberg 2014-05-01 17:39:56 PDT
Created attachment 230634 [details]
Patch
Comment 12 WebKit Commit Bot 2014-05-01 17:42:04 PDT
Attachment 230634 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/Options.h:313:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
Total errors found: 1 in 13 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 13 Geoffrey Garen 2014-05-01 19:09:03 PDT
Comment on attachment 230634 [details]
Patch

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

r=me

> Source/JavaScriptCore/dfg/DFGFunctionWhitelist.cpp:70
> +        // Get rid of newlines at the end of the strings.

"ends"

> Source/JavaScriptCore/dfg/DFGFunctionWhitelist.cpp:73
> +        if (line[length-1] == '\n') {
> +            line[length-1] = '\0';

spacing

> Source/JavaScriptCore/dfg/DFGFunctionWhitelist.h:48
> +    HashSet<String> m_functionNames;

You should call this "entries" or something. It's not just names -- it's whitelist entries, which can be names or hashes or both concatenated.
Comment 14 Mark Hahnenberg 2014-05-02 11:52:41 PDT
Committed r168178: <http://trac.webkit.org/changeset/168178>
Comment 15 Andreas Kling 2014-05-02 12:07:06 PDT
(In reply to comment #14)
> Committed r168178: <http://trac.webkit.org/changeset/168178>

This broke the cloop build.
Comment 16 Mark Hahnenberg 2014-05-02 14:16:36 PDT
(In reply to comment #15)
> (In reply to comment #14)
> > Committed r168178: <http://trac.webkit.org/changeset/168178>
> 
> This broke the cloop build.

Fix on the way!
Comment 17 Mark Lam 2014-05-22 15:42:26 PDT
*** Bug 131004 has been marked as a duplicate of this bug. ***