summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-03 02:43:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-03 02:43:20 +0000
commitc0bf2c5efec6e5c94236ca24cd35de5869ed7216 (patch)
tree2e90248c9c584d266fd13702310987c64a123136
parent337fafc64147d32cce5c509f8c841b4e5e846d60 (diff)
vm_core.h: update for OPT_CALL_CFUNC_WITHOUT_FRAME
* vm_eval.c (vm_call0_cfunc): update invoker arguments. * vm_insnhelper.c (vm_call_cfunc_latter): ditto. * vm_insnhelper.c (rb_vm_call_cfunc_push_frame): ditto, and prefix with rb_. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog9
-rw-r--r--vm_core.h4
-rw-r--r--vm_eval.c4
-rw-r--r--vm_insnhelper.c7
4 files changed, 18 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index d251789656..0bc4decfb7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Fri Apr 3 11:43:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (vm_call0_cfunc): update invoker arguments.
+
+ * vm_insnhelper.c (vm_call_cfunc_latter): ditto.
+
+ * vm_insnhelper.c (rb_vm_call_cfunc_push_frame): ditto, and prefix
+ with rb_.
+
Thu Apr 2 16:26:59 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* common.mk, tool/mkconfig.rb: check the running ruby version in
diff --git a/vm_core.h b/vm_core.h
index 25a5e8fbf6..7c775d8019 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -1035,8 +1035,8 @@ GET_THREAD(void)
rb_thread_t *th = ruby_current_thread;
#if OPT_CALL_CFUNC_WITHOUT_FRAME
if (UNLIKELY(th->passed_ci != 0)) {
- void vm_call_cfunc_push_frame(rb_thread_t *th);
- vm_call_cfunc_push_frame(th);
+ void rb_vm_call_cfunc_push_frame(rb_thread_t *th);
+ rb_vm_call_cfunc_push_frame(th);
}
#endif
return th;
diff --git a/vm_eval.c b/vm_eval.c
index ae2c9ca0a7..b63eec262e 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -71,13 +71,15 @@ vm_call0_cfunc(rb_thread_t* th, rb_call_info_t *ci, const VALUE *argv)
const rb_method_entry_t *me = ci->me;
const rb_method_cfunc_t *cfunc = &me->def->body.cfunc;
int len = cfunc->argc;
+ VALUE recv = ci->recv;
+ int argc = ci->argc;
if (len >= 0) rb_check_arity(ci->argc, len, len);
th->passed_ci = ci;
ci->aux.inc_sp = 0;
VM_PROFILE_UP(2);
- val = (*cfunc->invoker)(cfunc->func, ci, argv);
+ val = (*cfunc->invoker)(cfunc->func, recv, argc, argv);
if (reg_cfp == th->cfp) {
if (UNLIKELY(th->passed_ci != ci)) {
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 0bede8f8ac..365a8bf773 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1436,13 +1436,14 @@ vm_call_cfunc_latter(rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_info_
VALUE val;
int argc = ci->argc;
VALUE *argv = STACK_ADDR_FROM_TOP(argc);
+ VALUE recv = ci->recv;
const rb_method_cfunc_t *cfunc = vm_method_cfunc_entry(ci->me);
th->passed_ci = ci;
reg_cfp->sp -= argc + 1;
ci->aux.inc_sp = argc + 1;
VM_PROFILE_UP(0);
- val = (*cfunc->invoker)(cfunc->func, ci, argv);
+ val = (*cfunc->invoker)(cfunc->func, recv, argc, argv);
/* check */
if (reg_cfp == th->cfp) { /* no frame push */
@@ -1490,7 +1491,7 @@ vm_call_cfunc(rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_info_t *ci)
}
void
-vm_call_cfunc_push_frame(rb_thread_t *th)
+rb_vm_call_cfunc_push_frame(rb_thread_t *th)
{
rb_call_info_t *ci = th->passed_ci;
const rb_method_entry_t *me = ci->me;
@@ -1498,7 +1499,7 @@ vm_call_cfunc_push_frame(rb_thread_t *th)
vm_push_frame(th, 0, VM_FRAME_MAGIC_CFUNC, ci->recv, ci->defined_class,
VM_ENVVAL_BLOCK_PTR(ci->blockptr), NULL /* cref */,
- 0, th->cfp->sp + ci->aux.inc_sp, 1, me);
+ 0, th->cfp->sp + ci->aux.inc_sp, 1, me, 0);
if (ci->call != vm_call_general) {
ci->call = vm_call_cfunc_with_frame;