Comments on Meeting Notes

Brendan Eich brendan at mozilla.org
Tue Dec 4 15:57:51 PST 2012


Allen Wirfs-Brock wrote:
> On Dec 4, 2012, at 1:28 PM, Brendan Eich wrote:
>> Mark S. Miller wrote:
>>>> * It deoptimizes, e.g. a strict-mode function must be optimized to copy
>>>> actual parameter values into arguments if it could use the arguments object.
>>> This one I just don't buy at all. In a strict function f, f.arguments
>>> is poisoned. f's arguments would only need to be reified if f
>>> statically mentions "arguments" or if f has a statically apparent use
>>> of the direct eval operator. For all other cases, no arguments object
>>> need be created, and therefore no copying is needed.
>> Right, that's what I tried to say by "could use the arguments object". Nothing to do with hated f.arguments.
>>
>> So every strict function that uses arguments pays a copying price on entry in a naive implementation. Pushing the copies out till just before there might be an aliasing store is an optimization that could be done in a more sophisticated implementation, but engines don't do it currently and feel little pressure to do so. Chicken and egg.
>
> The timing of copying is only an issue if the function actually assigns to a formal parameter.  Such assignments should be pretty easy to (conservatively) statically check for.

I'm telling you what engines do. Not what they might do. I did 
assignment analysis in SpiderMonkey for Firefox 3.6, it was helpful in 
its day. I think a bunch has been ripped out because modern JITs don't 
need it.

> So, I guess I agree with Mark on this one.  Implementations could do a pretty good job of optimizing strict mode function parameters if they thought it was necessary.  It probably needs to be driven by benchmarks.

You are not responding to the point I made, cited above: " engines don't 
do it currently and feel little pressure to do so. Chicken and egg."

Benchmarks won't cut it if there's no organic developer pressure.

/be


More information about the es-discuss mailing list