RESOLVED FIXED Bug 19718
Named anonymous functions are slow accessing global variables
https://bugs.webkit.org/show_bug.cgi?id=19718
Summary Named anonymous functions are slow accessing global variables
Timothy Hatcher
Reported 2008-06-22 18:58:55 PDT
A named anonymous function that accesses a global or closure scope variable is slower than a non-named anonymous function. See the attached test case. This is a regression since SquirrelFish.
Attachments
Testcase (393 bytes, text/html)
2008-06-22 18:59 PDT, Timothy Hatcher
no flags
Timothy Hatcher
Comment 1 2008-06-22 18:59:28 PDT
Created attachment 21876 [details] Testcase
Geoffrey Garen
Comment 2 2008-06-23 12:49:51 PDT
Can you give more data on the SquirrelFish regression: * Is access to a global from a named anonymous function slower in SF than it was before SF? * How big (%) is the regression? The cause of the relative slowness is that, according to the spec, a named anonymous function should have a vanilla (i.e. unoptimized) object inserted into its scope chain, with one property: the function's name. We can / should improve this situation, but that's how things are implemented today (and how they've always been implemented).
Timothy Hatcher
Comment 3 2008-06-23 13:16:54 PDT
It is not a regression, since SquirrelFish is faster than Safari 3.1. But there is now a difference in speed between named anonymous functions and non-named anonymous function that didn't exist in Safari 3.1.
Oliver Hunt
Comment 4 2008-07-25 20:53:50 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ... M JavaScriptCore/ChangeLog M JavaScriptCore/GNUmakefile.am M JavaScriptCore/JavaScriptCore.pri M JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj M JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj M JavaScriptCore/VM/CodeGenerator.cpp M JavaScriptCore/VM/CodeGenerator.h M JavaScriptCore/kjs/AllInOneFile.cpp A JavaScriptCore/kjs/JSStaticScopeObject.cpp A JavaScriptCore/kjs/JSStaticScopeObject.h M JavaScriptCore/kjs/nodes.cpp M LayoutTests/ChangeLog M LayoutTests/fast/js/const-expected.txt M LayoutTests/fast/js/resources/const.js Committed r35368
Note You need to log in before you can comment on or make changes to this bug.