summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-20 21:10:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-20 21:10:24 +0000
commitf4db8aedc87d0ff901206e4c59478554b7b952a6 (patch)
tree0b6a38f278849be443d5ef538b1e92b4f12ada2c /compile.c
parentda4d3e846407a538aef893af8478aa13ba7d8cb8 (diff)
* compile.c (setup_args), vm.c (invoke_block_from_c),
vm_insnhelper.c (caller_setup_args): reverted r30241 and r30243 except for the test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/compile.c b/compile.c
index fb524011d5..99487d8e44 100644
--- a/compile.c
+++ b/compile.c
@@ -2886,7 +2886,7 @@ add_ensure_iseq(LINK_ANCHOR *ret, rb_iseq_t *iseq, int is_return)
}
static VALUE
-setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, VALUE *flag, VALUE *block)
+setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, VALUE *flag)
{
VALUE argc = INT2FIX(0);
int nsplat = 0;
@@ -2896,15 +2896,8 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, VALUE *flag, VALUE *b
INIT_ANCHOR(arg_block);
INIT_ANCHOR(args_splat);
if (argn && nd_type(argn) == NODE_BLOCK_PASS) {
- if (block && nd_type(argn->nd_body) == NODE_LAMBDA) {
- NODE *lambda = argn->nd_body;
- *block = NEW_CHILD_ISEQVAL(lambda->nd_body, make_name_for_block(iseq), ISEQ_TYPE_BLOCK, nd_line(lambda));
- *flag |= VM_CALL_BLOCK_LAMBDA_BIT;
- }
- else {
- COMPILE(arg_block, "block", argn->nd_body);
- *flag |= VM_CALL_ARGS_BLOCKARG_BIT;
- }
+ COMPILE(arg_block, "block", argn->nd_body);
+ *flag |= VM_CALL_ARGS_BLOCKARG_BIT;
argn = argn->nd_head;
}
@@ -3816,7 +3809,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
boff = 1;
default:
INIT_ANCHOR(args);
- argc = setup_args(iseq, args, node->nd_args->nd_head, &flag, NULL);
+ argc = setup_args(iseq, args, node->nd_args->nd_head, &flag);
ADD_SEQ(ret, args);
}
ADD_INSN1(ret, nd_line(node), dupn, FIXNUM_INC(argc, 1 + boff));
@@ -4132,7 +4125,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
/* args */
if (nd_type(node) != NODE_VCALL) {
- argc = setup_args(iseq, args, node->nd_args, &flag, &parent_block);
+ argc = setup_args(iseq, args, node->nd_args, &flag);
}
else {
argc = INT2FIX(0);
@@ -4170,7 +4163,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
INIT_ANCHOR(args);
iseq->compile_data->current_block = Qfalse;
if (nd_type(node) == NODE_SUPER) {
- argc = setup_args(iseq, args, node->nd_args, &flag, &parent_block);
+ argc = setup_args(iseq, args, node->nd_args, &flag);
}
else {
/* NODE_ZSUPER */
@@ -4343,7 +4336,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
if (node->nd_head) {
- argc = setup_args(iseq, args, node->nd_head, &flag, NULL);
+ argc = setup_args(iseq, args, node->nd_head, &flag);
}
else {
argc = INT2FIX(0);
@@ -4955,7 +4948,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
INIT_ANCHOR(recv);
INIT_ANCHOR(args);
- argc = setup_args(iseq, args, node->nd_args, &flag, NULL);
+ argc = setup_args(iseq, args, node->nd_args, &flag);
if (node->nd_recv == (NODE *) 1) {
flag |= VM_CALL_FCALL_BIT;