On Tue, May 3, 2011 at 8:52 AM, Stephan Beal <[email protected]> wrote:
> On Tue, May 3, 2011 at 8:32 AM, Mads Sig Ager <[email protected]> wrote: > >> I would use internal fields for that. I would create the JS wrappers from >> templates specifying a number of internal fields and use >> Set/GetPointerInInternalField to get and set them. Internal fields are >> faster to access than hidden properties. >> > > i think Charles is wanting to tie data to non-template-generated values > like Numbers. From what i understand, v8 does not have the API to do this. > Nor does it provide a stable unique ID per value instance which we can use > to do the mapping ourselves (it is doable in SpiderMonkey, but that's > probably SM's only advantage over v8). > Object::GetIdentityHash should give you what you want to do the mapping externally. If you want to add external data after the fact in the object itself hidden values is the way to go. :) Cheers, -- Mads > > -- > ----- stephan beal > http://wanderinghorse.net/home/stephan/ > > -- > v8-users mailing list > [email protected] > http://groups.google.com/group/v8-users > -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
