-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Conversation
@Child private ToIntNode toIntNode; | ||
|
||
@Specialization(guards = "isNullArray(array)") | ||
public long hashNull(VirtualFrame frame, DynamicObject array) { |
There was a problem hiding this comment.
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.
Looks like it's fine as it is, there is almost no branching and it's just arithmetic. |
@@ -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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Let's merge this! |
Does this need
@TruffleBoundary
?