aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--compile.c5
-rw-r--r--insns.def14
-rw-r--r--vm_insnhelper.c7
3 files changed, 15 insertions, 11 deletions
diff --git a/compile.c b/compile.c
index 0e3abd71f7..2962bc8e34 100644
--- a/compile.c
+++ b/compile.c
@@ -29,9 +29,6 @@
#undef RUBY_UNTYPED_DATA_WARNING
#define RUBY_UNTYPED_DATA_WARNING 0
-rb_control_frame_t *
- FUNC_FASTCALL(rb_vm_str_intern)(rb_thread_t *, rb_control_frame_t *);
-
#define ISEQ_TYPE_ONCE_GUARD ISEQ_TYPE_DEFINED_GUARD
#define FIXNUM_INC(n, i) ((n)+(INT2FIX(i)&~FIXNUM_FLAG))
@@ -6582,7 +6579,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int popp
case NODE_DSYM:{
compile_dstr(iseq, ret, node);
if (!popped) {
- ADD_INSN1(ret, line, opt_call_c_function, rb_vm_str_intern);
+ ADD_INSN(ret, line, intern);
}
else {
ADD_INSN(ret, line, pop);
diff --git a/insns.def b/insns.def
index 1b069ce37d..bd47c2c0b0 100644
--- a/insns.def
+++ b/insns.def
@@ -400,6 +400,20 @@ toregexp
/**
@c put
+ @e intern str to Symbol and push it.
+ @j 文字列 str をシンボルに変換してスタックにプッシュする。
+ */
+DEFINE_INSN
+intern
+()
+(VALUE str)
+(VALUE sym)
+{
+ sym = rb_str_intern(str);
+}
+
+/**
+ @c put
@e put new array initialized with num values on the stack.
@j 新しい配列をスタック上の num 個の値で初期化して生成しプッシュする。
*/
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index d11529ed75..1678100eab 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -2794,13 +2794,6 @@ FUNC_FASTCALL(rb_vm_opt_struct_aset)(rb_thread_t *th, rb_control_frame_t *reg_cf
return reg_cfp;
}
-rb_control_frame_t *
-FUNC_FASTCALL(rb_vm_str_intern)(rb_thread_t *th, rb_control_frame_t *reg_cfp)
-{
- TOPN(0) = rb_str_intern(TOPN(0));
- return reg_cfp;
-}
-
/* defined insn */
static enum defined_type