make classes/modules (who share method table) shady.
If module `a' and `b' shares method table m_tbl and new method
with iseq is added, then write barrier is applied only `a' or `b'.
To avoid this issue, shade such classes/modules.
* vm_method.c (rb_method_entry_make): add write barriers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(bary_pack): Use bytes_2comp.
(rb_quad_pack): Use rb_integer_pack.
(rb_quad_unpack): Use rb_integer_unpack.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(bary_unpack): Support INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION.
(rb_integer_unpack): Support INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION flag.
Fix byte order and word order handling in code specialized for
wordsize % SIZEOF_BDIGITS == 0.
* internal.h (INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION): Defined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
on RGENGC_CHECK_MODE >= 2.
(1) Save bitmaps before marking
(2) Run full marking
(3) On each traceable object,
(a) object was not oldgen (== newly or shady object) &&
(b) parent object was oldgen &&
(c) parent object was not remembered &&
(d) object was not rememberd
then, it should be WB miss.
This idea of this checker is by Masaya Tarui <tarui@ruby-lang.org>.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
if HAVE_STRUCT_PASSWD_PW_PASSWD is not defined to prevent mismatch of
fields and values in setup_passwd
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
prevent segfault if the compiler passes it as a 32 bit integer on
a 64 bit ruby
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(RSHIFTX): Ditto.
(CLEAR_LOWBITS): Use LSHIFTX and RSHIFTX.
(FILL_LOWBITS): Use LSHIFTX.
Reported by ko1 via IRC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
gc_prof_set_heap_info() just after sweeping to calculate
live object number correctly.
(live object number = total generated number (before marking) -
total freed number (after sweeping))
* gc.c (gc_marks): record `oldgen_object_count' into current profile`
record directly.
* gc.c (rgengc_rememberset_mark): same for remembered_normal_objects
and remembered_shady_objects.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
records (because it points a set of records) and add a field
rb_objspace::profile::current_record to point a current profiling
record.
* gc.c: use above fields.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
because all of remembered objects are called for gc_mark_children().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
remembered objects directly instead of pushing on the mark stack.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
parameter `slot'. You don't need to write a cast (VALUE *) any more.
* class.c, compile.c, hash.c, iseq.c, proc.c, re.c, variable.c,
vm.c, vm_method.c: remove cast expressions for OBJ_WRITE().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
No need to separate major/minor GC.
* gc.c (gc_setup_mark_bits): remove gc_clear_mark_bits() and unify to
this function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(HOST_BIGENDIAN_P): New macro.
(ALIGNOF): New macro.
(CLEAR_LOWBITS): New macro.
(FILL_LOWBITS): New macro.
(swap_bdigit): New macro.
(bary_2comp): Returns an int.
* internal.h (swap16): Moved from pack.c
(swap32): Ditto.
(swap64): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Use RARRAY_ASET() or RARRAY_PTR_USE() to modify Array objects.
* array.c, gc.c: catch up above changes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Introduce the following C APIs:
* RSTRUCT_RAWPTR(st) returns pointer (do WB on your risk).
The type of returned pointer is (const VALUE *).
* RSTRUCT_GET(st, idx) returns idx-th value of struct.
* RSTRUCT_SET(st, idx, v) set idx-th value by v with WB.
And
* RSTRUCT_PTR(st) returns pointer with shady operation.
The type of returned pointer is (VALUE *).
* struct.c, re.c, gc.c, marshal.c: rewrite with above APIs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e