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
Reviewed-on: https://chromium-review.googlesource.com/663278
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Hitoshi Yoshida <peria@chromium.org>
Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501927}
1 file changed