Changeset 91115 in webkit


Ignore:
Timestamp:
Jul 15, 2011 2:57:35 PM (13 years ago)
Author:
barraclough@apple.com
Message:

DFG JIT - Where arguments passed are integers, speculate this.
https://bugs.webkit.org/show_bug.cgi?id=64630

Reviewed by Sam Weinig.

Presently the DFG JIT is overly aggressively predicting double.
Use a bit of dynamic information, and curtail this a little.

  • dfg/DFGGraph.cpp:

(JSC::DFG::Graph::predictArgumentTypes):

  • Check for integer arguments.
  • dfg/DFGGraph.h:
    • Function declaration.
  • runtime/Executable.cpp:

(JSC::tryDFGCompile):
(JSC::FunctionExecutable::compileForCallInternal):

  • Add call to predictArgumentTypes.
Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r91099 r91115  
     12011-07-15  Gavin Barraclough  <barraclough@apple.com>
     2
     3        DFG JIT - Where arguments passed are integers, speculate this.
     4        https://bugs.webkit.org/show_bug.cgi?id=64630
     5
     6        Reviewed by Sam Weinig.
     7
     8        Presently the DFG JIT is overly aggressively predicting double.
     9        Use a bit of dynamic information, and curtail this a little.
     10
     11        * dfg/DFGGraph.cpp:
     12        (JSC::DFG::Graph::predictArgumentTypes):
     13            - Check for integer arguments.
     14        * dfg/DFGGraph.h:
     15            - Function declaration.
     16        * runtime/Executable.cpp:
     17        (JSC::tryDFGCompile):
     18        (JSC::FunctionExecutable::compileForCallInternal):
     19            - Add call to predictArgumentTypes.
     20
    1212011-07-15  Filip Pizlo  <fpizlo@apple.com>
    222
  • trunk/Source/JavaScriptCore/dfg/DFGGraph.cpp

    r90423 r91115  
    177177}
    178178
     179void Graph::predictArgumentTypes(ExecState* exec)
     180{
     181    size_t numberOfArguments = std::min(exec->argumentCountIncludingThis(), m_argumentPredictions.size());
     182
     183    for (size_t arg = 1; arg < numberOfArguments; ++arg) {
     184        if (exec->argument(arg - 1).isInt32())
     185            m_argumentPredictions[arg].m_value |= PredictInt32;
     186    }
     187}
     188
    179189} } // namespace JSC::DFG
    180190
  • trunk/Source/JavaScriptCore/dfg/DFGGraph.h

    r90423 r91115  
    3737
    3838class CodeBlock;
     39struct ExecState;
    3940
    4041namespace DFG {
     
    165166#endif
    166167
     168    void predictArgumentTypes(ExecState*);
     169
    167170    Vector< OwnPtr<BasicBlock> , 8> m_blocks;
    168171    Vector<NodeIndex, 16> m_varArgChildren;
  • trunk/Source/JavaScriptCore/runtime/Executable.cpp

    r89964 r91115  
    260260
    261261#if ENABLE(JIT)
    262 static bool tryDFGCompile(JSGlobalData* globalData, CodeBlock* codeBlock, JITCode& jitCode, MacroAssemblerCodePtr& jitCodeWithArityCheck)
    263 {
     262static bool tryDFGCompile(ExecState* exec, CodeBlock* codeBlock, JITCode& jitCode, MacroAssemblerCodePtr& jitCodeWithArityCheck)
     263{
     264    JSGlobalData* globalData = &exec->globalData();
    264265#if ENABLE(DFG_JIT)
    265266#if ENABLE(DFG_JIT_RESTRICTIONS)
     
    272273    if (!parse(dfg, globalData, codeBlock))
    273274        return false;
     275
     276    dfg.predictArgumentTypes(exec);
    274277
    275278    DFG::JITCompiler dataFlowJIT(globalData, dfg, codeBlock);
     
    330333#if ENABLE(JIT)
    331334    if (exec->globalData().canUseJIT()) {
    332         bool dfgCompiled = tryDFGCompile(&exec->globalData(), m_codeBlockForCall.get(), m_jitCodeForCall, m_jitCodeForCallWithArityCheck);
     335        bool dfgCompiled = tryDFGCompile(exec, m_codeBlockForCall.get(), m_jitCodeForCall, m_jitCodeForCallWithArityCheck);
    333336        if (!dfgCompiled)
    334337            m_jitCodeForCall = JIT::compile(scopeChainNode->globalData, m_codeBlockForCall.get(), &m_jitCodeForCallWithArityCheck);
Note: See TracChangeset for help on using the changeset viewer.