Ignore:
Timestamp:
Jul 24, 2013, 9:05:31 PM (12 years ago)
Author:
[email protected]
Message:

fourthTier: DFG should do a high-level LICM before going to FTL
https://bugs.webkit.org/show_bug.cgi?id=118749

Reviewed by Oliver Hunt.

Implements LICM hoisting for nodes that never write anything and never read
things that are clobbered by the loop. There are some other preconditions for
hoisting, see DFGLICMPhase.cpp.

Also did a few fixes:

  • ClobberSet::add was failing to switch Super entries to Direct entries in some cases.
  • DFGClobberize.cpp needed to #include "Operations.h".
  • DCEPhase needs to process the graph in reverse DFS order, when we're in SSA.
  • AbstractInterpreter can now execute a Node without knowing its indexInBlock. Knowing the indexInBlock is an optional optimization that all other clients of AI still opt into, but LICM doesn't.

This makes the FTL a 2.19x speed-up on imaging-gaussian-blur.

  • JavaScriptCore.xcodeproj/project.pbxproj:
  • dfg/DFGAbstractInterpreter.h:

(AbstractInterpreter):

  • dfg/DFGAbstractInterpreterInlines.h:

(JSC::DFG::::executeEffects):
(JSC::DFG::::execute):
(DFG):
(JSC::DFG::::clobberWorld):
(JSC::DFG::::clobberStructures):

  • dfg/DFGAtTailAbstractState.cpp: Added.

(DFG):
(JSC::DFG::AtTailAbstractState::AtTailAbstractState):
(JSC::DFG::AtTailAbstractState::~AtTailAbstractState):
(JSC::DFG::AtTailAbstractState::createValueForNode):
(JSC::DFG::AtTailAbstractState::forNode):

  • dfg/DFGAtTailAbstractState.h: Added.

(DFG):
(AtTailAbstractState):
(JSC::DFG::AtTailAbstractState::initializeTo):
(JSC::DFG::AtTailAbstractState::forNode):
(JSC::DFG::AtTailAbstractState::variables):
(JSC::DFG::AtTailAbstractState::block):
(JSC::DFG::AtTailAbstractState::isValid):
(JSC::DFG::AtTailAbstractState::setDidClobber):
(JSC::DFG::AtTailAbstractState::setIsValid):
(JSC::DFG::AtTailAbstractState::setBranchDirection):
(JSC::DFG::AtTailAbstractState::setFoundConstants):
(JSC::DFG::AtTailAbstractState::haveStructures):
(JSC::DFG::AtTailAbstractState::setHaveStructures):

  • dfg/DFGBasicBlock.h:

(JSC::DFG::BasicBlock::insertBeforeLast):

  • dfg/DFGBasicBlockInlines.h:

(DFG):

  • dfg/DFGClobberSet.cpp:

(JSC::DFG::ClobberSet::add):
(JSC::DFG::ClobberSet::addAll):

  • dfg/DFGClobberize.cpp:

(JSC::DFG::doesWrites):

  • dfg/DFGClobberize.h:

(DFG):

  • dfg/DFGDCEPhase.cpp:

(JSC::DFG::DCEPhase::DCEPhase):
(JSC::DFG::DCEPhase::run):
(JSC::DFG::DCEPhase::fixupBlock):
(DCEPhase):

  • dfg/DFGEdgeDominates.h: Added.

(DFG):
(EdgeDominates):
(JSC::DFG::EdgeDominates::EdgeDominates):
(JSC::DFG::EdgeDominates::operator()):
(JSC::DFG::EdgeDominates::result):
(JSC::DFG::edgesDominate):

  • dfg/DFGFixupPhase.cpp:

(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::checkArray):

  • dfg/DFGLICMPhase.cpp: Added.

(LICMPhase):
(JSC::DFG::LICMPhase::LICMPhase):
(JSC::DFG::LICMPhase::run):
(JSC::DFG::LICMPhase::attemptHoist):
(DFG):
(JSC::DFG::performLICM):

  • dfg/DFGLICMPhase.h: Added.

(DFG):

  • dfg/DFGPlan.cpp:

(JSC::DFG::Plan::compileInThreadImpl):

File:
1 copied

Legend:

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

    r153294 r153295  
    2525
    2626#include "config.h"
    27 #include "DFGClobberize.h"
     27#include "DFGAtTailAbstractState.h"
    2828
    2929#if ENABLE(DFG_JIT)
    3030
     31#include "Operations.h"
     32
    3133namespace JSC { namespace DFG {
    3234
    33 bool didWrites(Graph& graph, Node* node)
     35AtTailAbstractState::AtTailAbstractState()
     36    : m_block(0)
    3437{
    35     NoOpClobberize addRead;
    36     CheckClobberize addWrite;
    37     clobberize(graph, node, addRead, addWrite);
    38     return addWrite.result();
     38}
     39
     40AtTailAbstractState::~AtTailAbstractState() { }
     41
     42void AtTailAbstractState::createValueForNode(Node* node)
     43{
     44    m_block->ssa->valuesAtTail.add(node, AbstractValue());
     45}
     46
     47AbstractValue& AtTailAbstractState::forNode(Node* node)
     48{
     49    HashMap<Node*, AbstractValue>::iterator iter = m_block->ssa->valuesAtTail.find(node);
     50    ASSERT(iter != m_block->ssa->valuesAtTail.end());
     51    return iter->value;
    3952}
    4053
Note: See TracChangeset for help on using the changeset viewer.