DFG arguments simplification takes unkindly to direct accesses to the arguments register
https://bugs.webkit.org/show_bug.cgi?id=88261
Source/JavaScriptCore:
Reviewed by Geoffrey Garen.
Fixed arguments simplification for direct accesses to the arguments register, which may
arise if CSE had not run. Fixed CSE so that it does run prior to arguments simplification,
by making it a full-fledged member of the fixpoint. Fixed other issues in arguments
simplification, like realizing that it needs to bail if there is a direct assignment to
the arguments register, and failing to turn CreateArguments into PhantomArguments. Also
fixed CSE's handling of store elimination of captured locals in the presence of a
GetMyArgumentByVal (or one of its friends), and fixed CSE to correctly fixup variables at
tail if the Flush it removes is the last operation on a local in a basic block.
(JSC::CodeBlock::dump):
- dfg/DFGArgumentsSimplificationPhase.cpp:
(JSC::DFG::ArgumentsSimplificationPhase::run):
(JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize):
(JSC::DFG::CSEPhase::run):
(JSC::DFG::CSEPhase::setLocalStoreElimination):
(JSC::DFG::CSEPhase::performNodeCSE):
(CSEPhase):
(JSC::DFG::compile):
LayoutTests:
Reviewed by Geoffrey Garen.
- fast/js/dfg-arguments-alias-one-block-expected.txt: Added.
- fast/js/dfg-arguments-alias-one-block-osr-exit-expected.txt: Added.
- fast/js/dfg-arguments-alias-one-block-osr-exit.html: Added.
- fast/js/dfg-arguments-alias-one-block-overwrite-arguments-expected.txt: Added.
- fast/js/dfg-arguments-alias-one-block-overwrite-arguments.html: Added.
- fast/js/dfg-arguments-alias-one-block-overwrite-expected.txt: Added.
- fast/js/dfg-arguments-alias-one-block-overwrite.html: Added.
- fast/js/dfg-arguments-alias-one-block.html: Added.
- fast/js/script-tests/dfg-arguments-alias-one-block-osr-exit.js: Added.
(foo):
- fast/js/script-tests/dfg-arguments-alias-one-block-overwrite-arguments.js: Added.
(foo):
- fast/js/script-tests/dfg-arguments-alias-one-block-overwrite.js: Added.
(foo):
- fast/js/script-tests/dfg-arguments-alias-one-block.js: Added.
(foo):