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.cpp

    r164835 r168178  
    3131#include "CodeBlock.h"
    3232#include "DFGCommon.h"
     33#include "DFGFunctionWhitelist.h"
    3334#include "Interpreter.h"
    3435#include "JSCInlines.h"
     
    4142    return Options::useDFGJIT()
    4243        && MacroAssembler::supportsFloatingPoint()
    43         && Options::bytecodeRangeToDFGCompile().isInRange(codeBlock->instructionCount());
     44        && Options::bytecodeRangeToDFGCompile().isInRange(codeBlock->instructionCount())
     45        && FunctionWhitelist::ensureGlobalWhitelist().contains(codeBlock);
    4446}
    4547
     
    6769bool mightInlineFunctionForCall(CodeBlock* codeBlock)
    6870{
    69     return isSupported(codeBlock)
    70         && codeBlock->instructionCount() <= Options::maximumFunctionForCallInlineCandidateInstructionCount()
     71    return codeBlock->instructionCount() <= Options::maximumFunctionForCallInlineCandidateInstructionCount()
    7172        && !codeBlock->ownerExecutable()->needsActivation()
    7273        && codeBlock->ownerExecutable()->isInliningCandidate();
     
    7475bool mightInlineFunctionForClosureCall(CodeBlock* codeBlock)
    7576{
    76     return isSupported(codeBlock)
    77         && codeBlock->instructionCount() <= Options::maximumFunctionForClosureCallInlineCandidateInstructionCount()
     77    return codeBlock->instructionCount() <= Options::maximumFunctionForClosureCallInlineCandidateInstructionCount()
    7878        && !codeBlock->ownerExecutable()->needsActivation()
    7979        && codeBlock->ownerExecutable()->isInliningCandidate();
     
    8181bool mightInlineFunctionForConstruct(CodeBlock* codeBlock)
    8282{
    83     return isSupported(codeBlock)
    84         && codeBlock->instructionCount() <= Options::maximumFunctionForConstructInlineCandidateInstructionCount()
     83    return codeBlock->instructionCount() <= Options::maximumFunctionForConstructInlineCandidateInstructionCount()
    8584        && !codeBlock->ownerExecutable()->needsActivation()
    8685        && codeBlock->ownerExecutable()->isInliningCandidate();
Note: See TracChangeset for help on using the changeset viewer.