* vm.c (rb_thread_mark): use rb_gc_mark_maybe() for
VM stack specified by mark_stack_len. * insnhelper.ci: clear vm stack extended by opt value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3a8f7f1d7f
commit
3923d7f420
@ -1,3 +1,10 @@
|
|||||||
|
Sun Dec 9 14:38:25 2007 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* vm.c (rb_thread_mark): use rb_gc_mark_maybe() for
|
||||||
|
VM stack specified by mark_stack_len.
|
||||||
|
|
||||||
|
* insnhelper.ci: clear vm stack extended by opt value.
|
||||||
|
|
||||||
Sun Dec 9 14:08:47 2007 Tanaka Akira <akr@fsij.org>
|
Sun Dec 9 14:08:47 2007 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* include/ruby/ruby.h (FilePathStringValue): defined. similar to
|
* include/ruby/ruby.h (FilePathStringValue): defined. similar to
|
||||||
|
@ -114,6 +114,7 @@ vm_callee_setup_arg(rb_thread_t *th, rb_iseq_t *iseq,
|
|||||||
else {
|
else {
|
||||||
VALUE * const dst = argv;
|
VALUE * const dst = argv;
|
||||||
int opt_pc = 0;
|
int opt_pc = 0;
|
||||||
|
|
||||||
th->mark_stack_len = iseq->arg_size;
|
th->mark_stack_len = iseq->arg_size;
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
@ -152,6 +153,10 @@ vm_callee_setup_arg(rb_thread_t *th, rb_iseq_t *iseq,
|
|||||||
opt_pc = iseq->arg_opt_table[opts]; /* no opt */
|
opt_pc = iseq->arg_opt_table[opts]; /* no opt */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
int i;
|
||||||
|
for (i = argc; i<opts; i++) {
|
||||||
|
dst[i + m] = Qnil;
|
||||||
|
}
|
||||||
opt_pc = iseq->arg_opt_table[argc];
|
opt_pc = iseq->arg_opt_table[argc];
|
||||||
argc = 0;
|
argc = 0;
|
||||||
}
|
}
|
||||||
@ -190,6 +195,7 @@ vm_callee_setup_arg(rb_thread_t *th, rb_iseq_t *iseq,
|
|||||||
|
|
||||||
dst[iseq->arg_block] = blockval; /* Proc or nil */
|
dst[iseq->arg_block] = blockval; /* Proc or nil */
|
||||||
}
|
}
|
||||||
|
|
||||||
th->mark_stack_len = 0;
|
th->mark_stack_len = 0;
|
||||||
return opt_pc;
|
return opt_pc;
|
||||||
}
|
}
|
||||||
@ -423,14 +429,13 @@ vm_setup_method(rb_thread_t *th, rb_control_frame_t *cfp,
|
|||||||
{
|
{
|
||||||
rb_iseq_t *iseq;
|
rb_iseq_t *iseq;
|
||||||
int opt_pc, i;
|
int opt_pc, i;
|
||||||
VALUE *rsp = cfp->sp - argc;
|
VALUE *sp, *rsp = cfp->sp - argc;
|
||||||
VALUE *sp;
|
|
||||||
|
|
||||||
/* TODO: eliminate it */
|
/* TODO: eliminate it */
|
||||||
GetISeqPtr(iseqval, iseq);
|
GetISeqPtr(iseqval, iseq);
|
||||||
|
sp = rsp + iseq->arg_size;
|
||||||
|
|
||||||
opt_pc = vm_callee_setup_arg(th, iseq, argc, rsp, &blockptr);
|
opt_pc = vm_callee_setup_arg(th, iseq, argc, rsp, &blockptr);
|
||||||
sp = rsp + iseq->arg_size;
|
|
||||||
|
|
||||||
/* stack overflow check */
|
/* stack overflow check */
|
||||||
CHECK_STACK_OVERFLOW(cfp, iseq->stack_max + 0x10);
|
CHECK_STACK_OVERFLOW(cfp, iseq->stack_max + 0x10);
|
||||||
@ -778,7 +783,6 @@ vm_yield_setup_args(rb_thread_t *th, rb_iseq_t *iseq,
|
|||||||
}
|
}
|
||||||
|
|
||||||
argv[iseq->arg_block] = procval;
|
argv[iseq->arg_block] = procval;
|
||||||
th->mark_stack_len = iseq->arg_block + 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
th->mark_stack_len = 0;
|
th->mark_stack_len = 0;
|
||||||
|
7
vm.c
7
vm.c
@ -1616,14 +1616,15 @@ rb_thread_mark(void *ptr)
|
|||||||
th = ptr;
|
th = ptr;
|
||||||
if (th->stack) {
|
if (th->stack) {
|
||||||
VALUE *p = th->stack;
|
VALUE *p = th->stack;
|
||||||
VALUE *sp = th->cfp->sp + th->mark_stack_len;
|
VALUE *sp = th->cfp->sp;
|
||||||
rb_control_frame_t *cfp = th->cfp;
|
rb_control_frame_t *cfp = th->cfp;
|
||||||
rb_control_frame_t *limit_cfp =
|
rb_control_frame_t *limit_cfp = (void *)(th->stack + th->stack_size);
|
||||||
(void *)(th->stack + th->stack_size);
|
|
||||||
|
|
||||||
while (p < sp) {
|
while (p < sp) {
|
||||||
rb_gc_mark(*p++);
|
rb_gc_mark(*p++);
|
||||||
}
|
}
|
||||||
|
rb_gc_mark_locations(p, p + th->mark_stack_len);
|
||||||
|
|
||||||
while (cfp != limit_cfp) {
|
while (cfp != limit_cfp) {
|
||||||
rb_gc_mark(cfp->proc);
|
rb_gc_mark(cfp->proc);
|
||||||
cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
|
cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user