For each argument, it searches through each argument to check for duplicate parameter names. A better solution would move FunctionImp::getParameterName into IndexToNameMap::IndexToNameMap, and use a hash table to keep track of already seen parameter names --> better modularity and O(1) behavior.
Created attachment 20224 [details] Sample SunSpider test SunSpider-0.9 doesn't use the "arguments" object from within a function, so it can't be used to test the performance of the IndexToNameMap constructor code. This is a test that may be dropped into the SunSpider directory to be run. I'm sure it doesn't mimic any real-world usage of arguments, but it does exercise the code in the IndexToNameMap constructor.
Created attachment 20370 [details] Script to generate function args test suite This script generates tests for use with SunSpider. It tests passing 0 to 10 arguments to eleven different functions, each of which have 0 to 10 arguments, for a total of 121 tests. The script should be run from the checked-out SunSpider directory, and generates files of the form: function-args-M-N.js where "M" is the number arguments the function is defined with and N is the number of arguments actually passed to that function. Note that the script outputs a list of function names to stdout, which need to be added to tests/LIST before running SunSpider: $ ./sunspider --shell ../WebKitBuild/Release/testkjs --tests function-args --run 25
See Bug 20815 Comment #7.
I eliminated IndexToNameMap in http://trac.webkit.org/changeset/36743 and I believe this bug is fixed now.
(In reply to comment #4) > I eliminated IndexToNameMap in http://trac.webkit.org/changeset/36743 and I > believe this bug is fixed now. See Bug 20972.