jruby/jruby — pull request #2328 by chrisseaton (2014-12-16 06:11:36+00:00)
Title: [Truffle] New implementation of non-small hashes

@eregon @nirvdrum please review

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 `hash` and `eql?` with somewhere to store the state for the call site. We can't re-use JRuby's, for the usual reasons, and using the Truffle-style of storage strategies we don't want encapsulation - we want the logic to be in the nodes.

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.