Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update hash code usage for capnp change #2312

Merged
merged 2 commits into from
Jun 22, 2024
Merged

Update hash code usage for capnp change #2312

merged 2 commits into from
Jun 22, 2024

Conversation

kentonv
Copy link
Member

@kentonv kentonv commented Jun 21, 2024

See individual commits.

@kentonv kentonv requested a review from jasnell June 21, 2024 21:31
@kentonv kentonv requested review from a team as code owners June 21, 2024 21:31
@kentonv kentonv requested a review from mikea June 21, 2024 21:31
Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be worthwhile adding some docs to jsg/README.md on this

This may or may not be necessary in conjunction with the KJ hashCode() change: capnproto/capnproto#2086

I couldn't figure out if V8's `GetIdentityHash()` returns uniform hashes vs., say, addresses. It looks like in at least some cases they are uniform, but it's really hard to _find_ all the V8 hash implementations in their code. Some seem to be generated by Torque?

If we just wrap these in `kj::hashCode()` then our bases should be covered, at the expense of an extra cycle or three to rehash the values.
@kentonv
Copy link
Member Author

kentonv commented Jun 21, 2024

It would be worthwhile adding some docs to jsg/README.md on this

To me this doesn't feel like something that belongs in the readme, but I did add a comment to the code.

@kentonv kentonv merged commit f2308c9 into main Jun 22, 2024
10 checks passed
@kentonv kentonv deleted the kenton/fix-hashes branch June 22, 2024 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants