On Apr 11, 2011, at 9:21 PM, David Bruant wrote:

> Actually I was wrong I think. With the introduction of proxies, ES
> engines won't be able to trivially prevent pd allocation as they could
> with regular objects just based on static analysis (since static
> analysis will often fail at saying whether the function will be used
> with regular objects or proxies as first argument)

Static analysis is conservative, yes. But type inference often can say what 
exact types |this| and other arguments have.

Anyway, this isn't about absolute guarantees unless JS provides an API to query 
without allocating :-P.


> I think it could be possible if we had a native Object.hasOwnProperty
> method since that's really what we need here (that's what a static
> analysis optimization would do internally).

That was left out on purposes during ES3.1/ES5 design to keep things minimal. 
And of course Proxies built on that API. So probably we should leave this as an 
optimization challenge (GC, type inference, both if possible).

/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to