[前][次][番号順一覧][スレッド一覧]

ruby-changes:38073

From: nobu <ko1@a...>
Date: Fri, 3 Apr 2015 11:43:40 +0900 (JST)
Subject: [ruby-changes:38073] nobu:r50154 (trunk): vm_core.h: update for OPT_CALL_CFUNC_WITHOUT_FRAME

nobu	2015-04-03 11:43:20 +0900 (Fri, 03 Apr 2015)

  New Revision: 50154

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50154

  Log:
    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_.

  Modified files:
    trunk/ChangeLog
    trunk/vm_core.h
    trunk/vm_eval.c
    trunk/vm_insnhelper.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 50153)
+++ ChangeLog	(revision 50154)
@@ -1,3 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Apr  3 11:43:17 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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@r...>
 
 	* common.mk, tool/mkconfig.rb: check the running ruby version in
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 50153)
+++ vm_core.h	(revision 50154)
@@ -1035,8 +1035,8 @@ GET_THREAD(void) https://github.com/ruby/ruby/blob/trunk/vm_core.h#L1035
     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;
Index: vm_eval.c
===================================================================
--- vm_eval.c	(revision 50153)
+++ vm_eval.c	(revision 50154)
@@ -71,13 +71,15 @@ vm_call0_cfunc(rb_thread_t* th, rb_call_ https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L71
 	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)) {
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 50153)
+++ vm_insnhelper.c	(revision 50154)
@@ -1436,13 +1436,14 @@ vm_call_cfunc_latter(rb_thread_t *th, rb https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1436
     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_contro https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1491
 }
 
 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 https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1499
 
     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;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]