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/bytecode/DFGExitProfile.h

    r113552 r118278  
    4040    NegativeZero, // We exited because we encountered negative zero.
    4141    InadequateCoverage, // We exited because we ended up in code that didn't have profiling coverage.
     42    ArgumentsEscaped, // We exited because arguments escaped but we didn't expect them to.
    4243    Uncountable, // We exited for none of the above reasons, and we should not count it. Most uses of this should be viewed as a FIXME.
    4344};
     
    9798    }
    9899   
     100    // Use this constructor if you wish for the exit site to be counted globally within its
     101    // code block.
     102    explicit FrequentExitSite(ExitKind kind)
     103        : m_bytecodeOffset(0)
     104        , m_kind(kind)
     105    {
     106        ASSERT(exitKindIsCountable(kind));
     107    }
     108   
    99109    bool operator!() const
    100110    {
     
    179189    }
    180190   
     191    bool hasExitSite(ExitKind kind) const
     192    {
     193        return hasExitSite(FrequentExitSite(kind));
     194    }
     195   
    181196    bool hasExitSite(unsigned bytecodeIndex, ExitKind kind) const
    182197    {
Note: See TracChangeset for help on using the changeset viewer.