aboutsummaryrefslogtreecommitdiffstats
path: root/insns.def
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-07 11:31:53 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-07 11:31:53 +0000
commitd87ec1f939faabab0e1b6f7f6bda0744dadda47c (patch)
tree1437b08685e31dfbefd9c2b895522cb3e5b16764 /insns.def
parent268f8198e079fa82760bed813034a23b1c7500f3 (diff)
downloadruby-d87ec1f939faabab0e1b6f7f6bda0744dadda47c.tar.gz
fix optimization for hash aset/aref with fstring
Patch by Eric Wong [ruby-core:78797]. I don't like the idea of making insns.def any bigger to support a corner case, and "test_hash_aref_fstring_identity" shows how contrived this is. [ruby-core:78783] [Bug #12855] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'insns.def')
-rw-r--r--insns.def8
1 files changed, 6 insertions, 2 deletions
diff --git a/insns.def b/insns.def
index b64a168b7a..41e4498a67 100644
--- a/insns.def
+++ b/insns.def
@@ -1881,7 +1881,9 @@ opt_aset_with
(VALUE recv, VALUE val)
(VALUE val)
{
- if (!SPECIAL_CONST_P(recv) && RBASIC_CLASS(recv) == rb_cHash && BASIC_OP_UNREDEFINED_P(BOP_ASET, HASH_REDEFINED_OP_FLAG)) {
+ if (!SPECIAL_CONST_P(recv) && RBASIC_CLASS(recv) == rb_cHash &&
+ BASIC_OP_UNREDEFINED_P(BOP_ASET, HASH_REDEFINED_OP_FLAG) &&
+ rb_hash_compare_by_id_p(recv) == Qfalse) {
rb_hash_aset(recv, key, val);
}
else {
@@ -1903,7 +1905,9 @@ opt_aref_with
(VALUE recv)
(VALUE val)
{
- if (!SPECIAL_CONST_P(recv) && RBASIC_CLASS(recv) == rb_cHash && BASIC_OP_UNREDEFINED_P(BOP_AREF, HASH_REDEFINED_OP_FLAG)) {
+ if (!SPECIAL_CONST_P(recv) && RBASIC_CLASS(recv) == rb_cHash &&
+ BASIC_OP_UNREDEFINED_P(BOP_AREF, HASH_REDEFINED_OP_FLAG) &&
+ rb_hash_compare_by_id_p(recv) == Qfalse) {
val = rb_hash_aref(recv, key);
}
else {