On 2015/04/24 08:28:24, titzer wrote:
On 2015/04/23 18:15:03, adamk wrote:
> Drive-by interest: I've been wishing for something better than the Object > Identity Hash for hashing JSObjects in Map/Set/WeakMap/WeakSet; any chance
the
> approach here is extendable to those?

I haven't thought about that use case. It probably wouldn't work for the
direct
Object->Value mapping, but maybe could work for Object->Stable hash (?).

For one thing, these maps live in the C++ world only and always have strong references to their objects. I suppose it wouldn't be too much work to make
them
weak, though. Second, it's expected that there will be only a few of them in flight at once; they need to be iterated during scavenge. Initially, at most
one
per TF compilation, since that will be the first usage. Third, they should be small, since the implementation is a hashed linear search and it's hoped the
array will be pretty sparse. Fourth, implementation needs to hold the
relocation
lock during search of the table.

Thanks for the details, that set of restrictions doesn't sound like something
we'd want to have to deal with in author code, so I'll go back to the
thought-experiment board for a better way to hash objects than identity hash
fields.

Carry on :)

https://codereview.chromium.org/1105693002/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to