summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog16
-rw-r--r--eval.c32
-rw-r--r--eval_intern.h6
-rw-r--r--internal.h12
-rw-r--r--node.c8
-rw-r--r--node.h12
-rw-r--r--proc.c2
-rw-r--r--vm.c22
-rw-r--r--vm_eval.c8
-rw-r--r--vm_insnhelper.c58
-rw-r--r--vm_insnhelper.h18
-rw-r--r--vm_method.c4
12 files changed, 113 insertions, 85 deletions
diff --git a/ChangeLog b/ChangeLog
index d45f02545c..bfe8e79791 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+Mon Mar 9 04:47:58 2015 Koichi Sasada <ko1@atdot.net>
+
+ * 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.
+
Sun Mar 8 22:50:57 2015 Tanaka Akira <akr@fsij.org>
* ext/zlib/zlib.c (rb_gzfile_close): Don't raise on double
diff --git a/eval.c b/eval.c
index 5b3c0936cf..7efc4c7be0 100644
--- a/eval.c
+++ b/eval.c
@@ -343,13 +343,13 @@ rb_mod_nesting(void)
VALUE ary = rb_ary_new();
const NODE *cref = rb_vm_cref();
- while (cref && cref->nd_next) {
- VALUE klass = cref->nd_clss;
- if (!(cref->flags & NODE_FL_CREF_PUSHED_BY_EVAL) &&
+ while (cref && CREF_NEXT(cref)) {
+ VALUE klass = CREF_CLASS(cref);
+ if (!CREF_PUSHED_BY_EVAL(cref) &&
!NIL_P(klass)) {
rb_ary_push(ary, klass);
}
- cref = cref->nd_next;
+ cref = CREF_NEXT(cref);
}
return ary;
}
@@ -389,15 +389,15 @@ rb_mod_s_constants(int argc, VALUE *argv, VALUE mod)
}
while (cref) {
- klass = cref->nd_clss;
- if (!(cref->flags & NODE_FL_CREF_PUSHED_BY_EVAL) &&
+ klass = CREF_CLASS(cref);
+ if (!CREF_PUSHED_BY_EVAL(cref) &&
!NIL_P(klass)) {
- data = rb_mod_const_at(cref->nd_clss, data);
+ data = rb_mod_const_at(CREF_CLASS(cref), data);
if (!cbase) {
cbase = klass;
}
}
- cref = cref->nd_next;
+ cref = CREF_NEXT(cref);
}
if (cbase) {
@@ -1160,15 +1160,15 @@ rb_using_refinement(NODE *cref, VALUE klass, VALUE module)
Check_Type(klass, T_CLASS);
Check_Type(module, T_MODULE);
- if (NIL_P(cref->nd_refinements)) {
- RB_OBJ_WRITE(cref, &cref->nd_refinements, hidden_identity_hash_new());
+ if (NIL_P(CREF_REFINEMENTS(cref))) {
+ RB_OBJ_WRITE(cref, &CREF_REFINEMENTS(cref), hidden_identity_hash_new());
}
else {
- if (cref->flags & NODE_FL_CREF_OMOD_SHARED) {
- RB_OBJ_WRITE(cref, &cref->nd_refinements, rb_hash_dup(cref->nd_refinements));
- cref->flags &= ~NODE_FL_CREF_OMOD_SHARED;
+ if (CREF_OMOD_SHARED(cref)) {
+ RB_OBJ_WRITE(cref, &CREF_REFINEMENTS(cref), rb_hash_dup(CREF_REFINEMENTS(cref)));
+ CREF_OMOD_SHARED_UNSET(cref);
}
- if (!NIL_P(c = rb_hash_lookup(cref->nd_refinements, klass))) {
+ if (!NIL_P(c = rb_hash_lookup(CREF_REFINEMENTS(cref), klass))) {
superclass = c;
while (c && RB_TYPE_P(c, T_ICLASS)) {
if (RBASIC(c)->klass == module) {
@@ -1193,7 +1193,7 @@ rb_using_refinement(NODE *cref, VALUE klass, VALUE module)
RCLASS_REFINED_CLASS(c) = klass;
module = RCLASS_SUPER(module);
}
- rb_hash_aset(cref->nd_refinements, klass, iclass);
+ rb_hash_aset(CREF_REFINEMENTS(cref), klass, iclass);
}
static int
@@ -1488,7 +1488,7 @@ top_using(VALUE self, VALUE module)
NODE *cref = rb_vm_cref();
rb_control_frame_t *prev_cfp = previous_frame(GET_THREAD());
- if (cref->nd_next || (prev_cfp && prev_cfp->me)) {
+ if (CREF_NEXT(cref) || (prev_cfp && prev_cfp->me)) {
rb_raise(rb_eRuntimeError,
"main.using is permitted only at toplevel");
}
diff --git a/eval_intern.h b/eval_intern.h
index 163eeb1a85..9e3ef45fca 100644
--- a/eval_intern.h
+++ b/eval_intern.h
@@ -210,9 +210,9 @@ enum ruby_tag_type {
#define GET_THROWOBJ_CATCH_POINT(obj) ((rb_control_frame_t*)RNODE((obj))->u2.value)
#define GET_THROWOBJ_STATE(obj) ((int)RNODE((obj))->u3.value)
-#define SCOPE_TEST(f) (rb_vm_cref()->nd_visi & (f))
-#define SCOPE_CHECK(f) (rb_vm_cref()->nd_visi == (f))
-#define SCOPE_SET(f) (rb_vm_cref()->nd_visi = (f))
+#define SCOPE_TEST(f) (CREF_VISI(rb_vm_cref()) & (f))
+#define SCOPE_CHECK(f) (CREF_VISI(rb_vm_cref()) == (f))
+#define SCOPE_SET(f) (CREF_VISI_SET(rb_vm_cref(), (f)))
void rb_thread_cleanup(void);
void rb_thread_wait_other_threads(void);
diff --git a/internal.h b/internal.h
index 6d480eee3c..016d4d4fcf 100644
--- a/internal.h
+++ b/internal.h
@@ -505,6 +505,18 @@ RCLASS_SET_SUPER(VALUE klass, VALUE super)
return super;
}
+/* CREF */
+#define CREF_CLASS(cref) ((cref)->nd_clss_)
+#define CREF_NEXT(cref) ((cref)->nd_next)
+#define CREF_VISI(cref) ((cref)->nd_visi_)
+#define CREF_VISI_SET(cref, v) ((cref)->nd_visi_ = (v))
+#define CREF_REFINEMENTS(cref) ((cref)->nd_refinements_)
+#define CREF_PUSHED_BY_EVAL(cref) ((cref)->flags & NODE_FL_CREF_PUSHED_BY_EVAL_)
+#define CREF_PUSHED_BY_EVAL_SET(cref) ((cref)->flags |= NODE_FL_CREF_PUSHED_BY_EVAL_)
+#define CREF_OMOD_SHARED(cref) ((cref)->flags & NODE_FL_CREF_OMOD_SHARED_)
+#define CREF_OMOD_SHARED_SET(cref) ((cref)->flags |= NODE_FL_CREF_OMOD_SHARED_)
+#define CREF_OMOD_SHARED_UNSET(cref) ((cref)->flags &= ~NODE_FL_CREF_OMOD_SHARED_)
+
struct vtm; /* defined by timev.h */
/* array.c */
diff --git a/node.c b/node.c
index 8e2dcdf8b7..c401100179 100644
--- a/node.c
+++ b/node.c
@@ -947,7 +947,7 @@ rb_gc_mark_node(NODE *obj)
{
switch (nd_type(obj)) {
case NODE_IF: /* 1,2,3 */
- rb_gc_mark(obj->nd_refinements); /* use as SVAR */
+ rb_gc_mark(CREF_REFINEMENTS(obj)); /* use as SVAR */
case NODE_FOR:
case NODE_ITER:
case NODE_WHEN:
@@ -1070,9 +1070,9 @@ rb_gc_mark_node(NODE *obj)
break;
case NODE_CREF:
- rb_gc_mark(obj->nd_refinements);
- rb_gc_mark(RNODE(obj)->nd_clss);
- return (VALUE)RNODE(obj)->nd_next;
+ rb_gc_mark(CREF_REFINEMENTS(obj));
+ rb_gc_mark(CREF_CLASS(obj));
+ return (VALUE)CREF_NEXT(obj);;
default: /* unlisted NODE */
rb_gc_mark_maybe(RNODE(obj)->u1.value);
diff --git a/node.h b/node.h
index e376e57bbb..f3e5c72d05 100644
--- a/node.h
+++ b/node.h
@@ -272,9 +272,9 @@ typedef struct RNode {
* 15: NODE_FL_CREF_PUSHED_BY_EVAL
* 16: NODE_FL_CREF_OMOD_SHARED
*/
-#define NODE_FL_NEWLINE (((VALUE)1)<<7)
-#define NODE_FL_CREF_PUSHED_BY_EVAL (((VALUE)1)<<15)
-#define NODE_FL_CREF_OMOD_SHARED (((VALUE)1)<<16)
+#define NODE_FL_NEWLINE (((VALUE)1)<<7)
+#define NODE_FL_CREF_PUSHED_BY_EVAL_ (((VALUE)1)<<15)
+#define NODE_FL_CREF_OMOD_SHARED_ (((VALUE)1)<<16)
#define NODE_TYPESHIFT 8
#define NODE_TYPEMASK (((VALUE)0x7f)<<NODE_TYPESHIFT)
@@ -289,7 +289,7 @@ typedef struct RNode {
#define nd_set_line(n,l) \
RNODE(n)->flags=((RNODE(n)->flags&~((VALUE)(-1)<<NODE_LSHIFT))|((VALUE)((l)&NODE_LMASK)<<NODE_LSHIFT))
-#define nd_refinements nd_reserved
+#define nd_refinements_ nd_reserved
#define nd_head u1.node
#define nd_alen u2.argc
@@ -347,7 +347,7 @@ typedef struct RNode {
#define nd_super u3.node
#define nd_modl u1.id
-#define nd_clss u1.value
+#define nd_clss_ u1.value
#define nd_beg u1.node
#define nd_end u2.node
@@ -359,7 +359,7 @@ typedef struct RNode {
#define nd_tag u1.id
#define nd_tval u2.value
-#define nd_visi u2.argc
+#define nd_visi_ u2.argc
#define NEW_NODE(t,a0,a1,a2) rb_node_newnode((t),(VALUE)(a0),(VALUE)(a1),(VALUE)(a2))
diff --git a/proc.c b/proc.c
index 6da2f547c5..b11ffa693c 100644
--- a/proc.c
+++ b/proc.c
@@ -1642,7 +1642,7 @@ rb_mod_define_method(int argc, VALUE *argv, VALUE mod)
const NODE *cref = rb_vm_cref_in_context(mod, mod);
if (cref) {
- noex = (int)cref->nd_visi;
+ noex = CREF_VISI(cref);
}
if (argc == 1) {
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);
diff --git a/vm_eval.c b/vm_eval.c
index add2aaf50a..9a97f2b805 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -1567,7 +1567,7 @@ yield_under(VALUE under, VALUE self, VALUE values)
VM_CF_LEP(th->cfp)[0] = VM_ENVVAL_BLOCK_PTR(&block);
}
cref = vm_cref_push(th, under, NOEX_PUBLIC, blockptr);
- cref->flags |= NODE_FL_CREF_PUSHED_BY_EVAL;
+ CREF_PUSHED_BY_EVAL_SET(cref);
if (values == Qundef) {
return vm_yield_with_cref(th, 1, &self, cref);
@@ -1590,8 +1590,8 @@ rb_yield_refine_block(VALUE refinement, VALUE refinements)
VM_CF_LEP(th->cfp)[0] = VM_ENVVAL_BLOCK_PTR(&block);
}
cref = vm_cref_push(th, refinement, NOEX_PUBLIC, blockptr);
- cref->flags |= NODE_FL_CREF_PUSHED_BY_EVAL;
- RB_OBJ_WRITE(cref, &cref->nd_refinements, refinements);
+ CREF_PUSHED_BY_EVAL_SET(cref);
+ RB_OBJ_WRITE(cref, &CREF_REFINEMENTS(cref), refinements);
return vm_yield_with_cref(th, 0, NULL, cref);
}
@@ -1603,7 +1603,7 @@ eval_under(VALUE under, VALUE self, VALUE src, VALUE file, int line)
NODE *cref = vm_cref_push(GET_THREAD(), under, NOEX_PUBLIC, NULL);
if (SPECIAL_CONST_P(self) && !NIL_P(under)) {
- cref->flags |= NODE_FL_CREF_PUSHED_BY_EVAL;
+ CREF_PUSHED_BY_EVAL_SET(cref);
}
SafeStringValue(src);
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index e4afbdb0fb..e1547cee69 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -299,18 +299,18 @@ rb_vm_rewrite_cref_stack(NODE *node, VALUE old_klass, VALUE new_klass, NODE **ne
NODE *new_node;
while (node) {
- if (node->nd_clss == old_klass) {
+ if (CREF_CLASS(node) == old_klass) {
new_node = NEW_CREF(new_klass);
COPY_CREF_OMOD(new_node, node);
- RB_OBJ_WRITE(new_node, &new_node->nd_next, node->nd_next);
+ RB_OBJ_WRITE(new_node, &CREF_NEXT(new_node), CREF_NEXT(node));
*new_cref_ptr = new_node;
return;
}
- new_node = NEW_CREF(node->nd_clss);
+ new_node = NEW_CREF(CREF_CLASS(node));
COPY_CREF_OMOD(new_node, node);
- node = node->nd_next;
+ node = CREF_NEXT(node);
*new_cref_ptr = new_node;
- new_cref_ptr = &new_node->nd_next;
+ new_cref_ptr = &CREF_NEXT(new_node);
}
*new_cref_ptr = NULL;
}
@@ -333,10 +333,10 @@ vm_cref_push(rb_thread_t *th, VALUE klass, int noex, rb_block_t *blockptr)
}
cref = vm_cref_new(klass, noex, prev_cref);
- /* TODO: why cref->nd_next is 1? */
- if (cref->nd_next && cref->nd_next != (void *) 1 &&
- !NIL_P(cref->nd_next->nd_refinements)) {
- COPY_CREF_OMOD(cref, cref->nd_next);
+ /* TODO: why CREF_NEXT(cref) is 1? */
+ if (CREF_NEXT(cref) && CREF_NEXT(cref) != (void *) 1 &&
+ !NIL_P(CREF_REFINEMENTS(CREF_NEXT(cref)))) {
+ COPY_CREF_OMOD(cref, CREF_NEXT(cref));
}
return cref;
@@ -349,10 +349,10 @@ vm_get_cbase(const VALUE *ep)
VALUE klass = Qundef;
while (cref) {
- if ((klass = cref->nd_clss) != 0) {
+ if ((klass = CREF_CLASS(cref)) != 0) {
break;
}
- cref = cref->nd_next;
+ cref = CREF_NEXT(cref);
}
return klass;
@@ -365,11 +365,11 @@ vm_get_const_base(const VALUE *ep)
VALUE klass = Qundef;
while (cref) {
- if (!(cref->flags & NODE_FL_CREF_PUSHED_BY_EVAL) &&
- (klass = cref->nd_clss) != 0) {
+ if (!CREF_PUSHED_BY_EVAL(cref) &&
+ (klass = CREF_CLASS(cref)) != 0) {
break;
}
- cref = cref->nd_next;
+ cref = CREF_NEXT(cref);
}
return klass;
@@ -411,18 +411,18 @@ vm_get_ev_const(rb_thread_t *th, VALUE orig_klass, ID id, int is_defined)
const NODE *cref;
VALUE klass = orig_klass;
- while (root_cref && root_cref->flags & NODE_FL_CREF_PUSHED_BY_EVAL) {
- root_cref = root_cref->nd_next;
+ while (root_cref && CREF_PUSHED_BY_EVAL(root_cref)) {
+ root_cref = CREF_NEXT(root_cref);
}
cref = root_cref;
- while (cref && cref->nd_next) {
- if (cref->flags & NODE_FL_CREF_PUSHED_BY_EVAL) {
+ while (cref && CREF_NEXT(cref)) {
+ if (CREF_PUSHED_BY_EVAL(cref)) {
klass = Qnil;
}
else {
- klass = cref->nd_clss;
+ klass = CREF_CLASS(cref);
}
- cref = cref->nd_next;
+ cref = CREF_NEXT(cref);
if (!NIL_P(klass)) {
VALUE av, am = 0;
@@ -451,8 +451,8 @@ vm_get_ev_const(rb_thread_t *th, VALUE orig_klass, ID id, int is_defined)
}
/* search self */
- if (root_cref && !NIL_P(root_cref->nd_clss)) {
- klass = vm_get_iclass(th->cfp, root_cref->nd_clss);
+ if (root_cref && !NIL_P(CREF_CLASS(root_cref))) {
+ klass = vm_get_iclass(th->cfp, CREF_CLASS(root_cref));
}
else {
klass = CLASS_OF(th->cfp->self);
@@ -485,16 +485,16 @@ vm_get_cvar_base(NODE *cref, rb_control_frame_t *cfp)
rb_bug("vm_get_cvar_base: no cref");
}
- while (cref->nd_next &&
- (NIL_P(cref->nd_clss) || FL_TEST(cref->nd_clss, FL_SINGLETON) ||
- (cref->flags & NODE_FL_CREF_PUSHED_BY_EVAL))) {
- cref = cref->nd_next;
+ while (CREF_NEXT(cref) &&
+ (NIL_P(CREF_CLASS(cref)) || FL_TEST(CREF_CLASS(cref), FL_SINGLETON) ||
+ CREF_PUSHED_BY_EVAL(cref))) {
+ cref = CREF_NEXT(cref);
}
- if (!cref->nd_next) {
+ if (!CREF_NEXT(cref)) {
rb_warn("class variable access from toplevel");
}
- klass = vm_get_iclass(cfp, cref->nd_clss);
+ klass = vm_get_iclass(cfp, CREF_CLASS(cref));
if (NIL_P(klass)) {
rb_raise(rb_eTypeError, "no class variables available");
@@ -1785,7 +1785,7 @@ vm_call_method(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci)
break;
case VM_METHOD_TYPE_REFINED:{
NODE *cref = rb_vm_get_cref(cfp->ep);
- VALUE refinements = cref ? cref->nd_refinements : Qnil;
+ VALUE refinements = cref ? CREF_REFINEMENTS(cref) : Qnil;
VALUE refinement, defined_class;
rb_method_entry_t *me;
diff --git a/vm_insnhelper.h b/vm_insnhelper.h
index 31f8ffc4e6..6cbf8b6fa9 100644
--- a/vm_insnhelper.h
+++ b/vm_insnhelper.h
@@ -146,21 +146,21 @@ enum vm_regan_acttype {
/**********************************************************/
#define COPY_CREF_OMOD(c1, c2) do { \
- RB_OBJ_WRITE((c1), &(c1)->nd_refinements, (c2)->nd_refinements); \
- if (!NIL_P((c2)->nd_refinements)) { \
- (c1)->flags |= NODE_FL_CREF_OMOD_SHARED; \
- (c2)->flags |= NODE_FL_CREF_OMOD_SHARED; \
+ RB_OBJ_WRITE((c1), &CREF_REFINEMENTS(c1), CREF_REFINEMENTS(c2)); \
+ if (!CREF_REFINEMENTS(c2)) { \
+ CREF_OMOD_SHARED_SET(c1); \
+ CREF_OMOD_SHARED_SET(c2); \
} \
} while (0)
#define COPY_CREF(c1, c2) do { \
NODE *__tmp_c2 = (c2); \
COPY_CREF_OMOD(c1, __tmp_c2); \
- RB_OBJ_WRITE((c1), &(c1)->nd_clss, __tmp_c2->nd_clss); \
- (c1)->nd_visi = __tmp_c2->nd_visi;\
- RB_OBJ_WRITE((c1), &(c1)->nd_next, __tmp_c2->nd_next); \
- if (__tmp_c2->flags & NODE_FL_CREF_PUSHED_BY_EVAL) { \
- (c1)->flags |= NODE_FL_CREF_PUSHED_BY_EVAL; \
+ RB_OBJ_WRITE((c1), &CREF_CLASS(c1), CREF_CLASS(__tmp_c2)); \
+ CREF_VISI_SET((c1), CREF_VISI(__tmp_c2));\
+ RB_OBJ_WRITE((c1), &CREF_NEXT(c1), CREF_NEXT(__tmp_c2)); \
+ if (CREF_PUSHED_BY_EVAL(__tmp_c2)) { \
+ CREF_PUSHED_BY_EVAL_SET(c1); \
} \
} while (0)
diff --git a/vm_method.c b/vm_method.c
index d5fe52404a..48c518ffeb 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -479,7 +479,7 @@ rb_add_method0(VALUE klass, ID mid, rb_method_type_t type, void *opts, rb_method
private_cref = vm_cref_new_toplevel(GET_THREAD()); /* TODO: CREF should be shared with other methods */
if (cref) COPY_CREF(private_cref, cref);
- private_cref->nd_visi = NOEX_PUBLIC;
+ CREF_VISI_SET(private_cref, NOEX_PUBLIC);
RB_OBJ_WRITE(klass, &def->body.iseq_body.cref, private_cref);
break;
}
@@ -744,7 +744,7 @@ rb_method_entry_with_refinements(VALUE klass, ID id,
if (me && me->def->type == VM_METHOD_TYPE_REFINED) {
NODE *cref = rb_vm_cref();
- VALUE refinements = cref ? cref->nd_refinements : Qnil;
+ VALUE refinements = cref ? CREF_REFINEMENTS(cref) : Qnil;
me = rb_resolve_refined_method(refinements, me, &defined_class);
}