summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-11 13:31:11 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-11 13:31:11 +0000
commit7790f37efdd8dd42a0a43c3206f6afdd43f8e86a (patch)
tree38d8c41ba56f432da983148757c6c8b7ee36196b /compile.c
parent48cb7391190612c77375f924c1e202178f09f559 (diff)
* node.h: remove NODE_IFUNC, NEW_IFUNC.
* internal.h: use T_IMEMO for IFUNC. rename `struct IFUNC' to `struct vm_ifunc' and move the definition from vm_insnhelper.h. Add imemo_ifunc. * gc.c (gc_mark_children): mark imemo_ifunc type T_IMEMO object. * compile.c: catch up these changes. * proc.c: ditto. * vm_core.h (RUBY_VM_IFUNC_P): ditto. * vm_eval.c (rb_iterate): ditto. * vm_insnhelper.c: ditto. * ext/objspace/objspace.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/compile.c b/compile.c
index e459bb9..13015df 100644
--- a/compile.c
+++ b/compile.c
@@ -520,9 +520,10 @@ rb_iseq_compile_node(VALUE self, NODE *node)
}
}
}
- else if (nd_type(node) == NODE_IFUNC) {
+ else if (RB_TYPE_P((VALUE)node, T_IMEMO)) {
+ const struct vm_ifunc *ifunc = (struct vm_ifunc *)node;
/* user callback */
- (*node->nd_cfnc)(iseq, ret, node->nd_tval);
+ (*ifunc->func)(iseq, ret, ifunc->data);
}
else {
switch (iseq->type) {
@@ -5396,7 +5397,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
*/
int is_index = iseq->is_size++;
VALUE once_iseq = NEW_CHILD_ISEQVAL(
- NEW_IFUNC(build_postexe_iseq, node->nd_body),
+ (NODE *)IFUNC_NEW(build_postexe_iseq, node->nd_body),
make_name_for_block(iseq), ISEQ_TYPE_BLOCK, line);
ADD_INSN2(ret, line, once, once_iseq, INT2FIX(is_index));
@@ -6314,7 +6315,7 @@ method_for_self(VALUE name, VALUE arg, rb_insn_func_t func,
acc.arg = arg;
acc.func = func;
acc.line = caller_location(&path, &absolute_path);
- return rb_iseq_new_with_opt(NEW_IFUNC(build, (VALUE)&acc),
+ return rb_iseq_new_with_opt((NODE *)IFUNC_NEW(build, (VALUE)&acc),
rb_sym2str(name), path, absolute_path,
INT2FIX(acc.line), 0, ISEQ_TYPE_METHOD, 0);
}