aboutsummaryrefslogtreecommitdiffstats
path: root/iseq.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-18 20:31:50 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-18 20:31:50 +0000
commit4690e6228402bf045403e7d5eae9b44519c69c6b (patch)
treef94c23e856591b662ff18be021f3ddca117920cf /iseq.c
parent05704f51fb2d3e183535fa52fd43ac0b7227cdb7 (diff)
downloadruby-4690e6228402bf045403e7d5eae9b44519c69c6b.tar.gz
* 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). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/iseq.c b/iseq.c
index 1eac9309f3..a1346115e9 100644
--- a/iseq.c
+++ b/iseq.c
@@ -114,16 +114,20 @@ iseq_mark(void *ptr)
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 newcbase)
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 newcbase)
if (newcbase) {
RB_OBJ_WRITE(iseq1->self, &iseq1->klass, newcbase);
}
+ else {
+ RB_OBJ_WRITTEN(iseq1->self, Qundef, iseq1->klass);
+ }
return newiseq;
}