From 42bd731dc53406d04e4397ec673b3acbb3a79bfc Mon Sep 17 00:00:00 2001 From: ko1 Date: Mon, 4 Nov 2013 15:04:10 +0000 Subject: [PATCH] * include/ruby/ruby.h: rename FL_OLDGEN to FL_PROMOTED. This flag represents that "this object is promoted at least once." * gc.c, debug.c, object.c: catch up this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ debug.c | 2 +- gc.c | 14 +++++++------- include/ruby/ruby.h | 10 +++++----- object.c | 2 +- 5 files changed, 21 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index affcbabb38..e479d7e575 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue Nov 5 00:02:00 2013 Koichi Sasada + + * include/ruby/ruby.h: rename FL_OLDGEN to FL_PROMOTED. + This flag represents that "this object is promoted at least once." + + * gc.c, debug.c, object.c: catch up this change. + Mon Nov 4 22:20:16 2013 Tanaka Akira * test/xmlrpc: Don't use fixed ports: 8070 and 8071. diff --git a/debug.c b/debug.c index be70dafec3..2f1e03cc3a 100644 --- a/debug.c +++ b/debug.c @@ -34,7 +34,7 @@ const union { RUBY_ENC_CODERANGE_VALID = ENC_CODERANGE_VALID, RUBY_ENC_CODERANGE_BROKEN = ENC_CODERANGE_BROKEN, RUBY_FL_WB_PROTECTED = FL_WB_PROTECTED, - RUBY_FL_OLDGEN = FL_OLDGEN, + RUBY_FL_PROMOTED = FL_PROMOTED, RUBY_FL_FINALIZE = FL_FINALIZE, RUBY_FL_TAINT = FL_TAINT, RUBY_FL_EXIVAR = FL_EXIVAR, diff --git a/gc.c b/gc.c index b7fdb850c4..124140b80b 100644 --- a/gc.c +++ b/gc.c @@ -622,7 +622,7 @@ static void rgengc_rememberset_mark(rb_objspace_t *objspace, rb_heap_t *heap); #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_SHADY(obj) (!FL_TEST2((check_bitmap_consistency((VALUE)obj)), FL_WB_PROTECTED)) -#define RVALUE_PROMOTED(obj) FL_TEST2(check_bitmap_consistency((VALUE)obj), FL_OLDGEN) +#define RVALUE_PROMOTED(obj) FL_TEST2(check_bitmap_consistency((VALUE)obj), FL_PROMOTED) #define RVALUE_PROMOTED_FROM_BITMAP(x) MARKED_IN_BITMAP(GET_HEAP_OLDGEN_BITS(x),x) @@ -632,9 +632,9 @@ check_bitmap_consistency(VALUE obj) #if RUBY_CHECK_MODE > 0 int oldgen_bitmap = MARKED_IN_BITMAP(GET_HEAP_OLDGEN_BITS(obj), obj) != 0; - if (FL_TEST2((obj), FL_OLDGEN) != oldgen_bitmap) { + if (FL_TEST2((obj), FL_PROMOTED) != oldgen_bitmap) { rb_bug("check_bitmap_consistency: oldgen flag of %p (%s) is %d, but bitmap is %d", - (void *)obj, obj_type_name(obj), FL_TEST2((obj), FL_OLDGEN), oldgen_bitmap); + (void *)obj, obj_type_name(obj), FL_TEST2((obj), FL_PROMOTED), oldgen_bitmap); } if (FL_TEST2((obj), FL_WB_PROTECTED)) { /* non-shady */ @@ -655,7 +655,7 @@ RVALUE_PROMOTE(VALUE obj) { check_bitmap_consistency(obj); MARK_IN_BITMAP(GET_HEAP_OLDGEN_BITS(obj), obj); - FL_SET2(obj, FL_OLDGEN); + FL_SET2(obj, FL_PROMOTED); #if RGENGC_PROFILE >= 1 { rb_objspace_t *objspace = &rb_objspace; @@ -671,7 +671,7 @@ static inline void RVALUE_DEMOTE(VALUE obj) { check_bitmap_consistency(obj); - FL_UNSET2(obj, FL_OLDGEN); + FL_UNSET2(obj, FL_PROMOTED); CLEAR_IN_BITMAP(GET_HEAP_OLDGEN_BITS(obj), obj); } #endif @@ -3767,8 +3767,8 @@ gc_oldgen_bitmap2flag(struct heap_page *page) RVALUE *pend = p + page->limit; while (p < pend) { - if (MARKED_IN_BITMAP(oldgen_bits, p)) FL_SET2(p, FL_OLDGEN); - else FL_UNSET2(p, FL_OLDGEN); + if (MARKED_IN_BITMAP(oldgen_bits, p)) FL_SET2(p, FL_PROMOTED); + else FL_UNSET2(p, FL_PROMOTED); p++; } } diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 5c75ff456e..06e89a93fe 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -1124,7 +1124,7 @@ struct RBignum { #define FL_SINGLETON FL_USER0 #define FL_WB_PROTECTED (((VALUE)1)<<5) -#define FL_OLDGEN (((VALUE)1)<<6) +#define FL_PROMOTED (((VALUE)1)<<6) #define FL_FINALIZE (((VALUE)1)<<7) #define FL_TAINT (((VALUE)1)<<8) #define FL_UNTRUSTED FL_TAINT @@ -1178,7 +1178,7 @@ struct RBignum { #define OBJ_FREEZE(x) FL_SET((x), FL_FREEZE) #if USE_RGENGC -#define OBJ_PROMOTED(x) (SPECIAL_CONST_P(x) ? 0 : FL_TEST_RAW((x), FL_OLDGEN)) +#define OBJ_PROMOTED(x) (SPECIAL_CONST_P(x) ? 0 : FL_TEST_RAW((x), FL_PROMOTED)) #define OBJ_WB_PROTECTED(x) (SPECIAL_CONST_P(x) ? 1 : FL_TEST_RAW((x), FL_WB_PROTECTED)) #define OBJ_WB_UNPROTECT(x) rb_obj_wb_unprotect(x, __FILE__, __LINE__) @@ -1215,7 +1215,7 @@ rb_obj_wb_unprotect(VALUE x, RB_UNUSED_VAR(const char *filename), RB_UNUSED_VAR( if (FL_TEST_RAW((x), FL_WB_PROTECTED)) { RBASIC(x)->flags &= ~FL_WB_PROTECTED; - if (FL_TEST_RAW((x), FL_OLDGEN)) { + if (FL_TEST_RAW((x), FL_PROMOTED)) { rb_gc_writebarrier_unprotect_promoted(x); } } @@ -1232,8 +1232,8 @@ rb_obj_written(VALUE a, RB_UNUSED_VAR(VALUE oldv), VALUE b, RB_UNUSED_VAR(const #if USE_RGENGC /* `a' should be an RVALUE object */ - if (FL_TEST_RAW((a), FL_OLDGEN) && - !SPECIAL_CONST_P(b) && !FL_TEST_RAW((b), FL_OLDGEN)) { + if (FL_TEST_RAW((a), FL_PROMOTED) && + !SPECIAL_CONST_P(b) && !FL_TEST_RAW((b), FL_PROMOTED)) { rb_gc_writebarrier(a, b); } #endif diff --git a/object.c b/object.c index c52916b3bc..e7b61d6687 100644 --- a/object.c +++ b/object.c @@ -336,7 +336,7 @@ rb_obj_clone(VALUE obj) } clone = rb_obj_alloc(rb_obj_class(obj)); RBASIC(clone)->flags &= FL_TAINT; - RBASIC(clone)->flags |= RBASIC(obj)->flags & ~(FL_OLDGEN|FL_FREEZE|FL_FINALIZE); + RBASIC(clone)->flags |= RBASIC(obj)->flags & ~(FL_PROMOTED|FL_FREEZE|FL_FINALIZE); singleton = rb_singleton_class_clone_and_attach(obj, clone); RBASIC_SET_CLASS(clone, singleton);