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

48104 Коммитов

Автор SHA1 Сообщение Дата
ko1 f56288d7a8 replace `GET_THREAD()->ec` to `GET_EC()`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 14:44:09 +00:00
ko1 d77305fc9c make root fiber at switching.
* cont.c (fiber_switch): make sure the root fiber object is available
  before the first switching.

* test/ruby/test_fiber.rb: remove "skip".


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 14:38:22 +00:00
ko1 d717dafc0e skip test_fiber_transfer_segv because it cause error with previous commit
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 14:28:43 +00:00
ko1 8afee516be fix freeing `th->ec` bugs.
* vm.c (thread_free): simply call rb_threadptr_root_fiber_release().

* cont.c (rb_threadptr_root_fiber_release): release th->ec (ec->fiber)
  iff root_fiber is NULL. If root_fiber is available, then ignore it
  and root fiber object will free th->ec too.

* cont.c (rb_threadptr_root_fiber_setup): do not set th->root_fiber.
  th->root_fiber will be set if a root fiber object is created.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 14:21:31 +00:00
ko1 4552f74715 introduce EC_*_TAG() instead of TH_*_TAG()
* eval_intern.h:
  introduce EC_*_TAG() macros instead of TH_*_TAG() macros.
  * TH_PUSH_TAG() -> EC_PUSH_TAG()
  * TH_POP_TAG() -> EC_POP_TAG()
  * TH_TMPPOP_TAG() -> EC_TMPPOP_TAG()
  * TH_REPUSH_TAG() -> EC_REPUSH_TAG()
  * TH_EXEC_TAG() -> EC_EXEC_TAG()
  * TH_JUMP_TAG() -> EC_JUMP_TAG()

  rb_threadptr_tag_state() , rb_ec_tag_jump() also accept `ec` instead of `th`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 11:02:13 +00:00
ko1 24044b2f63 backtrace_each() accepts `ec` instead of `th`.
* vm_backtrace.c (backtrace_each): accepts `ec` instead of `th`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 10:57:16 +00:00
ko1 284d4c08d6 vm_pop_frame() accepts `ec` instead of `th`.
* vm_insnhelper.c (vm_pop_frame): accepts `ec` instead of `th`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 10:55:24 +00:00
ko1 9adf6064ce vm_push_frame() accepts `ec` instead of `th`.
* vm_insnhelper.c (vm_push_frame): accepts `ec` instead of `th`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 10:53:42 +00:00
ko1 f3400dfd81 use GET_EC()
* vm.c (vm_ep_in_heap_p_): use GET_EC() instead of GET_THREAD().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 10:52:05 +00:00
ko1 32c41f0c7c A function accepts `ec` instead of `th`.
* vm.c (VM_CFP_IN_HEAP_P): accepts `ec` instead of `th`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 10:50:45 +00:00
ko1 a8735ed206 A function accepts `ec` instead of `th`.
* vm.c (rb_vm_search_cf_from_ep): accept `ec` instead of `th`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 10:49:33 +00:00
mame 5f4a08253b Expand the definition of rb_imemo_new in rb_imemo_alloc_new
per ko1's comment

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 08:45:14 +00:00
ko1 e6309f0d50 fix comments
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 08:42:44 +00:00
ko1 e95de48f1d some functions accept `ec` instead of `th`.
* vm.c (vm_make_env_object): accepts `ec`.

* vm.c (rb_vm_get_ruby_level_next_cfp): ditto.

* vm.c (rb_vm_make_proc): ditto.

* vm.c (rb_vm_make_proc_lambda): ditto.

* vm_core.h: some macros accept ec instead of th
  (and make them inline functions):
  * RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW
  * RUBY_VM_END_CONTROL_FRAME
  * RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P

