зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
7a3f2845df
Коммит
42bd731dc5
|
@ -1,3 +1,10 @@
|
||||||
|
Tue Nov 5 00:02:00 2013 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* 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 <akr@fsij.org>
|
Mon Nov 4 22:20:16 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* test/xmlrpc: Don't use fixed ports: 8070 and 8071.
|
* test/xmlrpc: Don't use fixed ports: 8070 and 8071.
|
||||||
|
|
2
debug.c
2
debug.c
|
@ -34,7 +34,7 @@ const union {
|
||||||
RUBY_ENC_CODERANGE_VALID = ENC_CODERANGE_VALID,
|
RUBY_ENC_CODERANGE_VALID = ENC_CODERANGE_VALID,
|
||||||
RUBY_ENC_CODERANGE_BROKEN = ENC_CODERANGE_BROKEN,
|
RUBY_ENC_CODERANGE_BROKEN = ENC_CODERANGE_BROKEN,
|
||||||
RUBY_FL_WB_PROTECTED = FL_WB_PROTECTED,
|
RUBY_FL_WB_PROTECTED = FL_WB_PROTECTED,
|
||||||
RUBY_FL_OLDGEN = FL_OLDGEN,
|
RUBY_FL_PROMOTED = FL_PROMOTED,
|
||||||
RUBY_FL_FINALIZE = FL_FINALIZE,
|
RUBY_FL_FINALIZE = FL_FINALIZE,
|
||||||
RUBY_FL_TAINT = FL_TAINT,
|
RUBY_FL_TAINT = FL_TAINT,
|
||||||
RUBY_FL_EXIVAR = FL_EXIVAR,
|
RUBY_FL_EXIVAR = FL_EXIVAR,
|
||||||
|
|
14
gc.c
14
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 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_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)
|
#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
|
#if RUBY_CHECK_MODE > 0
|
||||||
int oldgen_bitmap = MARKED_IN_BITMAP(GET_HEAP_OLDGEN_BITS(obj), obj) != 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",
|
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)) {
|
if (FL_TEST2((obj), FL_WB_PROTECTED)) {
|
||||||
/* non-shady */
|
/* non-shady */
|
||||||
|
@ -655,7 +655,7 @@ RVALUE_PROMOTE(VALUE obj)
|
||||||
{
|
{
|
||||||
check_bitmap_consistency(obj);
|
check_bitmap_consistency(obj);
|
||||||
MARK_IN_BITMAP(GET_HEAP_OLDGEN_BITS(obj), obj);
|
MARK_IN_BITMAP(GET_HEAP_OLDGEN_BITS(obj), obj);
|
||||||
FL_SET2(obj, FL_OLDGEN);
|
FL_SET2(obj, FL_PROMOTED);
|
||||||
#if RGENGC_PROFILE >= 1
|
#if RGENGC_PROFILE >= 1
|
||||||
{
|
{
|
||||||
rb_objspace_t *objspace = &rb_objspace;
|
rb_objspace_t *objspace = &rb_objspace;
|
||||||
|
@ -671,7 +671,7 @@ static inline void
|
||||||
RVALUE_DEMOTE(VALUE obj)
|
RVALUE_DEMOTE(VALUE obj)
|
||||||
{
|
{
|
||||||
check_bitmap_consistency(obj);
|
check_bitmap_consistency(obj);
|
||||||
FL_UNSET2(obj, FL_OLDGEN);
|
FL_UNSET2(obj, FL_PROMOTED);
|
||||||
CLEAR_IN_BITMAP(GET_HEAP_OLDGEN_BITS(obj), obj);
|
CLEAR_IN_BITMAP(GET_HEAP_OLDGEN_BITS(obj), obj);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -3767,8 +3767,8 @@ gc_oldgen_bitmap2flag(struct heap_page *page)
|
||||||
RVALUE *pend = p + page->limit;
|
RVALUE *pend = p + page->limit;
|
||||||
|
|
||||||
while (p < pend) {
|
while (p < pend) {
|
||||||
if (MARKED_IN_BITMAP(oldgen_bits, p)) FL_SET2(p, FL_OLDGEN);
|
if (MARKED_IN_BITMAP(oldgen_bits, p)) FL_SET2(p, FL_PROMOTED);
|
||||||
else FL_UNSET2(p, FL_OLDGEN);
|
else FL_UNSET2(p, FL_PROMOTED);
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1124,7 +1124,7 @@ struct RBignum {
|
||||||
|
|
||||||
#define FL_SINGLETON FL_USER0
|
#define FL_SINGLETON FL_USER0
|
||||||
#define FL_WB_PROTECTED (((VALUE)1)<<5)
|
#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_FINALIZE (((VALUE)1)<<7)
|
||||||
#define FL_TAINT (((VALUE)1)<<8)
|
#define FL_TAINT (((VALUE)1)<<8)
|
||||||
#define FL_UNTRUSTED FL_TAINT
|
#define FL_UNTRUSTED FL_TAINT
|
||||||
|
@ -1178,7 +1178,7 @@ struct RBignum {
|
||||||
#define OBJ_FREEZE(x) FL_SET((x), FL_FREEZE)
|
#define OBJ_FREEZE(x) FL_SET((x), FL_FREEZE)
|
||||||
|
|
||||||
#if USE_RGENGC
|
#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_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__)
|
#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)) {
|
if (FL_TEST_RAW((x), FL_WB_PROTECTED)) {
|
||||||
RBASIC(x)->flags &= ~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);
|
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
|
#if USE_RGENGC
|
||||||
/* `a' should be an RVALUE object */
|
/* `a' should be an RVALUE object */
|
||||||
if (FL_TEST_RAW((a), FL_OLDGEN) &&
|
if (FL_TEST_RAW((a), FL_PROMOTED) &&
|
||||||
!SPECIAL_CONST_P(b) && !FL_TEST_RAW((b), FL_OLDGEN)) {
|
!SPECIAL_CONST_P(b) && !FL_TEST_RAW((b), FL_PROMOTED)) {
|
||||||
rb_gc_writebarrier(a, b);
|
rb_gc_writebarrier(a, b);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
2
object.c
2
object.c
|
@ -336,7 +336,7 @@ rb_obj_clone(VALUE obj)
|
||||||
}
|
}
|
||||||
clone = rb_obj_alloc(rb_obj_class(obj));
|
clone = rb_obj_alloc(rb_obj_class(obj));
|
||||||
RBASIC(clone)->flags &= FL_TAINT;
|
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);
|
singleton = rb_singleton_class_clone_and_attach(obj, clone);
|
||||||
RBASIC_SET_CLASS(clone, singleton);
|
RBASIC_SET_CLASS(clone, singleton);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче