summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-06-16 18:44:58 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-06-16 18:44:58 +0900
commit318d52e820c9ed1bc4c12aa97af49a89953649bc (patch)
treecbeaa0c9945d67a0e2d62faa35a4cc24afcff346 /compile.c
parent26c179d7e7e7ae0eb21050659c3e8778358230ab (diff)
Revert "Replaced accessors of `Struct` with `invokebuiltin`"
This reverts commit 19cabe8b09d92d033c244f32ff622b8e513375f1, which didn't support tool/lib/iseq_loader_checker.rb.
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/compile.c b/compile.c
index f522954fb8..9fba24f0fa 100644
--- a/compile.c
+++ b/compile.c
@@ -9681,19 +9681,19 @@ caller_location(VALUE *path, VALUE *realpath)
typedef struct {
VALUE arg;
- VALUE func;
+ rb_insn_func_t func;
int line;
} accessor_args;
static const rb_iseq_t *
-method_for_self(VALUE name, VALUE arg, const struct rb_builtin_function *func,
+method_for_self(VALUE name, VALUE arg, rb_insn_func_t func,
void (*build)(rb_iseq_t *, LINK_ANCHOR *, const void *))
{
VALUE path, realpath;
accessor_args acc;
acc.arg = arg;
- acc.func = (VALUE)func;
+ acc.func = func;
acc.line = caller_location(&path, &realpath);
struct rb_iseq_new_with_callback_callback_func *ifunc =
rb_iseq_new_with_callback_new_callback(build, &acc);
@@ -9714,7 +9714,7 @@ for_self_aref(rb_iseq_t *iseq, LINK_ANCHOR *ret, const void *a)
body->param.size = 0;
ADD_INSN1(ret, line, putobject, args->arg);
- ADD_INSN1(ret, line, invokebuiltin, args->func);
+ ADD_INSN1(ret, line, opt_call_c_function, (VALUE)args->func);
}
static void
@@ -9731,23 +9731,24 @@ for_self_aset(rb_iseq_t *iseq, LINK_ANCHOR *ret, const void *a)
ADD_GETLOCAL(ret, line, numberof(vars)-1, 0);
ADD_INSN1(ret, line, putobject, args->arg);
- ADD_INSN1(ret, line, invokebuiltin, args->func);
+ ADD_INSN1(ret, line, opt_call_c_function, (VALUE)args->func);
+ ADD_INSN(ret, line, pop);
}
/*
* func (index) -> (value)
*/
const rb_iseq_t *
-rb_method_for_self_aref(VALUE name, VALUE arg, const struct rb_builtin_function *func)
+rb_method_for_self_aref(VALUE name, VALUE arg, rb_insn_func_t func)
{
return method_for_self(name, arg, func, for_self_aref);
}
/*
- * func (index, value) -> (value)
+ * func (index, value) -> (index, value)
*/
const rb_iseq_t *
-rb_method_for_self_aset(VALUE name, VALUE arg, const struct rb_builtin_function *func)
+rb_method_for_self_aset(VALUE name, VALUE arg, rb_insn_func_t func)
{
return method_for_self(name, arg, func, for_self_aset);
}