diff options
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | proc.c | 8 | ||||
-rw-r--r-- | vm.c | 4 | ||||
-rw-r--r-- | vm_core.h | 2 | ||||
-rw-r--r-- | vm_dump.c | 2 | ||||
-rw-r--r-- | vm_insnhelper.c | 2 |
6 files changed, 21 insertions, 9 deletions
@@ -1,3 +1,15 @@ +Wed Mar 11 03:48:01 2015 Koichi Sasada <ko1@atdot.net> + + * 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@atdot.net> * vm_insnhelper.h: define struct THROW_DATA to represent @@ -722,7 +722,7 @@ proc_call(int argc, VALUE *argv, VALUE procval) 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, int *max) { 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 *argv, VALUE mod) 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) 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"); } @@ -413,7 +413,7 @@ env_mark(void * const ptr) 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, const rb_block_t *block, 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; @@ -910,7 +910,7 @@ rb_block_t *rb_vm_control_frame_block_ptr(const rb_control_frame_t *cfp); #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)) @@ -36,7 +36,7 @@ control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp) 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; */ } diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 8b907bfc35..ada648e75f 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -2110,7 +2110,7 @@ vm_invoke_block(rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_info_t *ci } 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); |