Delay Arguments creation in strict mode
https://bugs.webkit.org/show_bug.cgi?id=119505
Reviewed by Geoffrey Garen.
Source/JavaScriptCore:
Make use of the write tracking performed by the parser to
allow us to know if we're modifying the parameters to a function.
Then use that information to make strict mode function opt out
of eager arguments creation.
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::createArgumentsIfNecessary):
(JSC::BytecodeGenerator::emitReturn):
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::shouldTearOffArgumentsEagerly):
* parser/Nodes.h:
(JSC::ScopeNode::modifiesParameter):
* parser/Parser.cpp:
(JSC::::parseInner):
* parser/Parser.h:
(JSC::Scope::declareParameter):
(JSC::Scope::getCapturedVariables):
(JSC::Parser::declareWrite):
* parser/ParserModes.h:
LayoutTests:
Add performance testcase for lazy creation of arguments in strict mode
* fast/js/regress/delay-tear-off-arguments-strictmode-expected.txt: Added.
* fast/js/regress/delay-tear-off-arguments-strictmode.html: Added.
* fast/js/regress/script-tests/delay-tear-off-arguments-strictmode.js: Added.
(bar):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153763 268f45cc-cd09-0410-ab3c-d52691b4dbfc
11 files changed