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

37114 Коммитов

Автор SHA1 Сообщение Дата
normal eec651a05e test/-ext-/bug_reporter/test_bug_reporter.rb: fix race
Signal delivery is not immediate, so wait for signal delivery.

* test/-ext-/bug_reporter/test_bug_reporter.rb
  (test_bug_reporter_add): fix race

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-16 02:01:51 +00:00
normal 720ef2546d test/ruby/test_rubyoptions.rb: fix race
Signal delivery is not guaranteed to be immediate, a process may
exit before receiving signal it sent itself.

* test/ruby/test_rubyoptions.rb (test_segv_test): fix race

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-16 01:10:53 +00:00
nobu 8b1955d060 cont.c: fix typedef
* cont.c (rb_fiber_struct): remove useless typedef.
  [Feature #10341]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-16 00:19:22 +00:00
nobu c36e3466a6 cont.c: fix compile error
* cont.c (rb_fiber_t): fix compile error caused by move to
  vm_core.h at r47964.  [Feature #10341]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-16 00:17:44 +00:00
normal e03546fd4c test/ruby/test_process.rb: avoid killing wrong parent
We must capture intended target PID before forking, since
Process.ppid may change if parent dies (e.g. due to timeout)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-16 00:06:09 +00:00
normal d910af94d5 cont.c: fix when FIBER_USE_NATIVE is 0
* cont.c (fiber_store): restore references to next_fib (fix typo)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 23:40:33 +00:00
normal 397271caa3 cont.c: fix build when FIBER_USE_NATIVE is 0
* cont.c (fiber_store): remove references to nextfib

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 23:27:01 +00:00
akr f65a15b0cf update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 23:12:21 +00:00
normal 5c8c88a3e9 cont.c: Optimize fiber_switch callees
Remove some unnecessary VALUE/struct conversions and aggressively inline
functions used during fiber_switch. Either of these changes alone does
not yield significant performance increase, but in combination they
improve performance by ~6%.

Arguably, removal of separate VALUE/rb_fiber_t* variables also makes the
code more readable in a few places.

* vm_core.h: declare rb_fiber_t typedef
  (rb_thread_t): fiber and root_fiber become rb_fiber_t * (from VALUE)
* vm.c (rb_thread_mark): use rb_fiber_mark_self
* cont.c (rb_fiber_t): prev becomes rb_fiber_t * (from VALUE)
  (cont_mark, cont_free): simplify conditions
  (rb_fiber_mark_self): new function
  (fiber_mark): use rb_fiber_mark_self
  (cont_save_thread, cont_restore_thread): inline
  (cont_restore_thread): simplify
  (fiber_setcontext): simplify conditions
  (rb_cont_call): remove dereference
  (fiber_t_alloc): update for rb_fiber_t->prev type change
  (rb_fiber_start): ditto
  (fiber_current): extract from rb_fiber_current
  (return_fiber): move, simplify type checks
  (rb_fiber_current): use fiber_current
  (fiber_store): simplify type checks
  (fiber_switch): ditto, simplify call to fiber_setcontext,
   use fiber_current
  (rb_fiber_transfer): update for type changes
  (rb_fiber_terminate): move, use fiber_switch
  (rb_fiber_resume): update for type changes
  (rb_fiber_reset_root_local_storage): ditto
  (rb_fiber_yield): use rb_fiber_switch instead of rb_fiber_transfer
  (rb_fiber_m_transfer): ditto
  [ruby-core:65518] [Feature #10341]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 22:35:08 +00:00
normal 71fcbf22a4 cont.c (cont_save_thread): Sparse copying of thread data
Instead of copying the complete rb_thread_t struct (almost a kB),
selectively copy only those fields that will be needed later on.

* cont.c (rb_context_t): comment on saved_thread
  (cont_save_thread): sparse copy
  (cont_init): copy extra fields
  (fiber_init): use current thread VM stack size
  [ruby-core:65518] [Feature #10341]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 22:35:01 +00:00
normal baeb94fa3d cont.c: Small code cleanup
Remove variable that is used only once, several lines after
initialization.

* cont.c (cont_capture): remove unnecessary variable
  [ruby-core:65518] [Feature #10341]

Author: Knut Franke <Knut.Franke@gmx.de>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 22:34:53 +00:00
normal 0bd492c6bf cont.c: Code cleanup in fiber_switch/fiber_store
Defragment code blocks depending on FIBER_USE_NATIVE in order to make
the control flow (which is already non-trivial due to nonlocal jumps) in
each case more comprehensible.

Remove some unreachable code from fiber_switch (we've already excluded
the case (th->fiber == fibval) at the start of the function).

Remove call to rb_fiber_current which happened a few lines after
accessing GET_THREAD()->fiber directly (so if that's ever 0 we're
already screwed).

Author: Knut Franke <Knut.Franke@gmx.de>

* cont.c (fiber_store, fiber_switch): simplify
  [ruby-core:65518] [Feature #10341]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 22:34:43 +00:00
svn 9766fc4d70 * 2014-10-16
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 22:34:41 +00:00
normal 6f6238a70c cont.c: Remove unused prev_fiber/next_fiber fields
They were added in r19890 (8a0d53a), with the explanation that it's a
double linked list of fibers in the same thread, but without any code
using them.

* cont.c (rb_fiber_t): remove prev_fiber/next_fiber
  (fiber_link_join, fiber_link_remove): remove functions
  (fiber_free, fiber_init, root_fiber_alloc):
   remove references to removed fields and functions
  [ruby-core:65518] [Feature #10341]

Author: Knut Franke <Knut.Franke@gmx.de>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 22:34:30 +00:00
nobu 2a61ff2e65 vm_backtrace.c: fix unknown ID name
* vm_backtrace.c (id2str): adapt rb_id2str which returns 0 on
  unknown ID to return Qnil, since oldbt_arg functions expect Qnil
  on unknown method names.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 14:37:54 +00:00
nobu 2d1578804b vm_backtrace.c: unknown name method
* vm_backtrace.c (location_format): adjust unknown name method
  results to other functions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 14:37:51 +00:00
kazu 1c90afbc1a fix typos [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 14:12:57 +00:00
akr 0621ddc423 * ext/etc/etc.c (etc_nprocessors_affin): Test CPU_ALLOC availability.
CentOS 5 don't have CPU_ALLOC().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 13:09:23 +00:00
akr 1451377e75 Simplify multiline condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 11:28:52 +00:00
akr e67b307e55 Simplify a regexp.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 10:57:17 +00:00
akr ac7190349c Unused variable removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 09:57:17 +00:00
akr 7d9e04de49 * ext/etc/etc.c (etc_nprocessors_affinity): use sched_getaffinity
for getting precious number of available cpus.

* ext/etc/etc.c (etc_nprocessors): use etc_nprocessors_affinity if
  possible.

  [Feature #10267] etc-nprocessors-kosaki2.patch



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 09:41:25 +00:00
akr e1ba2d418a * test/ruby/envutil.rb (assert_pattern_list) Renamed from
assert_regexp_list.
  Show multiline string in multi lines.

* test/-ext-/bug_reporter/test_bug_reporter.rb: Use
  assert_pattern_list.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 08:59:46 +00:00
nobu 723cee93c4 enum.c: nil if no iteration
* enum.c (enum_inject): return nil if no iteration, instead of
  Qundef.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 06:27:30 +00:00
nobu e02c5f346f test_rubyoptions.rb: split regexps
* test/ruby/test_rubyoptions.rb (SEGVTest::ExpectedStderrList):
  split backtrace information regexps.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 05:59:11 +00:00
nobu efaed8c80d enum.c: use Qundef
* enum.c (enum_inject): use Qundef for no initial values.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 05:25:36 +00:00
akr 2386407223 * test/ruby/envutil.rb (assert_regexp_list): New assertion method.
* test/ruby/test_rubyoptions.rb: Use assert_regexp_list.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 03:27:37 +00:00
akr 7643c2b37d Extract assert_segv and split the big regexp.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15 00:04:50 +00:00
akr 5a601ec591 * enum.c: min(n) drops elements bigger than the n-th maximum element.
(struct nmin_data): New field to record the n-th maximumelement, limit
  (nmin_filter): Update limit field.
  (nmin_i): Drop too big eleents.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-14 22:24:34 +00:00
normal d63a88c0b5 test/ruby/test_optimization.rb (test_string_size): new test
String#size may be overridden, so test for it.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-14 22:01:54 +00:00
normal a1ad7b51f5 test/ruby/test_optimization.rb: redefinition tests for String
* test/ruby/test_optimization.rb (test_string_eq_neq): new test
  (test_string_ltlt): ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-14 21:52:56 +00:00
normal 5733a57455 test/ruby/test_optimization.rb (test_hash_aset_with): assert assignment
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-14 21:52:45 +00:00
zzak f9deff9759 * gc.c (rb_obj_id): [DOC] Fix typo, clean up sentence, and wrap cols
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-14 19:57:24 +00:00
svn 329b2f472c * 2014-10-15
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-14 19:54:48 +00:00
zzak 856624228c * error.c: [DOC] Fix case of type in exception message by @tricknotes
[Fixes GH-740] https://github.com/ruby/ruby/pull/740

* object.c: ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-14 19:54:36 +00:00
nobu 3958ba3cbe rbinstall.rb: fix .gemspec permissions
* tool/rbinstall.rb (gem): Fix permissions of bundled gems
  specification files.  [ruby-core:65700] [Bug #10383]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-14 12:39:17 +00:00
suke fb06f0802e ext/win32ole/win32ole_record.c: use typed data.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-14 10:16:17 +00:00
nobu 65075dfe3a symbol.c: ids array
* symbol.c (global_symbols): make ids two-dimensional array of
  strings and symbols, for write-barrier.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-14 07:23:14 +00:00
nobu 3e69b074c5 symbol.c: immortal IDs
* symbol.c (global_symbols): make IDs immortal always, instead
  of treating dynamic symbols as IDs.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-14 07:23:08 +00:00
nobu 5617e31771 symbol.c: rename rb_str_dynamic_intern
* iseq.c, marshal.c, string.c: use rb_str_intern instead of
  rb_str_dynamic_intern.
* symbol.c (rb_str_intern): rename rb_str_dynamic_intern.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-14 07:23:01 +00:00
normal 18828191d4 test new optimizations for redefines
* test/ruby/test_optimization.rb (test_string_freeze): new test
  (test_hash_aref_with): ditto
  (test_hash_aset_with): ditto

Our new (in 2.2) optimizations must not trigger when redefined.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-14 01:21:48 +00:00
akr 2f83b32f71 update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-13 22:36:17 +00:00
zzak 2f00c56eb7 * ext/date/lib/date.rb: fix indent [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-13 20:16:07 +00:00
nagai 7ce520e90a * ext/tk/tcltklib.c: (experimental) support Tcl/Tk8.6.2.
* ext/tk/extconf.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-13 17:32:17 +00:00
akr 450307e383 * enum.c (nmin_run): max(n) and max_by(n) returns an array in
descending order.
  [ruby-core:65452] Suggested by David Grayson.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-13 16:30:07 +00:00
svn 63fa57e9ba * 2014-10-14
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-13 15:49:42 +00:00
nagachika 1f6fa3202d ChangeLog: fix a typo for r47897.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-13 15:49:38 +00:00
nobu f77d22d1fe common.mk: update-gems for older BASERUBY
* common.mk (update-gems): chdir to the target directory and then
  add the tool directory to load paths, for older BASERUBY.
  [Bug #10372][ruby-core:65630]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-13 11:44:50 +00:00
nobu caa54c1715 Revert r47899
* common.mk: $(srcdir)/../tool is an invalid path.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-13 11:27:00 +00:00
hsbt 8d7fa2291c * lib/xmlrpc/parser.rb: added new parser class using libxml-ruby gem.
[Feature #9379][ruby-core:59633]
* lib/xmlrpc/config.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-13 08:53:16 +00:00