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

[Truffle] Implement Array#hash using murmurhash #3994

Merged
merged 5 commits into from
Jul 4, 2016

Conversation

bjfish
Copy link
Contributor

@bjfish bjfish commented Jul 3, 2016

Does this need @TruffleBoundary?

@Child private ToIntNode toIntNode;

@Specialization(guards = "isNullArray(array)")
public long hashNull(VirtualFrame frame, DynamicObject array) {
Copy link
Member

Choose a reason for hiding this comment

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

When the frame is not needed, it's usually best to avoid it in the arguments for clarity.

@eregon
Copy link
Member

eregon commented Jul 4, 2016

Does this need @TruffleBoundary?

Looks like it's fine as it is, there is almost no branching and it's just arithmetic.
hashStart takes the JRuby runtime though, it would be best if we can just just choose the right seed in advance, and not branch on siphashEnabled at every call.

@@ -920,13 +918,14 @@ protected Object fillFallback(VirtualFrame frame, DynamicObject array, Object[]
public abstract static class HashNode extends ArrayCoreMethodNode {

@Child private ToIntNode toIntNode;
@Child private CallDispatchHeadNode toHashNode;
Copy link
Member

Choose a reason for hiding this comment

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

This can also be in @Cached and actually replace the SnippetNode.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@eregon I've updated this to be @Cached now and removed the unused SnippetNode

@eregon eregon added the truffle label Jul 4, 2016
@eregon eregon added this to the truffle-dev milestone Jul 4, 2016
@eregon
Copy link
Member

eregon commented Jul 4, 2016

Let's merge this!

@eregon eregon merged commit 74a21e5 into master Jul 4, 2016
@eregon eregon deleted the truffle-array-hash-murmur branch July 4, 2016 19:29
@enebo enebo added this to the Invalid or Duplicate milestone Dec 7, 2017
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

3 participants