ruby-changes:37934
From: ko1 <ko1@a...>
Date: Thu, 19 Mar 2015 05:31:59 +0900 (JST)
Subject: [ruby-changes:37934] ko1:r50015 (trunk): * iseq.c (iseq_mark): skip some marking if iseq->orig is available.
ko1 2015-03-19 05:31:50 +0900 (Thu, 19 Mar 2015) New Revision: 50015 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50015 Log: * iseq.c (iseq_mark): skip some marking if iseq->orig is available. * iseq.c (rb_iseq_clone): need WB for iseq1->klass = iseq0->klass (done in MEMCPY). Modified files: trunk/ChangeLog trunk/iseq.c Index: ChangeLog =================================================================== --- ChangeLog (revision 50014) +++ ChangeLog (revision 50015) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Mar 19 05:30:13 2015 Koichi Sasada <ko1@a...> + + * iseq.c (iseq_mark): skip some marking if iseq->orig is available. + + * iseq.c (rb_iseq_clone): need WB for iseq1->klass = iseq0->klass + (done in MEMCPY). + Thu Mar 19 04:55:53 2015 Koichi Sasada <ko1@a...> * internal.h (IMEMO_DEBUG): added. Index: iseq.c =================================================================== --- iseq.c (revision 50014) +++ iseq.c (revision 50015) @@ -114,16 +114,20 @@ iseq_mark(void *ptr) https://github.com/ruby/ruby/blob/trunk/iseq.c#L114 rb_iseq_t *iseq = ptr; RUBY_GC_INFO("%s @ %s\n", RSTRING_PTR(iseq->location.label), RSTRING_PTR(iseq->location.path)); - RUBY_MARK_UNLESS_NULL(iseq->mark_ary); - RUBY_MARK_UNLESS_NULL(iseq->location.label); - RUBY_MARK_UNLESS_NULL(iseq->location.base_label); - RUBY_MARK_UNLESS_NULL(iseq->location.path); - RUBY_MARK_UNLESS_NULL(iseq->location.absolute_path); + if (!iseq->orig) { + RUBY_MARK_UNLESS_NULL(iseq->mark_ary); + RUBY_MARK_UNLESS_NULL(iseq->location.label); + RUBY_MARK_UNLESS_NULL(iseq->location.base_label); + RUBY_MARK_UNLESS_NULL(iseq->location.path); + RUBY_MARK_UNLESS_NULL(iseq->location.absolute_path); + RUBY_MARK_UNLESS_NULL(iseq->coverage); + } + else { + RUBY_MARK_UNLESS_NULL(iseq->orig); + } RUBY_MARK_UNLESS_NULL(iseq->klass); - RUBY_MARK_UNLESS_NULL(iseq->coverage); - RUBY_MARK_UNLESS_NULL(iseq->orig); if (iseq->compile_data != 0) { struct iseq_compile_data *const compile_data = iseq->compile_data; @@ -1946,7 +1950,7 @@ rb_iseq_clone(VALUE iseqval, VALUE newcb https://github.com/ruby/ruby/blob/trunk/iseq.c#L1950 GetISeqPtr(iseqval, iseq0); GetISeqPtr(newiseq, iseq1); - MEMCPY(iseq1, iseq0, rb_iseq_t, 1); /* TODO: write barrier? */ + MEMCPY(iseq1, iseq0, rb_iseq_t, 1); iseq1->self = newiseq; if (!iseq1->orig) { @@ -1959,6 +1963,9 @@ rb_iseq_clone(VALUE iseqval, VALUE newcb https://github.com/ruby/ruby/blob/trunk/iseq.c#L1963 if (newcbase) { RB_OBJ_WRITE(iseq1->self, &iseq1->klass, newcbase); } + else { + RB_OBJ_WRITTEN(iseq1->self, Qundef, iseq1->klass); + } return newiseq; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/