[Webkit-unassigned] [Bug 74633] Allow JSStaticScope to bind more than one variable

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Dec 25 15:30:44 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=74633





--- Comment #7 from Gavin Barraclough <barraclough at apple.com>  2011-12-25 15:30:44 PST ---
Hi Andy,

Ah, good point – you're right we will need a solution based around a scope supporting multiple variables.

However I think Geoff has a good point about eager vs lazy tear-off, an that it really might be worth a quick investigation before moving forwards.  It may be much better to switch the const/let mechanism to be based on create_activation rather than push_new_scope, and since doing so may make a number of these changes redundant it could be a good idea to at least look into how hard this would be before going ahead with the push_new_scope based solution.

Lazy tear-off of activations offers two key performance advantages over static scopes.  In some cases the variables that might be captured may be accessed frequently within the function they are declared in and benefit from fast access to local virtual registers.  Further, we usually try to be lazy about allocating activation objects, only doing so if a function expression is actually reached (it is not atypical for a program to contain functions that can and sometimes do create closures, but upon many invocations do not).

There may be further advantages to using activations.  Activations already support multiple variables, and if generalized to be able to be used at block scope as well as function scope may allow us to remove push_new_scope, reducing complexity.  Considering let/const variables at function scope, it would be inefficient to create separate objects on the scope chain for vars and const/let variables, placing const/let values on the activation would allow us to use the same object.  And a key optimization for both vars and let/const values will be escape/capture analysis.  This mechanism will want to operate over all types of variables, and having 

static

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list