зеркало из https://github.com/github/ruby.git
* vm_insnhelper.c, vm.c, proc.c : revert r17021. [ruby-dev:34997]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
7e6c9db4e2
Коммит
ddf83922a2
|
@ -1,3 +1,7 @@
|
|||
Mon Jun 9 08:12:40 2008 wanabe <s.wanabe@gmail.com>
|
||||
|
||||
* vm_insnhelper.c, vm.c, proc.c : revert r17021. [ruby-dev:34997]
|
||||
|
||||
Mon Jun 9 03:12:23 2008 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* bootstraptest/pending.rb: move/remove solved issues.
|
||||
|
|
4
proc.c
4
proc.c
|
@ -490,7 +490,7 @@ proc_call(int argc, VALUE *argv, VALUE procval)
|
|||
rb_block_t *blockptr = 0;
|
||||
GetProcPtr(procval, proc);
|
||||
|
||||
if (BUILTIN_TYPE(proc->block.iseq) == T_NODE ||
|
||||
if (BUILTIN_TYPE(proc->block.iseq) != T_NODE &&
|
||||
proc->block.iseq->arg_block != -1) {
|
||||
|
||||
if (rb_block_given_p()) {
|
||||
|
@ -1613,7 +1613,7 @@ curry(VALUE dummy, VALUE args, int argc, VALUE *argv)
|
|||
arity = make_curry_proc(proc, passed, arity);
|
||||
return arity;
|
||||
}
|
||||
arity = proc_call(RARRAY_LEN(passed), RARRAY_PTR(passed), proc);
|
||||
arity = rb_proc_call(proc, passed);
|
||||
return arity;
|
||||
}
|
||||
|
||||
|
|
2
vm.c
2
vm.c
|
@ -448,7 +448,7 @@ invoke_block_from_c(rb_thread_t *th, const rb_block_t *block,
|
|||
return vm_eval_body(th);
|
||||
}
|
||||
else {
|
||||
return vm_yield_with_cfunc(th, block, self, argc, argv, blockptr);
|
||||
return vm_yield_with_cfunc(th, block, self, argc, argv);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -651,8 +651,7 @@ block_proc_is_lambda(const VALUE procval)
|
|||
|
||||
static inline VALUE
|
||||
vm_yield_with_cfunc(rb_thread_t *th, const rb_block_t *block,
|
||||
VALUE self, int argc, const VALUE *argv,
|
||||
rb_block_t *blockptr)
|
||||
VALUE self, int argc, const VALUE *argv)
|
||||
{
|
||||
NODE *ifunc = (NODE *) block->iseq;
|
||||
VALUE val;
|
||||
|
@ -673,15 +672,7 @@ vm_yield_with_cfunc(rb_thread_t *th, const rb_block_t *block,
|
|||
self, (VALUE)block->dfp,
|
||||
0, th->cfp->sp, block->lfp, 1);
|
||||
|
||||
if (blockptr) {
|
||||
VALUE store_block = th->cfp->lfp[0];
|
||||
th->cfp->lfp[0] = GC_GUARDED_PTR(blockptr);
|
||||
val = (*ifunc->nd_cfnc) (arg, ifunc->nd_tval, argc, argv);
|
||||
th->cfp->lfp[0] = store_block;
|
||||
}
|
||||
else {
|
||||
val = (*ifunc->nd_cfnc) (arg, ifunc->nd_tval, argc, argv);
|
||||
}
|
||||
val = (*ifunc->nd_cfnc) (arg, ifunc->nd_tval, argc, argv);
|
||||
|
||||
th->cfp++;
|
||||
return val;
|
||||
|
@ -840,7 +831,7 @@ vm_invoke_block(rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_num_t num, rb_n
|
|||
return Qundef;
|
||||
}
|
||||
else {
|
||||
VALUE val = vm_yield_with_cfunc(th, block, block->self, argc, STACK_ADDR_FROM_TOP(argc), 0);
|
||||
VALUE val = vm_yield_with_cfunc(th, block, block->self, argc, STACK_ADDR_FROM_TOP(argc));
|
||||
POPN(argc); /* TODO: should put before C/yield? */
|
||||
return val;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче