Ignore:
Timestamp:
Sep 23, 2012, 3:48:19 PM (13 years ago)
Author:
[email protected]
Message:

CSE for access to closure variables (get_/put_scoped_var)
https://bugs.webkit.org/show_bug.cgi?id=97414

Reviewed by Oliver Hunt.

I separated loading a scope from loading its storage pointer, so we can
CSE the storage pointer load. Then, I copied the global var CSE and adjusted
it for closure vars.

  • dfg/DFGAbstractState.cpp:

(JSC::DFG::AbstractState::execute): Renamed GetScopeChain => GetScope to
reflect renames from a few weeks ago.

Added a case for the storage pointer load, similar to object storage pointer load.

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::parseBlock): Added an independent node for
the storage pointer.

  • dfg/DFGCSEPhase.cpp:

(JSC::DFG::CSEPhase::scopedVarLoadElimination):
(CSEPhase):
(JSC::DFG::CSEPhase::scopedVarStoreElimination):
(JSC::DFG::CSEPhase::getScopeLoadElimination):
(JSC::DFG::CSEPhase::getScopeRegistersLoadElimination):
(JSC::DFG::CSEPhase::setLocalStoreElimination):
(JSC::DFG::CSEPhase::performNodeCSE): Copied globalVarLoad/StoreElimination
and adapted the same logic to closure vars.

  • dfg/DFGNode.h:

(JSC::DFG::Node::hasScopeChainDepth):
(JSC::DFG::Node::scope):
(Node):

  • dfg/DFGNodeType.h:

(DFG): GetScopedVar and GetGlobalVar are no longer MustGenerate. I'm not
sure why they ever were. But these are simple load operations so, if they're
unused, they're truly dead.

  • dfg/DFGPredictionPropagationPhase.cpp:

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

  • dfg/DFGSpeculativeJIT32_64.cpp:

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

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::compile): Updated for renames and split-out
node for getting the storage pointer.

File:
1 edited

Legend:

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

    r129297 r129316  
    22662266            int slot = currentInstruction[2].u.operand;
    22672267            int depth = currentInstruction[3].u.operand;
    2268             NodeIndex getScopeChain = addToGraph(GetScopeChain, OpInfo(depth));
    2269             NodeIndex getScopedVar = addToGraph(GetScopedVar, OpInfo(slot), OpInfo(prediction), getScopeChain);
     2268            NodeIndex getScope = addToGraph(GetScope, OpInfo(depth));
     2269            NodeIndex getScopeRegisters = addToGraph(GetScopeRegisters, getScope);
     2270            NodeIndex getScopedVar = addToGraph(GetScopedVar, OpInfo(slot), OpInfo(prediction), getScopeRegisters);
    22702271            set(dst, getScopedVar);
    22712272            NEXT_OPCODE(op_get_scoped_var);
     
    22752276            int depth = currentInstruction[2].u.operand;
    22762277            int source = currentInstruction[3].u.operand;
    2277             NodeIndex getScopeChain = addToGraph(GetScopeChain, OpInfo(depth));
    2278             addToGraph(PutScopedVar, OpInfo(slot), getScopeChain, get(source));
     2278            NodeIndex getScope = addToGraph(GetScope, OpInfo(depth));
     2279            NodeIndex getScopeRegisters = addToGraph(GetScopeRegisters, getScope);
     2280            addToGraph(PutScopedVar, OpInfo(slot), getScope, getScopeRegisters, get(source));
    22792281            NEXT_OPCODE(op_put_scoped_var);
    22802282        }
Note: See TracChangeset for help on using the changeset viewer.