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

ruby-changes:55282

From: tenderlove <ko1@a...>
Date: Wed, 10 Apr 2019 08:48:22 +0900 (JST)
Subject: [ruby-changes:55282] tenderlove:r67489 (trunk): Set a write barrier between iseq and mark objects

tenderlove	2019-04-10 08:48:17 +0900 (Wed, 10 Apr 2019)

  New Revision: 67489

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67489

  Log:
    Set a write barrier between iseq and mark objects
    
    ISeq pins references in the mark array during compile, so it manually
    marks references in the mark_ary.  This was causing write barrier
    misses, so we need to add a write barrier when pushing on the mark
    array.

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 67488)
+++ compile.c	(revision 67489)
@@ -574,6 +574,7 @@ static int https://github.com/ruby/ruby/blob/trunk/compile.c#L574
 iseq_add_mark_object_compile_time(const rb_iseq_t *iseq, VALUE v)
 {
     if (!SPECIAL_CONST_P(v)) {
+        rb_gc_writebarrier(iseq, v);
 	rb_ary_push(ISEQ_COMPILE_DATA(iseq)->mark_ary, v);
     }
     return COMPILE_OK;
@@ -583,6 +584,7 @@ static inline VALUE https://github.com/ruby/ruby/blob/trunk/compile.c#L584
 freeze_literal(rb_iseq_t *iseq, VALUE lit)
 {
     lit = rb_fstring(lit);
+    rb_gc_writebarrier(iseq, lit);
     rb_ary_push(ISEQ_COMPILE_DATA(iseq)->mark_ary, lit);
     return lit;
 }

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

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