Review Board 2.0.15


Ruby: Ensure order-dependent iteration uses an ordered map

Review Request #1145 - Created April 10, 2012 and submitted - Latest diff uploaded

Information
Andreas Hansson
gem5
default
Reviewers
Default
Ruby: Ensure order-dependent iteration uses an ordered map

This patch fixes a bug in Ruby that caused non-deterministic
simulation when changing the underlying hash map implementation. The
reason is order-dependent behaviour in combination with iteration over
the hash map contents. The two locations where a sorted container is
assumed are now changed to make use of a std::map instead of the
unordered hash map.

With this change, the stats changes slightly and the follow-on
changeset will update the relevant statistics.
Confirmed that the changes caused the following two regressions to fail:


***** build/ALPHA_MOESI_hammer/tests/opt/quick/se/50.memtest/alpha/linux/memtest-ruby-MOESI_hammer FAILED!
***** build/ALPHA_MOESI_CMP_token/tests/opt/quick/se/50.memtest/alpha/linux/memtest-ruby-MOESI_CMP_token FAILED!

This is in line with what was observed when using <unordered_map> instead of <ext/hash_map>