Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[Truffle] New implementation of non-small hashes #2328
We've got two new things here. First of all we've got a proper implementation of hash where there are more than 3 key-value pairs. We have to have a custom data structure because we need to call Ruby methods for
Secondly I've also moved some of the logic of the hash into a node - the basic operation of finding the right bucket. That allows us to store the state and possibly do some branch profiling and value profiling but still provide a nice method call interface.
I've added a test to stress hash implementations.
We aren't doing any rebalancing for overloaded indices yet - we never grow the number of slots.
Looks good globally.
I am slightly uncomfortable with the naming of Bucket for what is a "hashtable entry".
This looks funny but I guess it makes sense once you know this Entry is actually a chain of Entries, that is a bucket.