summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-16 08:27:36 +0000
committernari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-16 08:27:36 +0000
commitb4ca9773732634b904a59a23d502bf838b2058ca (patch)
treeb5b5064e635500603e58e362d74a9a920dbd87b6
parentd04c54859b2bb2bfd59eed5c371fd220f12280bd (diff)
downloadruby-b4ca9773732634b904a59a23d502bf838b2058ca.tar.gz
ruby-b4ca9773732634b904a59a23d502bf838b2058ca.tar.xz
ruby-b4ca9773732634b904a59a23d502bf838b2058ca.zip
* 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. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--iseq.c4
-rw-r--r--vm_insnhelper.c4
-rw-r--r--vm_insnhelper.h6
4 files changed, 15 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index bcf961bc1..621982e03 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Sat May 16 17:26:04 2009 Narihiro Nakamura <authorNari@gmail.com>
+
+ * 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@ruby-lang.org>
* variable.c (rb_autoload_load): gets rid of false warning.
diff --git a/iseq.c b/iseq.c
index a102941cf..6220aa892 100644
--- a/iseq.c
+++ b/iseq.c
@@ -1285,9 +1285,9 @@ rb_iseq_clone(VALUE iseqval, VALUE newcbase)
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);
}
}
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 13bbcf799..0889e8aee 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1032,12 +1032,12 @@ static NODE *
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;
diff --git a/vm_insnhelper.h b/vm_insnhelper.h
index 74ca8450e..838a65267 100644
--- a/vm_insnhelper.h
+++ b/vm_insnhelper.h
@@ -154,9 +154,9 @@ extern VALUE ruby_vm_const_missing_count;
#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 { \