summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-08 19:50:37 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-08 19:50:37 (GMT)
commitae166317a4cceeaa195760f675f89a4afec0feee (patch)
tree2acb49ed9eb1037637b7e0b0f0ea98991a27a4ad /vm.c
parentb6d5ce7975667cc32d7d86a992d5206627e5ff73 (diff)
* 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
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/vm.c b/vm.c
index cc9acbc..0f7f98b 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);