Mads,

Thanks for the helpful tips. I will definitely look into using
internal fields where possible to achieve the speedup.

Stephan is correct, I'm wanting to associate metadata with non-object,
non-template created values like dates and regexen. In fact, for my
use-case (therubyracer), I'd really like to be able to tie metadata to
anything you can get a Handle to since I also reflect non-value things
into Ruby like Context and FunctionTemplate. That said, being able to
get a stable, unique object id for all values would be killer. You
mentioned that it would be relatively straightforward to roll your
own? Any chance you could elaborate?

cheers,
Charles


On May 3, 2:01 am, Mads Sig Ager <[email protected]> wrote:
> On Tue, May 3, 2011 at 8:58 AM, Stephan Beal <[email protected]> wrote:
> > On Tue, May 3, 2011 at 8:56 AM, Mads Sig Ager <[email protected]> wrote:
>
> >> On Tue, May 3, 2011 at 8:52 AM, Stephan Beal <[email protected]>wrote:
>
> >>> 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 ...
>
> >> 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. :)
>
> > But Object::GetIdentityHash() only works for Objects, right?
>
> > In SpiderMonkey each JS value is a numeric handle with a stable value (v8's
> > aren't stable b/c of how the allocator works), and those numbers can be used
> > to map, e.g.
> > a Window handle to a JS Integer.
>
> Yes, GetIdentifyHash only works for Objects. For values you can easily roll
> your own. What you get from GetIdentityHash will stay the same over time.
>
> -- 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

Reply via email to