Ignore:
Timestamp:
Sep 27, 2013, 9:08:59 PM (12 years ago)
Author:
[email protected]
Message:

Get rid of SetMyScope/SetCallee; use normal variables for the scope and callee of inlined call frames of closures
https://bugs.webkit.org/show_bug.cgi?id=122047

Reviewed by Oliver Hunt.

Currently we have the DFG reserve space for inline call frames at exactly the same stack
offsets that you would have gotten if the baseline interpreter/JIT had made the calls.
We need to get rid of that. One of the weirder parts of this is that we have special DFG
operations for accessing these inlined call frame headers. It's really hard for any
analysis of DFG IR to see what the liveness of any of those frame header "variables" is;
the liveness behaves like flushed arguments (it's all live until end of the inlinee) but
we don't have anything like a Flush node for those special variables.

This patch gets rid of the special operations for accessing inline call frame headers.
GetMyScope and GetCallee still remain, and are only for accessing the machine call
frame's scope/callee entries. The inline call frame's scope/callee now behave like
normal variables, and have Flush behavior just like inline arguments.

  • dfg/DFGAbstractInterpreterInlines.h:

(JSC::DFG::::executeEffects):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::getDirect):
(JSC::DFG::ByteCodeParser::get):
(JSC::DFG::ByteCodeParser::setDirect):
(JSC::DFG::ByteCodeParser::set):
(JSC::DFG::ByteCodeParser::setLocal):
(JSC::DFG::ByteCodeParser::setArgument):
(JSC::DFG::ByteCodeParser::flush):
(JSC::DFG::ByteCodeParser::InlineStackEntry::remapOperand):
(JSC::DFG::ByteCodeParser::handleInlining):
(JSC::DFG::ByteCodeParser::getScope):

  • dfg/DFGCSEPhase.cpp:

(JSC::DFG::CSEPhase::getCalleeLoadElimination):
(JSC::DFG::CSEPhase::getMyScopeLoadElimination):
(JSC::DFG::CSEPhase::performNodeCSE):

  • dfg/DFGClobberize.h:

(JSC::DFG::clobberize):

  • dfg/DFGFixupPhase.cpp:

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

  • dfg/DFGNodeType.h:
  • dfg/DFGPredictionPropagationPhase.cpp:

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

  • dfg/DFGSafeToExecute.h:

(JSC::DFG::safeToExecute):

  • 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/DFGCSEPhase.cpp

    r156047 r156594  
    166166    }
    167167   
    168     Node* getCalleeLoadElimination(InlineCallFrame* inlineCallFrame)
    169     {
    170         for (unsigned i = m_indexInBlock; i--;) {
    171             Node* node = m_currentBlock->at(i);
    172             if (node->codeOrigin.inlineCallFrame != inlineCallFrame)
    173                 continue;
     168    Node* getCalleeLoadElimination()
     169    {
     170        for (unsigned i = m_indexInBlock; i--;) {
     171            Node* node = m_currentBlock->at(i);
    174172            switch (node->op()) {
    175173            case GetCallee:
    176174                return node;
    177             case SetCallee:
    178                 return node->child1().node();
    179175            default:
    180176                break;
     
    803799    }
    804800   
    805     Node* getMyScopeLoadElimination(InlineCallFrame* inlineCallFrame)
    806     {
    807         for (unsigned i = m_indexInBlock; i--;) {
    808             Node* node = m_currentBlock->at(i);
    809             if (node->codeOrigin.inlineCallFrame != inlineCallFrame)
    810                 continue;
     801    Node* getMyScopeLoadElimination()
     802    {
     803        for (unsigned i = m_indexInBlock; i--;) {
     804            Node* node = m_currentBlock->at(i);
    811805            switch (node->op()) {
    812806            case CreateActivation:
     
    815809            case GetMyScope:
    816810                return node;
    817             case SetMyScope:
    818                 return node->child1().node();
    819811            default:
    820812                break;
     
    10921084            if (cseMode == StoreElimination)
    10931085                break;
    1094             setReplacement(getCalleeLoadElimination(node->codeOrigin.inlineCallFrame));
     1086            setReplacement(getCalleeLoadElimination());
    10951087            break;
    10961088
     
    11901182            if (cseMode == StoreElimination)
    11911183                break;
    1192             setReplacement(getMyScopeLoadElimination(node->codeOrigin.inlineCallFrame));
     1184            setReplacement(getMyScopeLoadElimination());
    11931185            break;
    11941186           
Note: See TracChangeset for help on using the changeset viewer.