ruby-changes:37841
From: ko1 <ko1@a...>
Date: Wed, 11 Mar 2015 03:50:27 +0900 (JST)
Subject: [ruby-changes:37841] ko1:r49922 (trunk): * proc.c: use RUBY_VM_IFUNC_P() to recognize IFUNC or not.
ko1 2015-03-11 03:50:15 +0900 (Wed, 11 Mar 2015) New Revision: 49922 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49922 Log: * proc.c: use RUBY_VM_IFUNC_P() to recognize IFUNC or not. * vm.c: ditto. * vm_dump.c: ditto. * vm_insnhelper.c: ditto. * vm_core.h: use RB_TYPE_P() instead of BUILTIN_TYPE(). Modified files: trunk/ChangeLog trunk/proc.c trunk/vm.c trunk/vm_core.h trunk/vm_dump.c trunk/vm_insnhelper.c Index: ChangeLog =================================================================== --- ChangeLog (revision 49921) +++ ChangeLog (revision 49922) @@ -1,3 +1,15 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Mar 11 03:48:01 2015 Koichi Sasada <ko1@a...> + + * proc.c: use RUBY_VM_IFUNC_P() to recognize IFUNC or not. + + * vm.c: ditto. + + * vm_dump.c: ditto. + + * vm_insnhelper.c: ditto. + + * vm_core.h: use RB_TYPE_P() instead of BUILTIN_TYPE(). + Wed Mar 11 03:21:37 2015 Koichi Sasada <ko1@a...> * vm_insnhelper.h: define struct THROW_DATA to represent Index: vm_core.h =================================================================== --- vm_core.h (revision 49921) +++ vm_core.h (revision 49922) @@ -910,7 +910,7 @@ rb_block_t *rb_vm_control_frame_block_pt https://github.com/ruby/ruby/blob/trunk/vm_core.h#L910 #define RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, cfp) \ (!RUBY_VM_VALID_CONTROL_FRAME_P((cfp), RUBY_VM_END_CONTROL_FRAME(th))) -#define RUBY_VM_IFUNC_P(ptr) (BUILTIN_TYPE(ptr) == T_NODE) +#define RUBY_VM_IFUNC_P(ptr) RB_TYPE_P((VALUE)(ptr), T_NODE) #define RUBY_VM_NORMAL_ISEQ_P(ptr) \ ((ptr) && !RUBY_VM_IFUNC_P(ptr)) Index: proc.c =================================================================== --- proc.c (revision 49921) +++ proc.c (revision 49922) @@ -722,7 +722,7 @@ proc_call(int argc, VALUE *argv, VALUE p https://github.com/ruby/ruby/blob/trunk/proc.c#L722 GetProcPtr(procval, proc); iseq = proc->block.iseq; - if (BUILTIN_TYPE(iseq) == T_NODE || iseq->param.flags.has_block) { + if (RUBY_VM_IFUNC_P(iseq) || iseq->param.flags.has_block) { if (rb_block_given_p()) { rb_proc_t *passed_proc; RB_GC_GUARD(passed_procval) = rb_block_proc(); @@ -846,7 +846,7 @@ rb_block_min_max_arity(rb_block_t *block https://github.com/ruby/ruby/blob/trunk/proc.c#L846 { rb_iseq_t *iseq = block->iseq; if (iseq) { - if (BUILTIN_TYPE(iseq) != T_NODE) { + if (!RUBY_VM_IFUNC_P(iseq)) { return rb_iseq_min_max_arity(iseq, max); } else { @@ -1685,7 +1685,7 @@ rb_mod_define_method(int argc, VALUE *ar https://github.com/ruby/ruby/blob/trunk/proc.c#L1685 rb_proc_t *proc; body = proc_dup(body); GetProcPtr(body, proc); - if (BUILTIN_TYPE(proc->block.iseq) != T_NODE) { + if (!RUBY_VM_IFUNC_P(proc->block.iseq)) { proc->block.iseq->defined_method_id = id; RB_OBJ_WRITE(proc->block.iseq->self, &proc->block.iseq->klass, mod); proc->is_lambda = TRUE; @@ -2464,7 +2464,7 @@ proc_binding(VALUE self) https://github.com/ruby/ruby/blob/trunk/proc.c#L2464 GetProcPtr(self, proc); iseq = proc->block.iseq; - if (RB_TYPE_P((VALUE)iseq, T_NODE)) { + if (RUBY_VM_IFUNC_P(iseq)) { if (!IS_METHOD_PROC_NODE((NODE *)iseq)) { rb_raise(rb_eArgError, "Can't create Binding from C level Proc"); } Index: vm.c =================================================================== --- vm.c (revision 49921) +++ vm.c (revision 49922) @@ -413,7 +413,7 @@ env_mark(void * const ptr) https://github.com/ruby/ruby/blob/trunk/vm.c#L413 RUBY_MARK_UNLESS_NULL(env->block.proc); if (env->block.iseq) { - if (BUILTIN_TYPE(env->block.iseq) == T_NODE) { + if (RUBY_VM_IFUNC_P(env->block.iseq)) { RUBY_MARK_UNLESS_NULL((VALUE)env->block.iseq); } else { @@ -801,7 +801,7 @@ invoke_block_from_c(rb_thread_t *th, con https://github.com/ruby/ruby/blob/trunk/vm.c#L801 if (SPECIAL_CONST_P(block->iseq)) { return Qnil; } - else if (BUILTIN_TYPE(block->iseq) != T_NODE) { + else if (!RUBY_VM_IFUNC_P(block->iseq)) { VALUE ret; const rb_iseq_t *iseq = block->iseq; const rb_control_frame_t *cfp; Index: vm_dump.c =================================================================== --- vm_dump.c (revision 49921) +++ vm_dump.c (revision 49922) @@ -36,7 +36,7 @@ control_frame_dump(rb_thread_t *th, rb_c https://github.com/ruby/ruby/blob/trunk/vm_dump.c#L36 const char *magic, *iseq_name = "-", *selfstr = "-", *biseq_name = "-"; VALUE tmp; - if (cfp->block_iseq != 0 && BUILTIN_TYPE(cfp->block_iseq) != T_NODE) { + if (cfp->block_iseq != 0 && !RUBY_VM_IFUNC_P(cfp->block_iseq)) { biseq_name = ""; /* RSTRING(cfp->block_iseq->location.label)->ptr; */ } Index: vm_insnhelper.c =================================================================== --- vm_insnhelper.c (revision 49921) +++ vm_insnhelper.c (revision 49922) @@ -2110,7 +2110,7 @@ vm_invoke_block(rb_thread_t *th, rb_cont https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2110 } iseq = block->iseq; - if (BUILTIN_TYPE(iseq) != T_NODE) { + if (!RUBY_VM_IFUNC_P(iseq)) { int opt_pc; const int arg_size = iseq->param.size; int is_lambda = block_proc_is_lambda(block->proc); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/