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

ruby-changes:48354

From: ko1 <ko1@a...>
Date: Fri, 27 Oct 2017 11:49:36 +0900 (JST)
Subject: [ruby-changes:48354] ko1:r60468 (trunk): `vm_call_handler` and related functions accept `ec` instead of `th`.

ko1	2017-10-27 11:49:30 +0900 (Fri, 27 Oct 2017)

  New Revision: 60468

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

  Log:
    `vm_call_handler` and related functions accept `ec` instead of `th`.
    
    * vm_core.h (vm_call_handler): fix to accept `ec` instead of `th`.
    
    * vm_args.c: the following functions accept `ec` instead of `th`.
      * raise_argument_error
      * argument_arity_error
      * argument_kw_error
      * setup_parameters_complex
    
    * vm_eval.c: ditto.
      * vm_call0
      * vm_call0_cfunc_with_frame
      * vm_call0_cfunc
      * vm_call0_body
    
    * vm_insnhelper.c: ditto
      * vm_call_iseq_setup_tailcall_0start
      * vm_call_iseq_setup_normal_0start
      * vm_callee_setup_arg
      * vm_call_iseq_setup
      * vm_call_iseq_setup_2
      * vm_call_iseq_setup_normal
      * vm_call_iseq_setup_tailcall
      * vm_cfp_consistent_p
      * vm_call_cfunc_with_frame
      * vm_call_cfunc
      * vm_call_ivar
      * vm_call_attrset
      * vm_call_bmethod_body
      * vm_call_bmethod
      * vm_call_opt_send
      * vm_call_opt_call
      * vm_call_method_missing
      * vm_call_zsuper
      * current_method_entry
      * vm_call_method_each_type
      * vm_call_method_nome
      * vm_call_method
      * vm_call_general
      * vm_call_super_method
    
    * tool/mk_call_iseq_optimized.rb: ditto.

  Modified files:
    trunk/tool/mk_call_iseq_optimized.rb
    trunk/vm_args.c
    trunk/vm_core.h
    trunk/vm_eval.c
    trunk/vm_insnhelper.c
    trunk/vm_insnhelper.h
    trunk/vm_method.c
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 60467)
+++ vm_core.h	(revision 60468)
@@ -233,7 +233,8 @@ struct rb_calling_info { https://github.com/ruby/ruby/blob/trunk/vm_core.h#L233
 };
 
 struct rb_call_cache;
