Direct proxies strawman

Andreas Rossberg rossberg at google.com
Tue Oct 18 08:16:54 PDT 2011


On 17 October 2011 21:15, Tom Van Cutsem <tomvc.be at gmail.com> wrote:
> I just finished a first draft of the
> strawman: <http://wiki.ecmascript.org/doku.php?id=strawman:direct_proxies>.
> Feedback welcome.

Hi Tom,

this looks nice, but a couple of things confuse me.

First, Proxy.startTrapping (a.k.a. Proxy.attach). As far as I can see,
this implies a significantly more general 'become' operation than the
current semantics. I don't see how we can implement that without
substantial (and potentially costly) changes to VMs, like support for
transparent forwarding references. I also share Dave's concerns
regarding conflation of "non-attachability" and "non-extensibility".

Proxy.stopTrapping worries me, too, especially in combination with
attaching. It seems like I could create a proxy p, then later want to
deactivate trapping for my handler. But in the meantime, somebody else
morphed my p into his own proxy by invoking startTrapping(p). So
stopTrapping(p) would deactivate his handler, not mine. So, the
proposed interface seems broken to me.

Finally, I'm not sure I fully understand the performance implications
of direct proxies vs the current proposal. From looking at your
prototype implementation, it seems that we need quite a number of
additional checks and calls, even for non-fixed properties. Can you
perhaps quantify that overhead a bit?

Thanks,
/Andreas


More information about the es-discuss mailing list