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

ruby-changes:29530

From: ko1 <ko1@a...>
Date: Sun, 23 Jun 2013 06:54:22 +0900 (JST)
Subject: [ruby-changes:29530] ko1:r41582 (trunk): * include/ruby/ruby.h, gc.c: rename macros and functions:

ko1	2013-06-23 06:54:10 +0900 (Sun, 23 Jun 2013)

  New Revision: 41582

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

  Log:
    * include/ruby/ruby.h, gc.c: rename macros and functions:
      OBJ_WB_GIVEUP() -> OBJ_WB_UNPROTECT(),
      rb_obj_wb_giveup() -> rb_obj_wb_unprotect(),
      rb_gc_giveup_promoted_writebarrier() ->
      rb_gc_writebarrier_unprotect_promoted(),
    * class.c, eval.c, hash.c: use OBJ_WB_UNPROTECT().

  Modified files:
    trunk/ChangeLog
    trunk/class.c
    trunk/eval.c
    trunk/gc.c
    trunk/hash.c
    trunk/include/ruby/ruby.h

Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 41581)
+++ include/ruby/ruby.h	(revision 41582)
@@ -972,7 +972,7 @@ struct RArray { https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L972
     OBJ_WRITE(_ary_, &RARRAY_RAWPTR(_ary_)[i], (v)); \
 } while (0)
 
-#define RARRAY_PTR(a) ((VALUE *)RARRAY_RAWPTR(RGENGC_WB_PROTECTED_ARRAY ? OBJ_WB_GIVEUP((VALUE)a) : ((VALUE)a)))
+#define RARRAY_PTR(a) ((VALUE *)RARRAY_RAWPTR(RGENGC_WB_PROTECTED_ARRAY ? OBJ_WB_UNPROTECT((VALUE)a) : ((VALUE)a)))
 
 struct RRegexp {
     struct RBasic basic;
@@ -1129,7 +1129,7 @@ struct RStruct { https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1129
   ((RBASIC(st)->flags & RSTRUCT_EMBED_LEN_MASK) ? \
    RSTRUCT(st)->as.ary : \
    RSTRUCT(st)->as.heap.ptr)
-#define RSTRUCT_PTR(st) ((VALUE *)RSTRUCT_RAWPTR(RGENGC_WB_PROTECTED_STRUCT ? OBJ_WB_GIVEUP((VALUE)st) : (VALUE)st))
+#define RSTRUCT_PTR(st) ((VALUE *)RSTRUCT_RAWPTR(RGENGC_WB_PROTECTED_STRUCT ? OBJ_WB_UNPROTECT((VALUE)st) : (VALUE)st))
 
 #define RSTRUCT_SET(st, idx, v) OBJ_WRITE(st, &RSTRUCT_RAWPTR(st)[idx], (v))
 #define RSTRUCT_GET(st, idx)    (RSTRUCT_RAWPTR(st)[idx])
@@ -1245,27 +1245,25 @@ struct RBignum { https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1245
 #if USE_RGENGC
 #define OBJ_PROMOTED(x)             (SPECIAL_CONST_P(x) ? 0 : FL_TEST_RAW((x), FL_OLDGEN))
 #define OBJ_WB_PROTECTED(x)         (SPECIAL_CONST_P(x) ? 1 : FL_TEST_RAW((x), FL_WB_PROTECTED))
-#define OBJ_WB_GIVEUP(x)            rb_obj_wb_giveup(x, __FILE__, __LINE__)
-#define OBJ_WB_
+#define OBJ_WB_UNPROTECT(x)         rb_obj_wb_unprotect(x, __FILE__, __LINE__)
 
 void rb_gc_writebarrier(VALUE a, VALUE b);
-void rb_gc_giveup_promoted_writebarrier(VALUE obj);
+void rb_gc_writebarrier_unprotect_promoted(VALUE obj);
 
 #else /* USE_RGENGC */
 #define OBJ_PROMOTED(x)             0
 #define OBJ_WB_PROTECTED(x)         0
-#define OBJ_WB_GIVEUP(x)            rb_obj_wb_giveup(x, __FILE__, __LINE__)
-#define OBJ_SHADE(x)                OBJ_WB_GIVEUP(x) /* RGENGC terminology */
+#define OBJ_WB_UNPROTECT(x)         rb_obj_wb_unprotect(x, __FILE__, __LINE__)
 #endif
 
 #define OBJ_WRITE(a, slot, b)       rb_obj_write((VALUE)(a), (VALUE *)(slot), (VALUE)(b), __FILE__, __LINE__)
 #define OBJ_WRITTEN(a, oldv, b)     rb_obj_written((VALUE)(a), (VALUE)(oldv), (VALUE)(b), __FILE__, __LINE__)
 
 static inline VALUE
-rb_obj_wb_giveup(VALUE x, const char *filename, int line)
+rb_obj_wb_unprotect(VALUE x, const char *filename, int line)
 {
-#ifdef RGENGC_LOGGING_WB_GIVEUP
-    RGENGC_LOGGING_WB_GIVEUP(x, filename, line);
+#ifdef RGENGC_LOGGING_WB_UNPROTECT
+    RGENGC_LOGGING_WB_UNPROTECT(x, filename, line);
 #endif
 
 #if USE_RGENGC
@@ -1274,7 +1272,7 @@ rb_obj_wb_giveup(VALUE x, const char *fi https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1272
 	RBASIC(x)->flags &= ~FL_WB_PROTECTED;
 
 	if (FL_TEST_RAW((x), FL_OLDGEN)) {
-	    rb_gc_giveup_promoted_writebarrier(x);
+	    rb_gc_writebarrier_unprotect_promoted(x);
 	}
     }
 #endif
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41581)
+++ ChangeLog	(revision 41582)
@@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Jun 23 06:49:28 2013  Koichi Sasada  <ko1@a...>
+
+	* include/ruby/ruby.h, gc.c: rename macros and functions:
+	  OBJ_WB_GIVEUP() -> OBJ_WB_UNPROTECT(),
+	  rb_obj_wb_giveup() -> rb_obj_wb_unprotect(),
+	  rb_gc_giveup_promoted_writebarrier() ->
+	  rb_gc_writebarrier_unprotect_promoted(),
+
+	* class.c, eval.c, hash.c: use OBJ_WB_UNPROTECT().
+
 Sun Jun 23 05:41:32 2013  Koichi Sasada  <ko1@a...>
 
 	* class.c (rb_include_class_new), eval.c (rb_using_refinement):
Index: eval.c
===================================================================
--- eval.c	(revision 41581)
+++ eval.c	(revision 41582)
@@ -1100,7 +1100,7 @@ rb_using_refinement(NODE *cref, VALUE kl https://github.com/ruby/ruby/blob/trunk/eval.c#L1100
     c = iclass = rb_include_class_new(module, superclass);
     RCLASS_REFINED_CLASS(c) = klass;
 
-    RCLASS_M_TBL(OBJ_WB_GIVEUP(c)) = RCLASS_M_TBL(OBJ_WB_GIVEUP(module));
+    RCLASS_M_TBL(OBJ_WB_UNPROTECT(c)) = RCLASS_M_TBL(OBJ_WB_UNPROTECT(module));
 
     module = RCLASS_SUPER(module);
     while (module && module != klass) {
Index: gc.c
===================================================================
--- gc.c	(revision 41581)
+++ gc.c	(revision 41582)
@@ -3876,16 +3876,16 @@ rb_gc_writebarrier(VALUE a, VALUE b) https://github.com/ruby/ruby/blob/trunk/gc.c#L3876
 }
 
 void
-rb_gc_giveup_promoted_writebarrier(VALUE obj)
+rb_gc_writebarrier_unprotect_promoted(VALUE obj)
 {
     rb_objspace_t *objspace = &rb_objspace;
 
     if (RGENGC_CHECK_MODE) {
-	if (!RVALUE_PROMOTED(obj)) rb_bug("rb_gc_giveup_promoted_writebarrier: called on non-promoted object");
-	if (!RVALUE_SHADY(obj)) rb_bug("rb_gc_giveup_promoted_writebarrier: called on non-shady object");
+	if (!RVALUE_PROMOTED(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 non-shady object");
     }
 
-    rgengc_report(2, objspace, "rb_gc_giveup_writebarrier: %p (%s)%s\n", (void *)obj, obj_type_name(obj),
+    rgengc_report(2, objspace, "rb_gc_writebarrier_unprotect_promoted: %p (%s)%s\n", (void *)obj, obj_type_name(obj),
 		  rgengc_remembered(objspace, obj) ? " (already remembered)" : "");
 
     RVALUE_DEMOTE(obj);
Index: class.c
===================================================================
--- class.c	(revision 41581)
+++ class.c	(revision 41582)
@@ -690,7 +690,7 @@ rb_include_class_new(VALUE module, VALUE https://github.com/ruby/ruby/blob/trunk/class.c#L690
     RCLASS_IV_TBL(klass) = RCLASS_IV_TBL(module);
     RCLASS_CONST_TBL(klass) = RCLASS_CONST_TBL(module);
 
-    RCLASS_M_TBL(OBJ_WB_GIVEUP(klass)) = RCLASS_M_TBL(OBJ_WB_GIVEUP(RCLASS_ORIGIN(module)));
+    RCLASS_M_TBL(OBJ_WB_UNPROTECT(klass)) = RCLASS_M_TBL(OBJ_WB_UNPROTECT(RCLASS_ORIGIN(module)));
 
     RCLASS_SET_SUPER(klass, super);
     if (RB_TYPE_P(module, T_ICLASS)) {
Index: hash.c
===================================================================
--- hash.c	(revision 41581)
+++ hash.c	(revision 41582)
@@ -298,7 +298,7 @@ hash_tbl(VALUE hash) https://github.com/ruby/ruby/blob/trunk/hash.c#L298
 struct st_table *
 rb_hash_tbl(VALUE hash)
 {
-    OBJ_WB_GIVEUP(hash);
+    OBJ_WB_UNPROTECT(hash);
     return hash_tbl(hash);
 }
 

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

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