Skip to content

Commit

Permalink
* iseq.c (rb_iseq_clone): use longlife object and insert write barrier.
Browse files Browse the repository at this point in the history
* vm_insnhelper.c (vm_cref_push): ditto.

* vm_insnhelper.h (COPY_CREF): insert write barrier.
			


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
authorNari committed May 16, 2009
1 parent 8c71726 commit 832d5a8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions iseq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
4 changes: 2 additions & 2 deletions vm_insnhelper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions vm_insnhelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 { \
Expand Down

0 comments on commit 832d5a8

Please sign in to comment.