[前][次][番号順一覧][スレッド一覧]

ruby-changes:2665

From: ko1@a...
Date: 9 Dec 2007 14:56:15 +0900
Subject: [ruby-changes:2665] ko1 - Ruby:r14156 (trunk): * vm.c (rb_thread_mark): use rb_gc_mark_maybe() for

ko1	2007-12-09 14:56:00 +0900 (Sun, 09 Dec 2007)

  New Revision: 14156

  Modified files:
    trunk/ChangeLog
    trunk/insnhelper.ci
    trunk/vm.c

  Log:
    * 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.
    


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/insnhelper.ci?r1=14156&r2=14155
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14156&r2=14155
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/vm.c?r1=14156&r2=14155

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 14155)
+++ ChangeLog	(revision 14156)
@@ -1,3 +1,10 @@
+Sun Dec  9 14:38:25 2007  Koichi Sasada  <ko1@a...>
+
+	* 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@f...>
 
 	* include/ruby/ruby.h (FilePathStringValue): defined.  similar to
Index: vm.c
===================================================================
--- vm.c	(revision 14155)
+++ vm.c	(revision 14156)
@@ -1616,14 +1616,15 @@
 	th = ptr;
 	if (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 *limit_cfp =
-	      (void *)(th->stack + th->stack_size);
+	    rb_control_frame_t *limit_cfp = (void *)(th->stack + th->stack_size);
 
 	    while (p < sp) {
 		rb_gc_mark(*p++);
 	    }
+	    rb_gc_mark_locations(p, p + th->mark_stack_len);
+
 	    while (cfp != limit_cfp) {
 		rb_gc_mark(cfp->proc);
 		cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
Index: insnhelper.ci
===================================================================
--- insnhelper.ci	(revision 14155)
+++ insnhelper.ci	(revision 14156)
@@ -114,6 +114,7 @@
     else {
 	VALUE * const dst = argv;
 	int opt_pc = 0;
+
 	th->mark_stack_len = iseq->arg_size;
 
 	/* mandatory */
@@ -152,6 +153,10 @@
 		opt_pc = iseq->arg_opt_table[opts]; /* no opt */
 	    }
 	    else {
+		int i;
+		for (i = argc; i<opts; i++) {
+		    dst[i + m] = Qnil;
+		}
 		opt_pc = iseq->arg_opt_table[argc];
 		argc = 0;
 	    }
@@ -190,6 +195,7 @@
 
 	    dst[iseq->arg_block] = blockval; /* Proc or nil */
 	}
+
 	th->mark_stack_len = 0;
 	return opt_pc;
     }
@@ -423,14 +429,13 @@
 {
     rb_iseq_t *iseq;
     int opt_pc, i;
-    VALUE *rsp = cfp->sp - argc;
-    VALUE *sp;
+    VALUE *sp, *rsp = cfp->sp - argc;
 
     /* TODO: eliminate it */
     GetISeqPtr(iseqval, iseq);
+    sp = rsp + iseq->arg_size;
 
     opt_pc = vm_callee_setup_arg(th, iseq, argc, rsp, &blockptr);
-    sp = rsp + iseq->arg_size;
 
     /* stack overflow check */
     CHECK_STACK_OVERFLOW(cfp, iseq->stack_max + 0x10);
@@ -778,7 +783,6 @@
 	    }
 
 	    argv[iseq->arg_block] = procval;
-	    th->mark_stack_len = iseq->arg_block + 1;
 	}
 
 	th->mark_stack_len = 0;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧]