Skip to content
  • fpizlo@apple.com's avatar
    DFG should keep captured variables alive until the (inline) return. · 4c0875e8
    fpizlo@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=87205
    
    Source/JavaScriptCore: 
    
    Reviewed by Gavin Barraclough.
            
    Changes the way we do flushing for captured variables and arguments. Instead of flushing
    each SetLocal immediately, we flush at kill points. So a SetLocal will cause a Flush of
    whatever was live in the variable previously, and a return will cause a Flush of all
    captured variables and all arguments.
    
    * dfg/DFGByteCodeParser.cpp:
    (JSC::DFG::ByteCodeParser::setDirect):
    (JSC::DFG::ByteCodeParser::set):
    (JSC::DFG::ByteCodeParser::setLocal):
    (JSC::DFG::ByteCodeParser::getArgument):
    (JSC::DFG::ByteCodeParser::setArgument):
    (JSC::DFG::ByteCodeParser::findArgumentPositionForArgument):
    (ByteCodeParser):
    (JSC::DFG::ByteCodeParser::findArgumentPositionForLocal):
    (JSC::DFG::ByteCodeParser::findArgumentPosition):
    (JSC::DFG::ByteCodeParser::flush):
    (JSC::DFG::ByteCodeParser::flushDirect):
    (JSC::DFG::ByteCodeParser::flushArgumentsAndCapturedVariables):
    (JSC::DFG::ByteCodeParser::handleInlining):
    (JSC::DFG::ByteCodeParser::parseBlock):
    (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
    * dfg/DFGCSEPhase.cpp:
    (JSC::DFG::CSEPhase::setLocalStoreElimination):
    (JSC::DFG::CSEPhase::performNodeCSE):
    * dfg/DFGSpeculativeJIT.cpp:
    (JSC::DFG::SpeculativeJIT::compile):
    * dfg/DFGSpeculativeJIT.h:
    (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
    
    LayoutTests: 
    
    Reviewed by Gavin Barraclough.
    
    * fast/js/dfg-inline-arguments-osr-exit-and-capture-expected.txt: Added.
    * fast/js/dfg-inline-arguments-osr-exit-and-capture.html: Added.
    * fast/js/script-tests/dfg-inline-arguments-osr-exit-and-capture.js: Added.
    (foo):
    (bar):
    (baz):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118858 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    4c0875e8