From ae166317a4cceeaa195760f675f89a4afec0feee Mon Sep 17 00:00:00 2001 From: ko1 Date: Sun, 8 Mar 2015 19:50:37 +0000 Subject: * internal.h: define CREF accessor macros. * CREF_CLASS(cref) * CREF_NEXT(cref) * CREF_VISI(cref) * CREF_VISI_SET(cref, v) * CREF_REFINEMENTS(cref) * CREF_PUSHED_BY_EVAL(cref) * CREF_PUSHED_BY_EVAL_SET(cref) * CREF_OMOD_SHARED(cref) * CREF_OMOD_SHARED_SET(cref) * CREF_OMOD_SHARED_UNSET(cref) This is process to change CREF data type from NODE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'vm.c') diff --git a/vm.c b/vm.c index cc9acbcb7d..0f7f98bdec 100644 --- a/vm.c +++ b/vm.c @@ -83,9 +83,9 @@ static NODE * vm_cref_new(VALUE klass, long visi, NODE *prev_cref) { NODE *cref = NEW_CREF(klass); - cref->nd_refinements = Qnil; - cref->nd_visi = visi; - cref->nd_next = prev_cref; + CREF_REFINEMENTS(cref) = Qnil; + CREF_VISI_SET(cref, visi); + CREF_NEXT(cref) = prev_cref; return cref; } @@ -107,8 +107,8 @@ vm_cref_dump(const char *mesg, const NODE *cref) fprintf(stderr, "vm_cref_dump: %s (%p)\n", mesg, cref); while (cref) { - fprintf(stderr, "= cref| klass: %s\n", RSTRING_PTR(rb_class_path(cref->nd_clss))); - cref = cref->nd_next; + fprintf(stderr, "= cref| klass: %s\n", RSTRING_PTR(rb_class_path(CREF_CLASS(cref)))); + cref = CREF_NEXT(cref); } } @@ -1060,7 +1060,7 @@ rb_vm_cref_in_context(VALUE self, VALUE cbase) const NODE *cref; if (cfp->self != self) return NULL; cref = rb_vm_get_cref(cfp->ep); - if (cref->nd_clss != cbase) return NULL; + if (CREF_CLASS(cref) != cbase) return NULL; return cref; } @@ -1069,9 +1069,9 @@ void debug_cref(NODE *cref) { while (cref) { - dp(cref->nd_clss); - printf("%ld\n", cref->nd_visi); - cref = cref->nd_next; + dp(CREF_CLASS(cref)); + printf("%ld\n", CREF_VISI(cref)); + cref = CREF_NEXT(cref); } } #endif @@ -2266,8 +2266,8 @@ static void vm_define_method(rb_thread_t *th, VALUE obj, ID id, VALUE iseqval, rb_num_t is_singleton, NODE *cref) { - VALUE klass = cref->nd_clss; - int noex = (int)cref->nd_visi; + VALUE klass = CREF_CLASS(cref); + int noex = CREF_VISI(cref); rb_iseq_t *miseq; GetISeqPtr(iseqval, miseq); -- cgit v1.2.3