* Closes #1184 undefined method `__ruby_object' for interface implementation
* Use #equals instead of == to compare the method name String objects since == will return false if the String objects have the same content, but are different instances.
* Closes #1184 undefined method `__ruby_object' for interface implementation
* Use #equals instead of == to compare the method name String objects since == will return false if the String objects have the same content, but are different instances.
Invalidate last SP before bailing out to dummy. Fixes #1375.
Merge remote-tracking branch 'origin/jruby-1_7'
Happy New Year!
Regression spec for #1375.
Improve pre-frozen string logic with a deduplication cache.

This commit brings our "str".freeze compiler optimization in line
with MRI by using a global deduplication cache to provide for even
more sharing across literals. The cache is both weak-keyed and
weak-valued and just maps from an arbitrary RubyString to the
pre-frozen cached version of that RubyString.

Note that the logic for deduplication is synchronized against the
JRuby runtime. This will impact concurrent loads that repeatedly
ping the cache, but uses in this commit all cache the value
locally and only hit the dedup cache once. This potential
concurrency bottleneck may need to be addressed in the future.
Implement deduplication of literal hash string keys.

Because we know that string keys are immediately duplicated and
frozen we can use our freeze-dup cache of strings in the compiler
whenever we see a literal hash with literal string keys. This
avoids the overhead of duplicating and freezing literal strings
repeatedly, for a roughly 4x performance speedup on a 5-element
literal hash with literal string keys. In addition, this commit
modifies the normal freeze-dup process in Hash to use the dedup
cache added in 926ca89.

This commit may introduce contention since the process of freeze-
duping string keys now must pass through the synchronized dedup
logic from 926ca89. We may need to reexamine that logic, or not
use it in the hash key string insertion freeze-duping.
Use a cache of Thread#status values, to reduce alloc overhead.
Do not eagerly dedup strings when doing identity comparison.