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

ruby-changes:32084

From: ko1 <ko1@a...>
Date: Fri, 13 Dec 2013 11:38:14 +0900 (JST)
Subject: [ruby-changes:32084] ko1:r44163 (trunk): * gc.c: rename *shady* func/macros.

ko1	2013-12-13 11:38:05 +0900 (Fri, 13 Dec 2013)

  New Revision: 44163

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44163

  Log:
    * gc.c: rename *shady* func/macros.
      * RVALUE_RAW_SHADY()   -> RVALUE_WB_PROTECTED_RAW()
      * RVALUE_SHADY()       -> RVALUE_RAW_SHADY()
      * rgengc_check_shady() -> rgengc_check_relation().
      And fix some messages using "shady" to "non-WB-protected".

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 44162)
+++ ChangeLog	(revision 44163)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Dec 13 11:33:55 2013  Koichi Sasada  <ko1@a...>
+
+	* gc.c: rename *shady* func/macros.
+	  * RVALUE_RAW_SHADY()   -> RVALUE_WB_PROTECTED_RAW()
+	  * RVALUE_SHADY()       -> RVALUE_RAW_SHADY()
+	  * rgengc_check_shady() -> rgengc_check_relation().
+	  And fix some messages using "shady" to "non-WB-protected".
+
 Fri Dec 13 10:04:23 2013  Eric Hodel  <drbrain@s...>
 
 	* lib/rubygems/request_set/lockfile.rb:  Import RubyGems master a8d0669
