summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-27 01:10:02 (GMT)
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-27 01:10:02 (GMT)
commit529af9c82123393c73f74040d974558b68212297 (patch)
treea2bb7c0c7940490d785228baaaa3c5f737b06326 /vm_insnhelper.c
parent22444ae9b1a20e39b7278193f85e4d805bd1d54d (diff)
refactor move logics out of insns.def
This is a pure refactoring. I see no difference in this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 1f22cc6..3fac8eb 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -3213,6 +3213,17 @@ vm_find_or_create_class_by_id(ID id,
}
}
+static VALUE
+vm_opt_str_freeze(VALUE str, int bop, ID id)
+{
+ if (BASIC_OP_UNREDEFINED_P(bop, STRING_REDEFINED_OP_FLAG)) {
+ return str;
+ }
+ else {
+ return rb_funcall(rb_str_resurrect(str), id, 0);
+ }
+}
+
/* this macro is mandatory to use OPTIMIZED_CMP. What a design! */
#define id_cmp idCmp