-typedef VALUE (*vm_call_handler)(struct rb_thread_struct *th, struct rb_control_frame_struct *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc);
+struct rb_execution_context_struct;
+typedef VALUE (*vm_call_handler)(struct rb_execution_context_struct *ec, struct rb_control_frame_struct *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc);
 
 struct rb_call_cache {
     /* inline cache: keys */
Index: vm_eval.c
===================================================================
--- vm_eval.c	(revision 60467)
+++ vm_eval.c	(revision 60468)
@@ -36,11 +36,10 @@ typedef enum call_type { https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L36
 } call_type;
 
 static VALUE send_internal(int argc, const VALUE *argv, VALUE recv, call_type scope);
-
-static VALUE vm_call0_body(rb_thread_t* th, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc, const VALUE *argv);
+static VALUE vm_call0_body(rb_execution_context_t* ec, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc, const VALUE *argv);
 
 static VALUE
-vm_call0(rb_thread_t* th, VALUE recv, ID id, int argc, const VALUE *argv, const rb_callable_method_entry_t *me)
+vm_call0(rb_execution_context_t *ec, VALUE recv, ID id, int argc, const VALUE *argv, const rb_callable_method_entry_t *me)
 {
     struct rb_calling_info calling_entry, *calling;
     struct rb_call_info ci_entry;
@@ -56,11 +55,11 @@ vm_call0(rb_thread_t* th, VALUE recv, ID https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L55
     calling->recv = recv;
     calling->argc = argc;
 
-    return vm_call0_body(th, calling, &ci_entry, &cc_entry, argv);
+    return vm_call0_body(ec, calling, &ci_entry, &cc_entry, argv);
 }
 
 static VALUE
-vm_call0_cfunc_with_frame(rb_thread_t* th, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc, const VALUE *argv)
+vm_call0_cfunc_with_frame(rb_execution_context_t* ec, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc, const VALUE *argv)
 {
     VALUE val;
     const rb_callable_method_entry_t *me = cc->me;
@@ -71,12 +70,12 @@ vm_call0_cfunc_with_frame(rb_thread_t* t https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L70
     ID mid = ci->mid;
     VALUE block_handler = calling->block_handler;
 
-    RUBY_DTRACE_CMETHOD_ENTRY_HOOK(th, me->owner, me->def->original_id);
-    EXEC_EVENT_HOOK(th, RUBY_EVENT_C_CALL, recv, me->def->original_id, mid, me->owner, Qnil);
+    RUBY_DTRACE_CMETHOD_ENTRY_HOOK(rb_ec_thread_ptr(ec), me->owner, me->def->original_id);
+    EXEC_EVENT_HOOK(rb_ec_thread_ptr(ec), RUBY_EVENT_C_CALL, recv, me->def->original_id, mid, me->owner, Qnil);
     {
-	rb_control_frame_t *reg_cfp = th->ec->cfp;
+	rb_control_frame_t *reg_cfp = ec->cfp;
 
-	vm_push_frame(th->ec, 0, VM_FRAME_MAGIC_CFUNC | VM_FRAME_FLAG_CFRAME | VM_ENV_FLAG_LOCAL, recv,
+	vm_push_frame(ec, 0, VM_FRAME_MAGIC_CFUNC | VM_FRAME_FLAG_CFRAME | VM_ENV_FLAG_LOCAL, recv,
 		      block_handler, (VALUE)me,
 		      0, reg_cfp->sp, 0, 0);
 
@@ -87,33 +86,33 @@ vm_call0_cfunc_with_frame(rb_thread_t* t https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L86
 
 	CHECK_CFP_CONSISTENCY("vm_call0_cfunc_with_frame");
 	VM_PROFILE_UP(C2C_POPF);
-	rb_vm_pop_frame(th->ec);
+	rb_vm_pop_frame(ec);
     }
-    EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, recv, me->def->original_id, mid, me->owner, val);
-    RUBY_DTRACE_CMETHOD_RETURN_HOOK(th, me->owner, me->def->original_id);
+    EXEC_EVENT_HOOK(rb_ec_thread_ptr(ec), RUBY_EVENT_C_RETURN, recv, me->def->original_id, mid, me->owner, val);
+    RUBY_DTRACE_CMETHOD_RETURN_HOOK(rb_ec_thread_ptr(ec), me->owner, me->def->original_id);
 
     return val;
 }
 
 static VALUE
-vm_call0_cfunc(rb_thread_t* th, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc, const VALUE *argv)
+vm_call0_cfunc(rb_execution_context_t *ec, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc, const VALUE *argv)
 {
-    return vm_call0_cfunc_with_frame(th, calling, ci, cc, argv);
+    return vm_call0_cfunc_with_frame(ec, calling, ci, cc, argv);
 }
 
 /* `ci' should point temporal value (on stack value) */
 static VALUE
-vm_call0_body(rb_thread_t* th, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc, const VALUE *argv)
+vm_call0_body(rb_execution_context_t *ec, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc, const VALUE *argv)
 {
     VALUE ret;
 
-    calling->block_handler = vm_passed_block_handler(th);
+    calling->block_handler = vm_passed_block_handler(rb_ec_thread_ptr(ec));
 
   again:
     switch (cc->me->def->type) {
       case VM_METHOD_TYPE_ISEQ:
 	{
-	    rb_control_frame_t *reg_cfp = th->ec->cfp;
+	    rb_control_frame_t *reg_cfp = ec->cfp;
 	    int i;
 
 	    CHECK_VM_STACK_OVERFLOW(reg_cfp, calling->argc + 1);
@@ -123,13 +122,13 @@ vm_call0_body(rb_thread_t* th, struct rb https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L122
 		*reg_cfp->sp++ = argv[i];
 	    }
 
-	    vm_call_iseq_setup(th, reg_cfp, calling, ci, cc);
-	    VM_ENV_FLAGS_SET(th->ec->cfp->ep, VM_FRAME_FLAG_FINISH);
-	    return vm_exec(th); /* CHECK_INTS in this function */
+	    vm_call_iseq_setup(ec, reg_cfp, calling, ci, cc);
+	    VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);
+	    return vm_exec(rb_ec_thread_ptr(ec)); /* CHECK_INTS in this function */
 	}
       case VM_METHOD_TYPE_NOTIMPLEMENTED:
       case VM_METHOD_TYPE_CFUNC:
-	ret = vm_call0_cfunc(th, calling, ci, cc, argv);
+	ret = vm_call0_cfunc(ec, calling, ci, cc, argv);
 	goto success;
       case VM_METHOD_TYPE_ATTRSET:
 	rb_check_arity(calling->argc, 1, 1);
@@ -140,7 +139,7 @@ vm_call0_body(rb_thread_t* th, struct rb https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L139
 	ret = rb_attr_get(calling->recv, cc->me->def->body.attr.id);
 	goto success;
       case VM_METHOD_TYPE_BMETHOD:
-	ret = vm_call_bmethod_body(th, calling, ci, cc, argv);
+	ret = vm_call_bmethod_body(ec, calling, ci, cc, argv);
 	goto success;
       case VM_METHOD_TYPE_ZSUPER:
       case VM_METHOD_TYPE_REFINED:
@@ -163,7 +162,7 @@ vm_call0_body(rb_thread_t* th, struct rb https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L162
 		ret = method_missing(calling->recv, ci->mid, calling->argc, argv, ex);
 		goto success;
 	    }
-	    RUBY_VM_CHECK_INTS(th);
+	    RUBY_VM_CHECK_INTS(rb_ec_thread_ptr(ec));
 	    goto again;
 	}
       case VM_METHOD_TYPE_ALIAS:
@@ -171,7 +170,7 @@ vm_call0_body(rb_thread_t* th, struct rb https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L170
 	goto again;
       case VM_METHOD_TYPE_MISSING:
 	{
-	    vm_passed_block_handler_set(th, calling->block_handler);
+	    vm_passed_block_handler_set(rb_ec_thread_ptr(ec), calling->block_handler);
 	    return method_missing(calling->recv, ci->mid, calling->argc,
 				  argv, MISSING_NOENTRY);
 	}
@@ -184,7 +183,7 @@ vm_call0_body(rb_thread_t* th, struct rb https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L183
 	    {
 		rb_proc_t *proc;
 		GetProcPtr(calling->recv, proc);
-		ret = rb_vm_invoke_proc(th, proc, calling->argc, argv, calling->block_handler);
+		ret = rb_vm_invoke_proc(rb_ec_thread_ptr(ec), proc, calling->argc, argv, calling->block_handler);
 		goto success;
 	    }
 	  default:
@@ -198,14 +197,14 @@ vm_call0_body(rb_thread_t* th, struct rb https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L197
     return Qundef;
 
   success:
-    RUBY_VM_CHECK_INTS(th);
+    RUBY_VM_CHECK_INTS(rb_ec_thread_ptr(ec));
     return ret;
 }
 
 VALUE
 rb_vm_call(rb_thread_t *th, VALUE recv, VALUE id, int argc, const VALUE *argv, const rb_callable_method_entry_t *me)
 {
-    return vm_call0(th, recv, id, argc, argv, me);
+    return vm_call0(th->ec, recv, id, argc, argv, me);
 }
 
 static inline VALUE
@@ -230,7 +229,7 @@ vm_call_super(rb_thread_t *th, int argc, https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L229
 	return method_missing(recv, id, argc, argv, MISSING_SUPER);
     }
     else {
-	return vm_call0(th, recv, id, argc, argv, me);
+	return vm_call0(th->ec, recv, id, argc, argv, me);
     }
 }
 
@@ -292,7 +291,7 @@ rb_call0(VALUE recv, ID mid, int argc, c https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L291
 	return method_missing(recv, mid, argc, argv, call_status);
     }
     stack_check(th);
-    return vm_call0(th, recv, mid, argc, argv, me);
+    return vm_call0(th->ec, recv, mid, argc, argv, me);
 }
 
 struct rescue_funcall_args {
@@ -410,7 +409,7 @@ rb_check_funcall_default(VALUE recv, ID https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L409
 	return ret;
     }
     stack_check(th);
-    return vm_call0(th, recv, mid, argc, argv, me);
+    return vm_call0(th->ec, recv, mid, argc, argv, me);
 }
 
 VALUE
@@ -436,7 +435,7 @@ rb_check_funcall_with_hook(VALUE recv, I https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L435
     }
     stack_check(th);
     (*hook)(TRUE, recv, mid, argc, argv, arg);
-    return vm_call0(th, recv, mid, argc, argv, me);
+    return vm_call0(th->ec, recv, mid, argc, argv, me);
 }
 
 static const char *
@@ -726,7 +725,7 @@ method_missing(VALUE obj, ID id, int arg https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L725
     me = rb_callable_method_entry(klass, idMethodMissing);
     if (!me || METHOD_ENTRY_BASIC(me)) goto missing;
     vm_passed_block_handler_set(th, block_handler);
-    result = vm_call0(th, obj, idMethodMissing, argc, argv, me);
+    result = vm_call0(th->ec, obj, idMethodMissing, argc, argv, me);
     if (work) ALLOCV_END(work);
     return result;
 }
Index: vm_method.c
===================================================================
--- vm_method.c	(revision 60467)
+++ vm_method.c	(revision 60468)
@@ -1891,7 +1891,7 @@ call_method_entry(rb_thread_t *th, VALUE https://github.com/ruby/ruby/blob/trunk/vm_method.c#L1891
     const rb_callable_method_entry_t *cme =
 	prepare_callable_method_entry(defined_class, id, me);
     VALUE passed_block_handler = vm_passed_block_handler(th);
-    VALUE result = vm_call0(th, obj, id, argc, argv, cme);
+    VALUE result = vm_call0(th->ec, obj, id, argc, argv, cme);
     vm_passed_block_handler_set(th, passed_block_handler);
     return result;
 }
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 60467)
+++ vm_insnhelper.c	(revision 60468)
@@ -1296,7 +1296,7 @@ vm_expandarray(rb_control_frame_t *cfp, https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1296
     RB_GC_GUARD(ary);
 }
 
-static VALUE vm_call_general(rb_thread_t *th, rb_control_frame_t *reg_cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc);
+static VALUE vm_call_general(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc);
 
 static void
 vm_search_method(const struct rb_call_info *ci, struct rb_call_cache *cc, VALUE recv)
@@ -1461,7 +1461,7 @@ rb_eql_opt(VALUE obj1, VALUE obj2) https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1461
     return opt_eql_func(obj1, obj2, &ci, &cc);
 }
 
-static VALUE vm_call0(rb_thread_t*, VALUE, ID, int, const VALUE*, const rb_callable_method_entry_t *);
+static VALUE vm_call0(rb_execution_context_t *ec, VALUE, ID, int, const VALUE*, const rb_callable_method_entry_t *);
 
 static VALUE
 check_match(VALUE pattern, VALUE target, enum vm_check_match_type type)
@@ -1478,7 +1478,7 @@ check_match(VALUE pattern, VALUE target, https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1478
 	const rb_callable_method_entry_t *me =
 	    rb_callable_method_entry_with_refinements(CLASS_OF(pattern), idEqq, NULL);
 	if (me) {
-	    return vm_call0(GET_THREAD(), pattern, idEqq, 1, &target, me);
+	    return vm_call0(GET_EC(), pattern, idEqq, 1, &target, me);
 	}
 	else {
 	    /* fallback to funcall (e.g. method_missing) */
@@ -1555,13 +1555,13 @@ vm_base_ptr(const rb_control_frame_t *cf https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1555
 
 #include "vm_args.c"
 
-static inline VALUE vm_call_iseq_setup_2(rb_thread_t *th, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc, int opt_pc, int param_size, int local_size);
-static inline VALUE vm_call_iseq_setup_normal(rb_thread_t *th, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc, int opt_pc, int param_size, int local_size);
-static inline VALUE vm_call_iseq_setup_tailcall(rb_thread_t *th, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc, int opt_pc);
-static VALUE vm_call_super_method(rb_thread_t *th, rb_control_frame_t *reg_cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc);
-static VALUE vm_call_method_nome(rb_thread_t *th, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc);
-static VALUE vm_call_method_each_type(rb_thread_t *th, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc);
-static inline VALUE vm_call_method(rb_thread_t *th, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc);
+static inline VALUE vm_call_iseq_setup_2(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc, int opt_pc, int param_size, int local_size);
+static inline VALUE vm_call_iseq_setup_normal(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc, int opt_pc, int param_size, int local_size);
+static inline VALUE vm_call_iseq_setup_tailcall(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc, int opt_pc);
+static VALUE vm_call_super_method(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc);
+static VALUE vm_call_method_nome(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc);
+static VALUE vm_call_method_each_type(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc);
+static inline VALUE vm_call_method(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc);
 
 static vm_call_handler vm_call_iseq_setup_func(const struct rb_call_info *ci, const int param_size, const int local_size);
 
@@ -1579,18 +1579,18 @@ def_iseq_ptr(rb_method_definition_t *def https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1579
 }
 
 static VALUE
-vm_call_iseq_setup_tailcall_0start(rb_thread_t *th, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc)
+vm_call_iseq_setup_tailcall_0start(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc)
 {
-    return vm_call_iseq_setup_tailcall(th, cfp, calling, ci, cc, 0);
+    return vm_call_iseq_setup_tailcall(ec, cfp, calling, ci, cc, 0);
 }
 
 static VALUE
-vm_call_iseq_setup_normal_0start(rb_thread_t *th, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc)
+vm_call_iseq_setup_normal_0start(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc)
 {
     const rb_iseq_t *iseq = def_iseq_ptr(cc->me->def);
     int param = iseq->body->param.size;
     int local = iseq->body->local_table_size;
-    return vm_call_iseq_setup_normal(th, cfp, calling, ci, cc, 0, param, local);
+    return vm_call_iseq_setup_normal(ec, cfp, calling, ci, cc, 0, param, local);
 }
 
 static inline int
@@ -1605,16 +1605,16 @@ simple_iseq_p(const rb_iseq_t *iseq) https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1605
 }
 
 static inline int
-vm_callee_setup_arg(rb_thread_t *th, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc,
+vm_callee_setup_arg(rb_execution_context_t *ec, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc,
 		    const rb_iseq_t *iseq, VALUE *argv, int param_size, int local_size)
 {
     if (LIKELY(simple_iseq_p(iseq) && !(ci->flag & VM_CALL_KW_SPLAT))) {
-	rb_control_frame_t *cfp = th->ec->cfp;
+	rb_control_frame_t *cfp = ec->cfp;
 
 	CALLER_SETUP_ARG(cfp, calling, ci); /* splat arg */
 
 	if (calling->argc != iseq->body->param.lead_num) {
-	    argument_arity_error(th, iseq, calling->argc, iseq->body->param.lead_num, iseq->body->param.lead_num);
+	    argument_arity_error(ec, iseq, calling->argc, iseq->body->param.lead_num, iseq->body->param.lead_num);
 	}
 
 	CI_SET_FASTPATH(cc, vm_call_iseq_setup_func(ci, param_size, local_size),
@@ -1623,34 +1623,34 @@ vm_callee_setup_arg(rb_thread_t *th, str https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1623
 	return 0;
     }
     else {
-	return setup_parameters_complex(th, iseq, calling, ci, argv, arg_setup_method);
+	return setup_parameters_complex(ec, iseq, calling, ci, argv, arg_setup_method);
     }
 }
 
 static VALUE
-vm_call_iseq_setup(rb_thread_t *th, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc)
+vm_call_iseq_setup(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc)
 {
     const rb_iseq_t *iseq = def_iseq_ptr(cc->me->def);
     const int param_size = iseq->body->param.size;
     const int local_size = iseq->body->local_table_size;
-    const int opt_pc = vm_callee_setup_arg(th, calling, ci, cc, def_iseq_ptr(cc->me->def), cfp->sp - calling->argc, param_size, local_size);
-    return vm_call_iseq_setup_2(th, cfp, calling, ci, cc, opt_pc, param_size, local_size);
+    const int opt_pc = vm_callee_setup_arg(ec, calling, ci, cc, def_iseq_ptr(cc->me->def), cfp->sp - calling->argc, param_size, local_size);
+    return vm_call_iseq_setup_2(ec, cfp, calling, ci, cc, opt_pc, param_size, local_size);
 }
 
 static inline VALUE
-vm_call_iseq_setup_2(rb_thread_t *th, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc,
+vm_call_iseq_setup_2(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc,
 		     int opt_pc, int param_size, int local_size)
 {
     if (LIKELY(!(ci->flag & VM_CALL_TAILCALL))) {
-	return vm_call_iseq_setup_normal(th, cfp, calling, ci, cc, opt_pc, param_size, local_size);
+	return vm_call_iseq_setup_normal(ec, cfp, calling, ci, cc, opt_pc, param_size, local_size);
     }
     else {
-	return vm_call_iseq_setup_tailcall(th, cfp, calling, ci, cc, opt_pc);
+	return vm_call_iseq_setup_tailcall(ec, cfp, calling, ci, cc, opt_pc);
     }
 }
 
 static inline VALUE
-vm_call_iseq_setup_normal(rb_thread_t *th, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc,
+vm_call_iseq_setup_norm (... truncated)

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

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