Index: gc.c
===================================================================
--- gc.c	(revision 44162)
+++ gc.c	(revision 44163)
@@ -696,8 +696,8 @@ static void rgengc_rememberset_mark(rb_o https://github.com/ruby/ruby/blob/trunk/gc.c#L696
 #define FL_SET2(x,f)          do {if (RGENGC_CHECK_MODE && SPECIAL_CONST_P(x)) rb_bug("FL_SET2: SPECIAL_CONST");   RBASIC(x)->flags |= (f);} while (0)
 #define FL_UNSET2(x,f)        do {if (RGENGC_CHECK_MODE && SPECIAL_CONST_P(x)) rb_bug("FL_UNSET2: SPECIAL_CONST"); RBASIC(x)->flags &= ~(f);} while (0)
 
-#define RVALUE_RAW_SHADY(obj)     (!FL_TEST2((obj), FL_WB_PROTECTED))
-#define RVALUE_SHADY(obj)         RVALUE_RAW_SHADY(check_gen_consistency((VALUE)obj))
+#define RVALUE_WB_PROTECTED_RAW(obj)     FL_TEST2((obj), FL_WB_PROTECTED)
+#define RVALUE_WB_PROTECTED(obj)         RVALUE_WB_PROTECTED_RAW(check_gen_consistency((VALUE)obj))
 
 #define RVALUE_OLDGEN_BITMAP(obj) MARKED_IN_BITMAP(GET_HEAP_OLDGEN_BITS(obj), (obj))
 
@@ -719,9 +719,9 @@ check_gen_consistency(VALUE obj) https://github.com/ruby/ruby/blob/trunk/gc.c#L719
 	}
 
 	if (promoted_flag) {
-	    if (RVALUE_RAW_SHADY(obj)) {
+	    if (!RVALUE_WB_PROTECTED_RAW(obj)) {
 		const char *type = old_flag ? "old" : "young";
-		rb_bug("check_gen_consistency: %p (%s) is shady, but %s object.", (void *)obj, obj_type_name(obj), type);
+		rb_bug("check_gen_consistency: %p (%s) is not WB protected, but %s object.", (void *)obj, obj_type_name(obj), type);
 	    }
 
 #if !RGENGC_THREEGEN
@@ -3527,11 +3527,11 @@ gc_mark_ptr(rb_objspace_t *objspace, VAL https://github.com/ruby/ruby/blob/trunk/gc.c#L3527
 }
 
 static void
-rgengc_check_shady(rb_objspace_t *objspace, VALUE obj)
+rgengc_check_relation(rb_objspace_t *objspace, VALUE obj)
 {
 #if USE_RGENGC
     if (objspace->rgengc.parent_object_is_old) {
-	if (RVALUE_SHADY(obj)) {
+	if (!RVALUE_WB_PROTECTED(obj)) {
 	    if (rgengc_remember(objspace, obj)) {
 		objspace->rgengc.remembered_shady_object_count++;
 	    }
@@ -3561,7 +3561,7 @@ gc_mark(rb_objspace_t *objspace, VALUE p https://github.com/ruby/ruby/blob/trunk/gc.c#L3561
     if (!is_markable_object(objspace, ptr)) return;
 
     if (LIKELY(objspace->mark_func_data == 0)) {
-	rgengc_check_shady(objspace, ptr);
+	rgengc_check_relation(objspace, ptr);
 	if (!gc_mark_ptr(objspace, ptr)) return; /* already marked */
 	push_mark_stack(&objspace->mark_stack, ptr);
     }
@@ -3601,7 +3601,7 @@ gc_mark_children(rb_objspace_t *objspace https://github.com/ruby/ruby/blob/trunk/gc.c#L3601
     if (LIKELY(objspace->mark_func_data == 0)) {
 	obj = RANY(ptr);
 	if (!is_markable_object(objspace, ptr)) return;
-	rgengc_check_shady(objspace, ptr);
+	rgengc_check_relation(objspace, ptr);
 	if (!gc_mark_ptr(objspace, ptr)) return;  /* already marked */
     }
     else {
@@ -3616,7 +3616,7 @@ gc_mark_children(rb_objspace_t *objspace https://github.com/ruby/ruby/blob/trunk/gc.c#L3616
 
     if (LIKELY(objspace->mark_func_data == 0)) {
 	/* minor/major common */
-	if (!RVALUE_SHADY(obj)) {
+	if (RVALUE_WB_PROTECTED(obj)) {
 	    if (RVALUE_INFANT_P((VALUE)obj)) {
 		/* infant -> young */
 		RVALUE_PROMOTE_INFANT((VALUE)obj);
@@ -3653,7 +3653,7 @@ gc_mark_children(rb_objspace_t *objspace https://github.com/ruby/ruby/blob/trunk/gc.c#L3653
 	    }
 	}
 	else {
-	    rgengc_report(3, objspace, "gc_mark_children: do not promote shady %p (%s).\n", (void *)obj, obj_type_name((VALUE)obj));
+	    rgengc_report(3, objspace, "gc_mark_children: do not promote non-WB-protected %p (%s).\n", (void *)obj, obj_type_name((VALUE)obj));
 	    objspace->rgengc.parent_object_is_old = FALSE;
 	}
     }
@@ -4307,8 +4307,8 @@ allrefs_dump_i(st_data_t k, st_data_t v, https://github.com/ruby/ruby/blob/trunk/gc.c#L4307
     struct reflist *refs = (struct reflist *)v;
     fprintf(stderr, "[allrefs_dump_i] %p (%s%s%s%s) <- ",
 	    (void *)obj, obj_type_name(obj),
-	    RVALUE_OLD_P(obj) ? "[O]" : "[Y]",
-	    RVALUE_SHADY(obj) ? "[S]" : "",
+	    RVALUE_OLD_P(obj)        ? "[O]" : "[Y]",
+	    RVALUE_WB_PROTECTED(obj) ? "[W]" : "",
 	    MARKED_IN_BITMAP(GET_HEAP_REMEMBERSET_BITS(obj), obj) ? "[R]" : "");
     reflist_dump(refs);
     fprintf(stderr, "\n");
@@ -4521,7 +4521,7 @@ static int https://github.com/ruby/ruby/blob/trunk/gc.c#L4521
 rgengc_remember(rb_objspace_t *objspace, VALUE obj)
 {
     rgengc_report(2, objspace, "rgengc_remember: %p (%s, %s) %s\n", (void *)obj, obj_type_name(obj),
-		  RVALUE_SHADY(obj) ? "shady" : "non-shady",
+		  RVALUE_WB_PROTECTED(obj) ? "WB-protected" : "non-WB-protected",
 		  rgengc_remembersetbits_get(objspace, obj) ? "was already remembered" : "is remembered now");
 
 #if RGENGC_CHECK_MODE > 0
@@ -4539,22 +4539,20 @@ rgengc_remember(rb_objspace_t *objspace, https://github.com/ruby/ruby/blob/trunk/gc.c#L4539
 
     if (RGENGC_PROFILE) {
 	if (!rgengc_remembered(objspace, obj)) {
-	    if (!RVALUE_SHADY(obj)) {
 #if RGENGC_PROFILE > 0
+	    if (RVALUE_WB_PROTECTED(obj)) {
 		objspace->profile.remembered_normal_object_count++;
 #if RGENGC_PROFILE >= 2
 		objspace->profile.remembered_normal_object_count_types[BUILTIN_TYPE(obj)]++;
 #endif
-#endif
 	    }
 	    else {
-#if RGENGC_PROFILE > 0
 		objspace->profile.remembered_shady_object_count++;
 #if RGENGC_PROFILE >= 2
 		objspace->profile.remembered_shady_object_count_types[BUILTIN_TYPE(obj)]++;
 #endif
-#endif
 	    }
+#endif /* RGENGC_PROFILE > 0 */
 	}
     }
 
@@ -4596,7 +4594,7 @@ rgengc_rememberset_mark(rb_objspace_t *o https://github.com/ruby/ruby/blob/trunk/gc.c#L4594
 			/* mark before RVALUE_PROMOTE_... */
 			gc_mark_ptr(objspace, (VALUE)p);
 
-			if (!RVALUE_SHADY(p)) {
+			if (RVALUE_WB_PROTECTED(p)) {
 			    rgengc_report(2, objspace, "rgengc_rememberset_mark: clear %p (%s)\n", p, obj_type_name((VALUE)p));
 #if RGENGC_THREEGEN
 			    if (RVALUE_INFANT_P((VALUE)p)) RVALUE_PROMOTE_INFANT((VALUE)p);
@@ -4686,7 +4684,7 @@ rb_gc_writebarrier_unprotect_promoted(VA https://github.com/ruby/ruby/blob/trunk/gc.c#L4684
 
     if (RGENGC_CHECK_MODE) {
 	if (!RVALUE_PROMOTED_P(obj)) rb_bug("rb_gc_writebarrier_unprotect_promoted: called on non-promoted object");
-	if (RVALUE_SHADY(obj)) rb_bug("rb_gc_writebarrier_unprotect_promoted: called on shady object");
+	if (!RVALUE_WB_PROTECTED(obj)) rb_bug("rb_gc_writebarrier_unprotect_promoted: called on shady object");
     }
 
     rgengc_report(0, objspace, "rb_gc_writebarrier_unprotect_promoted: %p (%s)%s\n", (void *)obj, obj_type_name(obj),
@@ -7277,14 +7275,14 @@ rb_gcdebug_print_obj_condition(VALUE obj https://github.com/ruby/ruby/blob/trunk/gc.c#L7275
         return;
     }
 
-    fprintf(stderr, "marked?    : %s\n", MARKED_IN_BITMAP(GET_HEAP_MARK_BITS(obj), obj) ? "true" : "false");
+    fprintf(stderr, "marked?      : %s\n", MARKED_IN_BITMAP(GET_HEAP_MARK_BITS(obj), obj) ? "true" : "false");
 #if USE_RGENGC
 #if RGENGC_THREEGEN
-    fprintf(stderr, "young?     : %s\n", RVALUE_YOUNG_P(obj) ? "true" : "false");
+    fprintf(stderr, "young?       : %s\n", RVALUE_YOUNG_P(obj) ? "true" : "false");
 #endif
-    fprintf(stderr, "old?       : %s\n", RVALUE_OLD_P(obj) ? "true" : "false");
-    fprintf(stderr, "shady?     : %s\n", RVALUE_SHADY(obj) ? "true" : "false");
-    fprintf(stderr, "remembered?: %s\n", MARKED_IN_BITMAP(GET_HEAP_REMEMBERSET_BITS(obj), obj) ? "true" : "false");
+    fprintf(stderr, "old?         : %s\n", RVALUE_OLD_P(obj) ? "true" : "false");
+    fprintf(stderr, "WB-protected?: %s\n", RVALUE_WB_PROTECTED(obj) ? "true" : "false");
+    fprintf(stderr, "remembered?  : %s\n", MARKED_IN_BITMAP(GET_HEAP_REMEMBERSET_BITS(obj), obj) ? "true" : "false");
 #endif
 
     if (is_lazy_sweeping(heap_eden)) {

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

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