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

ruby-changes:11788

From: nari <ko1@a...>
Date: Sat, 16 May 2009 17:27:51 +0900 (JST)
Subject: [ruby-changes:11788] Ruby:r23441 (trunk): * iseq.c (rb_iseq_clone): use longlife object and insert write barrier.

nari	2009-05-16 17:27:36 +0900 (Sat, 16 May 2009)

  New Revision: 23441

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23441

  Log:
    * iseq.c (rb_iseq_clone): use longlife object and insert write barrier.
    * vm_insnhelper.c (vm_cref_push): ditto.
    
    * vm_insnhelper.h (COPY_CREF): insert write barrier.

  Modified files:
    trunk/ChangeLog
    trunk/iseq.c
    trunk/vm_insnhelper.c
    trunk/vm_insnhelper.h

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 23440)
+++ ChangeLog	(revision 23441)
@@ -1,3 +1,11 @@
+Sat May 16 17:26:04 2009  Narihiro Nakamura  <authorNari@g...>
+
+	* iseq.c (rb_iseq_clone): use longlife object and insert write barrier.
+
+	* vm_insnhelper.c (vm_cref_push): ditto.
+
+	* vm_insnhelper.h (COPY_CREF): insert write barrier.
+
 Sat May 16 13:49:24 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* variable.c (rb_autoload_load): gets rid of false warning.
Index: iseq.c
===================================================================
--- iseq.c	(revision 23440)
+++ iseq.c	(revision 23441)
@@ -1285,9 +1285,9 @@
 	iseq1->orig = iseqval;
     }
     if (newcbase) {
-	iseq1->cref_stack = NEW_BLOCK(newcbase);
+	iseq1->cref_stack = NEW_NODE_LONGLIFE(NODE_BLOCK, newcbase, 0, 0);
 	if (iseq0->cref_stack->nd_next) {
-	    iseq1->cref_stack->nd_next = iseq0->cref_stack->nd_next;
+	    iseq1->cref_stack->nd_next = (NODE *)rb_gc_write_barrier((VALUE)iseq0->cref_stack->nd_next);
 	}
     }
 
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 23440)
+++ vm_insnhelper.c	(revision 23441)
@@ -1032,12 +1032,12 @@
 vm_cref_push(rb_thread_t *th, VALUE klass, int noex)
 {
     rb_control_frame_t *cfp = vm_get_ruby_level_caller_cfp(th, th->cfp);
-    NODE *cref = NEW_BLOCK(klass);
+    NODE *cref = NEW_NODE_LONGLIFE(NODE_BLOCK, klass, 0, 0);
     cref->nd_file = 0;
     cref->nd_visi = noex;
 
     if (cfp) {
-	cref->nd_next = vm_get_cref(cfp->iseq, cfp->lfp, cfp->dfp);
+	cref->nd_next = (NODE *)rb_gc_write_barrier((VALUE)vm_get_cref(cfp->iseq, cfp->lfp, cfp->dfp));
     }
 
     return cref;
Index: vm_insnhelper.h
===================================================================
--- vm_insnhelper.h	(revision 23440)
+++ vm_insnhelper.h	(revision 23441)
@@ -154,9 +154,9 @@
 
 #define COPY_CREF(c1, c2) do {  \
   NODE *__tmp_c2 = (c2); \
-  c1->nd_clss = __tmp_c2->nd_clss; \
-  c1->nd_visi = __tmp_c2->nd_visi; \
-  c1->nd_next = __tmp_c2->nd_next; \
+  c1->nd_clss = rb_gc_write_barrier((VALUE)__tmp_c2->nd_clss);\
+  c1->nd_visi = __tmp_c2->nd_visi;\
+  c1->nd_next = (NODE *)rb_gc_write_barrier((VALUE)__tmp_c2->nd_next);\
 } while (0)
 
 #define CALL_METHOD(num, blockptr, flag, id, mn, recv) do { \

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

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