Skip to content
  • fpizlo@apple.com's avatar
    DFG assumes that NewFunction will never pass its input through · 507dca16
    fpizlo@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=118798
    
    Source/JavaScriptCore: 
    
    Reviewed by Sam Weinig.
            
    Previously the DFG was assuming that NewFunction always returns a function. That's not
    the case. It may return whatever was passed to it, if it wasn't passed SpecEmpty.
            
    This fact needed to be wired through the compiler.
    
    * dfg/DFGAbstractState.cpp:
    (JSC::DFG::AbstractState::executeEffects):
    * dfg/DFGAbstractValue.h:
    (JSC::DFG::AbstractValue::makeTop):
    * dfg/DFGGraph.cpp:
    (JSC::DFG::Graph::dump):
    * dfg/DFGOperations.cpp:
    * dfg/DFGOperations.h:
    * dfg/DFGPredictionPropagationPhase.cpp:
    (JSC::DFG::PredictionPropagationPhase::propagate):
    * dfg/DFGSpeculativeJIT.h:
    (JSC::DFG::SpeculativeJIT::callOperation):
    * dfg/DFGSpeculativeJIT32_64.cpp:
    (JSC::DFG::SpeculativeJIT::compile):
    * dfg/DFGSpeculativeJIT64.cpp:
    (JSC::DFG::SpeculativeJIT::compile):
    
    LayoutTests: 
    
    Reviewed by Sam Weinig.
    
    * fast/js/dfg-use-function-as-variable-expected.txt: Added.
    * fast/js/dfg-use-function-as-variable-merge-structure-expected.txt: Added.
    * fast/js/dfg-use-function-as-variable-merge-structure.html: Added.
    * fast/js/dfg-use-function-as-variable-not-constant-expected.txt: Added.
    * fast/js/dfg-use-function-as-variable-not-constant.html: Added.
    * fast/js/dfg-use-function-as-variable-with-closure-expected.txt: Added.
    * fast/js/dfg-use-function-as-variable-with-closure.html: Added.
    * fast/js/dfg-use-function-as-variable.html: Added.
    * fast/js/jsc-test-list:
    * fast/js/script-tests/dfg-use-function-as-variable-merge-structure.js: Added.
    (.x):
    (run_tests):
    * fast/js/script-tests/dfg-use-function-as-variable-not-constant.js: Added.
    (run_tests.x):
    (run_tests):
    * fast/js/script-tests/dfg-use-function-as-variable-with-closure.js: Added.
    (run_tests.x):
    (run_tests.y):
    (run_tests):
    * fast/js/script-tests/dfg-use-function-as-variable.js: Added.
    (run_tests.x):
    (run_tests):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152813 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    507dca16