Use of arguments in arrow function is slow
authorgskachkov@gmail.com <gskachkov@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Feb 2017 20:57:35 +0000 (20:57 +0000)
committergskachkov@gmail.com <gskachkov@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Feb 2017 20:57:35 +0000 (20:57 +0000)
commit41825c30d2fe8b905a4e6dff9812fa9352371f95
tree80400aa96fff2b0a9137625132961ec30803fcb3
parent63ad334d0d0b42c83ac09073c6d43db987873aa0
Use of arguments in arrow function is slow
https://bugs.webkit.org/show_bug.cgi?id=168829

Reviewed by Saam Barati.

JSTests:

* microbenchmarks/arrowfunciton-direct-arguments.js: Added.
(fn):
* microbenchmarks/arrowfunciton-reference-arguments.js: Added.
(fn):

Source/JavaScriptCore:

Current patch improves performance access to arguments within arrow functuion
by preventing create arguments variable within arrow function, also allow to cache
arguments variable. Before arguments variable always have Dynamic resolve type, after
patch it can be ClosureVar, that increase performance of access to arguments variable
in 9 times inside of the arrow function.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
* runtime/JSScope.cpp:
(JSC::abstractAccess):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213165 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/microbenchmarks/arrowfunciton-direct-arguments.js [new file with mode: 0644]
JSTests/microbenchmarks/arrowfunciton-reference-arguments.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
Source/JavaScriptCore/runtime/JSScope.cpp