Граф коммитов

31681 Коммитов

Автор SHA1 Сообщение Дата
akr 9310247f50 * bignum.c (integer_unpack_single_bdigit): Use a cast.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-23 08:30:49 +00:00
ko1 4ab37a13ce * bootstraptest/test_thread.rb: rescue resource limitation errors.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-23 06:41:37 +00:00
akr 6983595935 * bignum.c (integer_unpack_single_bdigit): Extracted from
bary_unpack_internal.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 23:20:22 +00:00
akr a53a6281cf * bignum.c (bary_unpack_internal): Suppress warnings (C4146) on Visual Studio.
Reported by ko1 via IRC.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 22:43:47 +00:00
ko1 982fee4fcc * 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().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 21:54:10 +00:00
nobu 3cf42a0b2d * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 20:51:06 +00:00
ko1 7da562e740 * class.c (rb_include_class_new), eval.c (rb_using_refinement):
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
2013-06-22 20:48:35 +00:00
akr 93ec82ca77 * bignum.c (bytes_zero_p): Removed.
(bary_pack): Don't call bytes_zero_p.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 16:29:43 +00:00
akr f175d5259c * bignum.c (bytes_zero_p): Extracted from bary_pack.
(bary_pack): Use bytes_zero_p.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 15:52:36 +00:00
akr 31415e5809 * bignum.c (MSB): New macro.
(bary_unpack_internal): Use MSB.
  (bary_divmod): Ditto.
  (bigdivrem): Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 15:21:27 +00:00
svn 076de96c48 * 2013-06-23
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 15:02:12 +00:00
akr b3ad6f0648 Update comments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 15:02:08 +00:00
akr 6cbeb417e9 Unused code removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 14:55:31 +00:00
akr 9ab8ab38d8 * bignum.c (bary_swap): New function.
(bary_pack): Use bary_swap.
  (bary_unpack_internal): Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 14:51:48 +00:00
akr 963d678953 * bignum.c (bytes_2comp): Renamed from quad_buf_complement.
(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
2013-06-22 14:28:50 +00:00
akr edc338875e * bignum.c (rb_integer_unpack): Don't allocate a Bignum if possible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 12:48:45 +00:00
kazu 5bcfc7d2c7 fix a typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 12:11:33 +00:00
akr cdd1c04453 * pack.c (pack_unpack): Remove specialized unpackers for integers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 12:05:31 +00:00
akr 972ae3e538 * bignum.c (bary_unpack_internal): Specialized unpacker implemented.
(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
2013-06-22 11:38:19 +00:00
akr 8f0c3ff6e4 * bignum.c (bary_pack): Support
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
2013-06-22 09:55:27 +00:00
ko1 d73b9320cc * gc.c (rgengc_check_shady): add new WB miss checking
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
2013-06-22 06:43:30 +00:00
charliesome 98fec7b4a2 * ext/etc/etc.c (setup_passwd): revert r41560, unnecessary
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 06:26:32 +00:00
charliesome 3f236ce7ba * ext/etc/etc.c (Init_etc): omit 'passwd' from definition of Etc::Passwd
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
2013-06-22 05:43:08 +00:00
akr 4b4ba84eb8 * ext/dl/cfunc.c (rb_dlcfunc_call): Use rb_big_pack instead of
rb_big2ulong_pack and rb_big2ull.

* include/ruby/intern.h (rb_big2ulong_pack): Deprecated.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 05:37:30 +00:00
charliesome 1a2c400273 * ext/etc/etc.c (setup_passwd): pass 0 as VALUE to rb_struct_new to
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
2013-06-22 05:35:23 +00:00
akr 042fe1ea91 * bignum.c (bary_pack): MEMZERO can be used even if nails is not zero.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 04:56:37 +00:00
charliesome ff0e82ed9d * ext/etc/etc.c (etc_getpwnam): use PRIsVALUE in format string instead
of %s and RSTRING_PTR

* ext/etc/etc.c (etc_getgrnam): ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 04:46:47 +00:00
akr d0690f97de * bignum.c (CLEAR_LOWBITS): Rewritten without RSHIFTX.
(RSHIFTX): Removed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 04:12:48 +00:00
akr 654a40a33a * pack.c (num2i32): Removed.
(pack_pack): Don't use num2i32.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 01:39:15 +00:00
nobu d9119160be load.c: suppress warning
* load.c (rb_load_internal): suppress clobbered-by-longjmp warning by
  gcc 4.4.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 01:27:17 +00:00
akr afb03d1646 * bignum.c (LSHIFTX): Defined to suppress a warning.
(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
2013-06-22 00:56:53 +00:00
ryan c816f90e76 Imported minitest 4.7.5 (r8724)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22 00:20:05 +00:00
ko1 a59e629868 * gc.c (gc_prof_set_heap_info, after_gc_sweep): call
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
2013-06-21 22:29:09 +00:00
ko1 dbd8f3ac03 * gc.c (rb_objspace::profile): rename rb_objspace::profile::record to
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
2013-06-21 21:51:41 +00:00
ko1 b4f907ea29 * gc.c (rb_gc_giveup_promoted_writebarrier): remove `rest_sweep()'
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
2013-06-21 21:08:38 +00:00
ko1 7396fbb0b5 * gc.c (rgengc_rememberset_mark): call gc_mark_children() for
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
2013-06-21 20:10:03 +00:00
ko1 4223f00713 * include/ruby/ruby.h (OBJ_WRITE): cast to (VALUE *) for second
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
2013-06-21 19:52:40 +00:00
ko1 671c196384 * gc.c (slot_sweep_body): rename to slot_sweep().
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
2013-06-21 19:42:04 +00:00
ko1 a27c48f69e * gc.c (check_bitmap_consistency): add to check flag and bitmap consistency.
Use this function in several places.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-21 19:36:48 +00:00
svn f8a0185347 * 2013-06-22
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-21 17:22:18 +00:00
akr 8e9c9ec8e4 * bignum.c (bary_pack): Specialized packers implemented.
(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
2013-06-21 17:22:14 +00:00
kazu 6503d88312 fix a typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-21 13:00:18 +00:00
kazu 345748ff0f fix a typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-21 12:49:58 +00:00
nobu 15c4b821a1 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-21 12:36:06 +00:00
tarui 913e65448d * gc.c (typedef enum): Introdule flags of major gc reason.
* gc.c (garbage_collect_body): Ditto.
	* gc.c (gc_profile_flags): Ditto.
	* gc.c (gc_profile_dump_on): Ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-21 12:31:13 +00:00
ko1 79d3385e9d * gc.c (allocate_sorted_heaps): remove unused variable `add'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-21 12:12:57 +00:00
ko1 508b255b9a * include/ruby/ruby.h: constify RArray::as::ary and RArray::heap::ptr.
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
2013-06-21 11:53:33 +00:00
ko1 c2269d9aad * vm_eval.c (eval_string_with_cref): fix WB miss.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-21 11:32:57 +00:00
nobu 892736a7f8 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-21 11:26:05 +00:00
ko1 6a1101f23e * include/ruby/ruby.h: support write barrier protection for T_STRUCT.
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
2013-06-21 11:22:18 +00:00