Ignore:
Timestamp:
May 23, 2012, 5:18:55 PM (13 years ago)
Author:
[email protected]
Message:

DFG should optimize inlined uses of arguments.length and arguments[i]
https://bugs.webkit.org/show_bug.cgi?id=86327

Reviewed by Gavin Barraclough.

Merged r117017 from dfgopt.

Turns inlined uses of arguments.length into a constant.

Turns inlined uses of arguments[constant] into a direct reference to the
argument.

Big win on micro-benchmarks. Not yet a win on V8 because the hot uses of
arguments.length and arguments[i] are aliased. I'll leave the aliasing
optimizations to a later patch.

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Target.pri:
  • bytecode/DFGExitProfile.h:

(FrequentExitSite):
(JSC::DFG::FrequentExitSite::FrequentExitSite):
(JSC::DFG::QueryableExitProfile::hasExitSite):
(QueryableExitProfile):

  • dfg/DFGAbstractState.cpp:

(JSC::DFG::AbstractState::execute):

  • dfg/DFGArgumentsSimplificationPhase.cpp: Added.

(DFG):
(ArgumentsSimplificationPhase):
(JSC::DFG::ArgumentsSimplificationPhase::ArgumentsSimplificationPhase):
(JSC::DFG::ArgumentsSimplificationPhase::run):
(JSC::DFG::performArgumentsSimplification):

  • dfg/DFGArgumentsSimplificationPhase.h: Added.

(DFG):

  • dfg/DFGAssemblyHelpers.cpp:

(JSC::DFG::AssemblyHelpers::executableFor):
(DFG):

  • dfg/DFGAssemblyHelpers.h:

(AssemblyHelpers):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::parseBlock):
(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):

  • dfg/DFGCSEPhase.cpp:

(JSC::DFG::CSEPhase::getLocalLoadElimination):
(JSC::DFG::CSEPhase::performNodeCSE):

  • dfg/DFGDriver.cpp:

(JSC::DFG::compile):

  • dfg/DFGGraph.h:

(JSC::DFG::Graph::Graph):
(JSC::DFG::Graph::executableFor):
(Graph):
(JSC::DFG::Graph::clobbersWorld):

  • dfg/DFGNode.h:

(JSC::DFG::Node::convertToConstant):
(JSC::DFG::Node::convertToGetLocalUnlinked):
(Node):
(JSC::DFG::Node::unlinkedLocal):

  • dfg/DFGNodeType.h:

(DFG):

  • dfg/DFGOSRExit.cpp:

(JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):

  • dfg/DFGPredictionPropagationPhase.cpp:

(JSC::DFG::PredictionPropagationPhase::propagate):

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGOSRExit.cpp

    r115093 r118278  
    7979        return false;
    8080   
    81     return baselineCodeBlockForOriginAndBaselineCodeBlock(m_codeOriginForExitProfile, profiledCodeBlock)->addFrequentExitSite(FrequentExitSite(m_codeOriginForExitProfile.bytecodeIndex, m_kind));
     81    FrequentExitSite exitSite;
     82   
     83    if (m_kind == ArgumentsEscaped) {
     84        // Count this one globally. It doesn't matter where in the code block the arguments excaped;
     85        // the fact that they did is not associated with any particular instruction.
     86        exitSite = FrequentExitSite(m_kind);
     87    } else
     88        exitSite = FrequentExitSite(m_codeOriginForExitProfile.bytecodeIndex, m_kind);
     89   
     90    return baselineCodeBlockForOriginAndBaselineCodeBlock(m_codeOrigin, profiledCodeBlock)->addFrequentExitSite(exitSite);
    8291}
    8392
Note: See TracChangeset for help on using the changeset viewer.