Making "super" work outside a literal?

Brendan Eich brendan at
Wed Jun 22 23:04:32 PDT 2011

On Jun 22, 2011, at 4:02 PM, Axel Rauschmayer wrote:

>> From: Brendan Eich <brendan at>
>> Date: June 23, 2011 0:21:17 GMT+02:00
>>> Is there no per-call cost whatsoever to adding static super?
>> No, it's static -- an internal property of the function object set once on creation and (in my view) never changed thereafter unless unobservably (Allen's point about optimizing Object.defineMethod when "handing off" an otherwise-useless function expression).
> How does a function get access to its properties? Doesn’t the ability to access "thisFunction" incur any costs? I would expect static super to work as follows:
> var Sub = Super <| {
>     foo: function me(x) {
>, x);
>     }
> }
> Does the named function expression cost nothing here?

This is entirely beside the point.

Dynamic |super| as Sean proposes requires *every call site* to pass the |here| parameter or something derived from it, no way around that.

Paying for 'super' if you use it, buying by the yard, is not a problem.

Making *every function call* in the language slow, increasing register pressure, etc. -- absent aggressive inference to identify callees and specialize call sites to them (inlining VMs do this but it can backfire, so there will be a default case that can't do this) -- is a big problem.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list