summaryrefslogtreecommitdiff
path: root/insns.def
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-27 16:02:50 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-27 16:02:50 +0000
commit0d399220b02adb104b7cbd2fd4cb1055350a560c (patch)
tree46df61c345082caa6753e9924cca0a92fd325a37 /insns.def
parent7cbc39be6973b3a6ade414f42cdcf156efb3dee6 (diff)
merge revision(s) 57278,57279: [Backport #12855]
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] adjust indent [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'insns.def')
-rw-r--r--insns.def11
1 files changed, 7 insertions, 4 deletions
diff --git a/insns.def b/insns.def
index 2deb199d4c..b6a87734c0 100644
--- a/insns.def
+++ b/insns.def
@@ -1904,7 +1904,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 {
@@ -1926,7 +1928,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 {
@@ -2075,8 +2079,7 @@ opt_succ
BASIC_OP_UNREDEFINED_P(BOP_SUCC, STRING_REDEFINED_OP_FLAG)) {
val = rb_str_succ(recv);
}
- else
- {
+ else {
goto INSN_LABEL(normal_dispatch);
}
}