Use a trivial hash function for V8FunctionTemplateMap.

These maps are populated with static pointers, and so don't need to be
as well-mixed as some other hash maps. Surprisingly, hashing the pointer
to lookup is quite significant. This is a much simpler hash function
that chops off the low (alignment bits), and then xors some of it back
in (as there are a few ints that the compiler might choose to pack).

In practice this is good enough to avoid pathological collisions, and
this makes an appendChild/removeChild benchmark about 10% faster,
purely by making the Node argument conversion lookup cheaper.

Bug: 764618
Change-Id: I78534f9a3c16da5001512add36aabf49022cc04e
Commit-Queue: Jeremy Roman <>
Reviewed-by: Kentaro Hara <>
Reviewed-by: Hitoshi Yoshida <>
Reviewed-by: Yuki Shiino <>
Cr-Commit-Position: refs/heads/master@{#501927}
1 file changed