* eval.c (frame_func_id): constify for the first parameter.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 08:41:34 +00:00
ko1 837fd5e494 Use rb_execution_context_t instead of rb_thread_t
to represent execution context [Feature #14038]

* vm_core.h (rb_thread_t): rb_thread_t::ec is now a pointer.
  There are many code using `th` to represent execution context
  (such as cfp, VM stack and so on). To access `ec`, they need to
  use `th->ec->...` (adding one indirection) so that we need to
  replace them by passing `ec` instead of `th`.

* vm_core.h (GET_EC()): introduced to access current ec. Also
  remove `ruby_current_thread` global variable.

* cont.c (rb_context_t): introduce rb_context_t::thread_ptr instead of
  rb_context_t::thread_value.

* cont.c (ec_set_vm_stack): added to update vm_stack explicitly.

* cont.c (ec_switch): added to switch ec explicitly.

* cont.c (rb_fiber_close): added to terminate fibers explicitly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 08:32:49 +00:00
nobu 07f04f468d test_env.rb: fix one-off bug
* test/ruby/test_env.rb (TestEnv#test_win32_blocksize): count the
  terminator byte too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 07:36:23 +00:00
nobu 6b818dd961 common conversion functions
* array.c (rb_to_array_type): make public to share common code
  internally.

* hash.c (rb_to_hash_type): make public to share common code
  internally.

* symbol.c (rb_to_symbol_type): make public to share common code
  internally.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 07:23:23 +00:00
marcandre 7e3bd6646c TracePoint#enable, #disable: Don't yield any argument. [Bug #14057]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 06:58:09 +00:00
nobu 464cda55c5 common.mk: quote pipes on Windows
* common.mk (update-gems, update-bundled_gems): quote pipes by
  double qoutes instead of single quotes, to escape them on
  Windows.  wildcard characters `*?[{` still need to be quoted by
  single quotes to get rid of globbing.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 01:36:52 +00:00
nobu bbacbc96d6 common.mk: test-bundled-gem [ci skip]
* common.mk (test-bundled-gems): moved from Makefile.in so it
  might work on nmake too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 00:59:15 +00:00
nobu 44c748f571 common.mk: test-bundler [ci skip]
* common.mk (test-bundler): moved from Makefile.in so it might
  work on nmake too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 00:59:13 +00:00
kazu fc29786926 test/ostruct: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 23:45:33 +00:00
svn a3d3bd552a * 2017-10-26
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 23:35:47 +00:00
nobu ef82d94873 test-bundled-gems-fetch
* tool/fetch-bundled_gems.rb: get rid of tool/git-refresh which
  requries Bourne shell.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 23:35:46 +00:00
nobu b1dc607184 common.mk: remove old gems at update-gems
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 14:25:39 +00:00
mame 09ea07e02c Refactoring by adding `rb_imemo_alloc_new` to create imemo_alloc buffer
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 13:38:53 +00:00
usa 8a67b59c31 Get rid of a test error on Windows caused by r60417
* test/testunit/test_parallel.rb (teardown): this code seems to allow
  `Errno::EPIPE` from @worker_in.  in such case, `close` may also raise the same
  exception.
  I'm not confident in this conclusion and still doubt that we should revert
  r60417 instead of this commit or not.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 13:29:27 +00:00
mame fdb771d82d Make imemo_alloc writebarrier-unprotected
imemo_alloc provides a memory buffer whose contents are marked by GC.
C code can access imemo_alloc buffer freely, so imemo_alloc must be
considered writebarrier-unprotected.  But T_IMEMO is writebarrier-
protected by default, which caused a GC bug.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 13:19:45 +00:00
kazu 872b9ec896 Fix `shadowing outer local variable` warning [ci skip]
ref https://github.com/rurema/doctree/pull/697

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 12:57:34 +00:00
nobu 1b27af8d56 io.c: let rb_p use writev
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 12:33:42 +00:00
nobu 7da5b32a7d test_io.rb: skip writev test
* test/ruby/test_io.rb (TestIO#test_puts_parallel): skip a test
  needs writev which is not portable.  [Feature #14042]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 12:31:30 +00:00
nobu 237901a41b io.c: warn old write
* io.c (rb_io_puts): warn if write method accepts just one
  argument.  [ruby-core:83529] [Feature #14042]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 12:04:53 +00:00
hsbt ca9c9001dc Regenerate slack token on Travis CI.
The previous token did not work on our slack team.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 09:24:37 +00:00
nobu fffcf46f93 win32.c: unknown reparse tags
* win32/win32.c (rb_w32_read_reparse_point): skip unknown reparse
  tags.  [ruby-core:83539] [Bug #14047]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 08:37:17 +00:00
nobu 7ed3aae2fe securerandom.rb: fix an example of choose [ci skip]
* lib/securerandom.rb (Random::Formatter#choose): [DOC] fix an
  example, `n` is not optional.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 07:28:22 +00:00
hsbt 80f276e16f Update power_assert-1.1.1. It support `test-bundled-gems`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 07:03:11 +00:00
hsbt 2bcdd83e3f Fixed conflicted variables. v is already used another condition.
[Misc #14050][ruby-core:83553]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 06:58:24 +00:00
nobu 635d0822cd io.c: write a newline together
* io.c (rb_io_puts): write a newline together at once for each
  argument.  based on the patch by rohitpaulk (Rohit Kuruvilla) at
  [ruby-core:83508].  [Feature #14042]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 05:44:38 +00:00
nobu 50a99a7679 range.c: use rb_check_funcall
* range.c (rb_range_values): use rb_check_funcall instead of
  calling rb_respond_to then rb_funcall, and allow `begin` and
  `end` to be private as well as other internal conversions.
  [ruby-core:83541] [Bug #14048]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 05:23:54 +00:00
hsbt 537a46c69a Added development dependency for power_assert.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 05:04:24 +00:00
hsbt 09087d0c23 Update rake-12.2.1 for bundled gems.
rake-12.2.0 broke Capistrano 3 task. 12.2.1 fixed this regression.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 03:38:02 +00:00
nobu 82fb43153b Fix Mock.verify_call to mock_respond_to?
* spec/mspec/lib/mspec/mocks/mock.rb (Mock.verify_call): should
  pass arguments to as given, not packed in an array.
  mock_respond_to? expects 2 or 3 arguments.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 02:41:47 +00:00
nobu 9db92694b0 compile.c: refine error messages
* compile.c (rb_iseq_compile_node): raise compile error with exact
  iseq type name.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 01:45:28 +00:00
nobu 0ba049256e range.c: check if exclude_end? is defined
* range.c (rb_range_values): should raise TypeError if necessary
  method is not defined, not NoMethodError, when trying to tell if
  the object is a Range and extract info.
  [ruby-core:83541] [Bug #14048]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 01:40:15 +00:00
hsbt bb2aa9b343 Update latest bundled_gems.
* rake-12.2.0
  * test-unit-3.2.6

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 01:13:35 +00:00
nobu b0d93a9949 debug.c: RSymbol info
* debug.c (ruby_dummy_gdb_enums): force to include struct RSymbol
  info.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 00:33:29 +00:00
normal 95e1c87014 file.c: fix possible alignment bugs in r60386
* file.c (struct apply_filename): split out from struct apply_arg
* file.c (apply2files): use offsetof for flex array size calculation
* file.c (apply2files): avoid redundant marking with ALLOCV
  [ruby-core:83535]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 23:35:52 +00:00
nobu 3fc0c18193 debug.c: imemo_mask
* .gdbinit (rp, rp_imemo, rb_ps_thread): update imemo_mask.

* debug.c (ruby_dummy_gdb_enums): include imemo_types.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 23:19:57 +00:00
marcandre e565c838ce lib/ostruct.rb: Use frozen literals.
Patch adapted from Espartaco Palma. [GH-1714] [Bug #14000]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 18:08:15 +00:00
svn e077e7956a * 2017-10-25
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 18:08:01 +00:00