Ignore:
Timestamp:
May 2, 2014, 11:52:10 AM (11 years ago)
Author:
[email protected]
Message:

Add a DFG function whitelist
https://bugs.webkit.org/show_bug.cgi?id=132437

Reviewed by Geoffrey Garen.

Often times when debugging, using bytecode ranges isn't enough to narrow down to the
particular DFG block that's causing issues. This patch adds the ability to whitelist
specific functions specified in a file to enable further filtering without having to recompile.

(JSC::DFG::isSupported):
(JSC::DFG::mightInlineFunctionForCall):
(JSC::DFG::mightInlineFunctionForClosureCall):
(JSC::DFG::mightInlineFunctionForConstruct):

  • dfg/DFGFunctionWhitelist.cpp: Added.

(JSC::DFG::FunctionWhitelist::ensureGlobalWhitelist):
(JSC::DFG::FunctionWhitelist::FunctionWhitelist):
(JSC::DFG::FunctionWhitelist::parseFunctionNamesInFile):
(JSC::DFG::FunctionWhitelist::contains):

  • dfg/DFGFunctionWhitelist.h: Added.
  • runtime/Options.cpp:

(JSC::parse):
(JSC::Options::dumpOption):

  • runtime/Options.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGCapabilities.h

    r167325 r168178  
    8080}
    8181
     82inline CapabilityLevel functionCapabilityLevel(bool mightCompile, bool mightInline, CapabilityLevel computedCapabilityLevel)
     83{
     84    if (mightCompile && mightInline)
     85        return leastUpperBound(CanCompileAndInline, computedCapabilityLevel);
     86    if (mightCompile && !mightInline)
     87        return leastUpperBound(CanCompile, computedCapabilityLevel);
     88    if (!mightCompile && mightInline)
     89        return leastUpperBound(CanInline, computedCapabilityLevel);
     90    if (!mightCompile && !mightInline)
     91        return CannotCompile;
     92    RELEASE_ASSERT_NOT_REACHED();
     93    return CannotCompile;
     94}
     95
    8296inline CapabilityLevel functionForCallCapabilityLevel(CodeBlock* codeBlock)
    8397{
    84     if (!mightCompileFunctionForCall(codeBlock))
    85         return CannotCompile;
    86    
    87     return capabilityLevel(codeBlock);
     98    return functionCapabilityLevel(
     99        mightCompileFunctionForCall(codeBlock),
     100        mightInlineFunctionForCall(codeBlock),
     101        capabilityLevel(codeBlock));
    88102}
    89103
    90104inline CapabilityLevel functionForConstructCapabilityLevel(CodeBlock* codeBlock)
    91105{
    92     if (!mightCompileFunctionForConstruct(codeBlock))
    93         return CannotCompile;
    94    
    95     return capabilityLevel(codeBlock);
     106    return functionCapabilityLevel(
     107        mightCompileFunctionForConstruct(codeBlock),
     108        mightInlineFunctionForConstruct(codeBlock),
     109        capabilityLevel(codeBlock));
    96110}
    97111
Note: See TracChangeset for help on using the changeset viewer.