flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: Flex 5 UIComponent - Behavior Pattern
Date Mon, 23 Jan 2012 20:19:24 GMT

On 1/23/12 12:05 PM, "Ryan Frishberg" <frishy@gmail.com> wrote:

> I understand that caching every function would be expensive, but I don't
> understand why a reference to a function isn't just 4 bytes.  Why is it a
> closure?  The only thing I can think of that would be in scope would be the
> "this" object for the function owner (but maybe that's what makes it a
> closure)?
Believe me, I was surprised to find this out as well.  Basically, it is
because of an inefficient implementation in the VM.

At minimum, it has to reference two things: the pointer to the 'this' object
and the pointer to the name of the method, so I'm pretty sure it has to be
at least 8 bytes, but when I asked about it a while back, they decided it
couldn't be less than 32 bytes (yes, bytes not bits).  Apparently there is
other stuff that needs to be tracked as well.

Alex Harui
Flex SDK Team
Adobe Systems, Inc.

View raw message