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

48474 Коммитов

Автор SHA1 Сообщение Дата
ko1 3b7373fd00 fix backtrace on argment error.
* vm_backtrace.c (rb_backtrace_use_iseq_first_lineno_for_last_location):
  added. It modifies last location's line as corresponding iseq's first line
  number.

* vm_args.c (raise_argument_error): use added function.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-09 05:22:51 +00:00
ko1 976b6df959 fix peephole optimization.
* compile.c (iseq_peephole_optimize): do not need to put `pop`
  instruction.

* test/ruby/test_optimization.rb (test_peephole_optimization_without_trace):
  This code "def foo; 1.times{|(a), &b| nil && a}; end" fails to compile
  by stack underflow because of above bug (fixed by this patch).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-09 04:27:27 +00:00
mame 2b60e342bd node.c (dump_node): add an explanation of NODE_HASH's nd_alen
The field has a flag to represent if it is a keyword argument (that has
no braces, e.g., `foo(k:1)`) or hash literal (that has braces, e.g.,
`foo({k:1})`).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-09 01:50:58 +00:00
mame f09ad1dc5d use `rb_ast_dispose` instead of `rb_ast_free`
`rb_ast_dispose` calls `rb_gc_writebarrier_remember`.  Unless we call
it, the marked objects may not be GC'ed until `rb_ast_t` is GC'ed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-09 01:32:11 +00:00
hsbt 3ba9e6b639 Merge rubygems-2.7.2.
This version fixes some setup commands.
  01e797f6aa/History.txt (L3)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-09 00:42:19 +00:00
nobu cf3329cb8d parse.y: fix r60644
* parse.y (rb_strterm_heredoc_t): should not define sourceline as
  union, to fix wrong read on big-endian platforms.
  as rb_imemo_new stores all members as VALUEs, should read it as
  VALUE too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-08 23:09:25 +00:00
svn b887848188 * 2017-11-09
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-08 16:43:24 +00:00
a_matsuda d3b63f9597 Fix typo in doc [ci skip]
`enable` and `disable` are instance methods.

Patch by: yuuji.yaginuma <yuuji.yaginuma@gmail.com>

https://github.com/ruby/ruby/pull/1744
[Fix GH-1744]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-08 16:43:23 +00:00
kazu fb5bc568ca fixup r60440 [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-08 14:14:54 +00:00
nobu e7d37ebdae parse.y: remove in_single
* parse.y (parser_params): removed in_single, which is referenced
  with in_def always.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-08 10:54:09 +00:00
knu b0c719dae4 Fix typos in rdoc
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-08 03:57:54 +00:00
yui-knk a6f372d129 Omit first argument of NEW_CASE2
* node.h (NEW_CASE2): Omit first argument of NEW_CASE2,
  bacause the first argument of NEW_CASE2 is always 0.
* parse.y: Ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-08 00:03:02 +00:00
stomar 6f33cde636 hash.c: improve docs for Hash#slice
* hash.c: [DOC] clarify description for Hash#slice and remove
  a sentence that might suggest that the receiver is modified;
  improve example to also include a case where a hash with
  several elements is returned.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 20:17:04 +00:00
stomar 8b1c1c55a9 string.c: improve docs for String#{concat,<<}
* string.c: [DOC] remove a misleading call-seq for String#concat,
  which suggests that all arguments must be Integers in this case;
  also clarify in the example that the receiver is modified;
  fix grammar for String#<<; move references to the end.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 20:15:59 +00:00
stomar c1e1e2b6d9 pathname.c: improve docs for Pathname
* ext/pathname/pathname.c: [DOC] improve example for Pathname.glob,
  by using a more common glob pattern, and improve the reference
  to the `base' keyword argument for Pathname#glob.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 20:14:46 +00:00
stomar 35bd2ad25e http.rb: improve docs
* lib/net/http.rb: [DOC] fix typos and grammar

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 20:13:48 +00:00
stomar b6db783eed socket.c,tcpsocket.c: improve deprecation notices
* ext/socket/socket.c: [DOC] fix grammar in deprecation notices.
* ext/socket/tcpsocket.c: [DOC] ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 20:13:00 +00:00
stomar 995fd6d720 vm_dump.c: [DOC] fix grammar
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 20:11:44 +00:00
stomar 3262f4910f string.c: fix typos
* string.c: [DOC] fix typos in doxygen comments.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 20:11:09 +00:00
stomar 086015a5cb file.c: improve docs for File#path
* file.c: [DOC] fix grammar in docs for File#path
  and use a stronger description than "inaccurate".

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 20:10:29 +00:00
stomar bf6ea09c8f ext/socket/ifaddr.c: [DOC] fix typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 20:09:19 +00:00
stomar 0f7fed9253 etc.c: improve docs for sysconfdir
* ext/etc/etc.c: [DOC] small language fixes for etc_sysconfdir docs.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 20:08:34 +00:00
stomar 3b071b080c README.md: fix typos and grammar
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 20:07:33 +00:00
stomar 2aecddc7c6 NEWS: clarify "ubygems.rb" entry
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 20:06:25 +00:00
svn ea26e72a04 * 2017-11-08
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 20:04:59 +00:00
stomar 093aa9ae03 refinements.rdoc: improve docs
* doc/syntax/refinements.rdoc: [DOC] fix typos and grammar
  and remove superfluous "for the first time".

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 20:04:58 +00:00
ko1 17f9ad40f6 disable GC.
* test/ruby/test_io.rb (test_write_no_garbage): malloc can cause GC
  and it will reduce string object counts. So disable GC during this test.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 14:23:58 +00:00
nobu c2a08ef876 tool/runruby.rb: fix RUNRUBY_USE_GDB case
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 11:21:09 +00:00
ko1 a95f4ace39 `th` is not used.
* vm_args.c: `th` parameter is not used on the following functions:
  * args_check_block_arg0
  * keyword_hash_p
  * args_pop_keyword_hash


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 08:23:57 +00:00
ko1 0c2746a7bb th->ec: dtrace
* vm.c (ruby_th_dtrace_setup): rename to rb_dtrace_setup()
  and accept `ec`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 08:19:25 +00:00
ko1 8dbaf1bbdd `rb_execution_context_t *` should not be `th`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 08:01:26 +00:00
mame a798e49f57 Symptomatic treatment for `rb_thread_terminate_all` freeze
Under uncertain condition, `rb_thread_terminate_all` gets stuck.  `make
test-all TESTOPTS="test/ruby/test_gc.rb -n test_interrupt_in_finalizer`
fails very rarely (only once every thousand runs).  This IS a bug, but
seems difficult to fix it soon.

This commit makes `rb_thread_terminate_all` wake up every one second,
instead of waiting forever, which mitigates the unuseful freeze.
This is not an essential solution for the bug, though.  I'll create a
ticket with how to reproduce the original issue.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 06:36:07 +00:00
ko1 8ea78d66a1 th->ec: vm_once_dispatch.
* vm_insnhelper.c (vm_once_dispatch): accepts `ec`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 06:14:00 +00:00
ko1 f6c102e6a5 th->ec: rb_threadptr_setup_exception
* eval.c (rb_threadptr_setup_exception): renamed to rb_ec_setup_exception().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 06:09:47 +00:00
ko1 2d71889b6b fix prefix `ruby_...()` to `rb_...()`.
* vm_core.h: fix prefix `ruby_` to `rb_` for the following functions.
  * ruby_current_execution_context
  * ruby_current_thread
  * ruby_current_vm
  * ruby_vm_check_ints
  * ruby_exec_event_hook_orig


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 06:01:16 +00:00
ko1 7285177c97 * vm_trace.c (rb_exec_event_hooks): accepts pop_p.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 05:54:34 +00:00
ko1 8b7f06d2d6 th->ec: rb_load_internal0
* load.c (rb_load_internal0): accepts `ec`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 05:45:46 +00:00
ko1 8d8e339d76 fix comment
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 05:41:43 +00:00
ko1 7e9c5aca4c * eval_intern.h (rb_threadptr_tag_state): rename to rb_ec_tag_state.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 05:41:15 +00:00
ko1 f1ad90a5e3 * vm_eval.c (rescue_funcall_args): th->ec
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 05:39:02 +00:00
knu f477851bb7 Add details on the min/time parameters to the rdoc
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 05:28:14 +00:00
ko1 48ce4cb414 * eval_intern.h: rename macros rb_thread_raised_* to
rb_ec_raised_*.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 05:22:09 +00:00
ko1 ee189904f0 rename to rb_ec_set_raised().
* thread.c (rb_threadptr_set_raised): rename to rb_ec_set_raised
  and accepts `ec`


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 05:12:39 +00:00
ko1 d1013f2ab8 use GET_VM()
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 05:09:27 +00:00
ko1 4049ffb58e use GET_EC() directly
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 05:08:09 +00:00
ko1 da9869625a * vm_backtrace.c (rb_debug_inspector_t): `th` -> `ec`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 05:06:50 +00:00
ko1 af8a7df3b6 move `rb_thread_t::method_missing_reason` to ec.
* vm_core.h (rb_thread_t): move method_missing_reason to
  rb_execution_context_t.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 05:01:51 +00:00
ko1 001eb22c75 remove `rb_postponed_job_t::th`.
* vm_trace.c (rb_postponed_job_t): remove `th` field because it is not used.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 04:53:11 +00:00
ko1 f3482ddabf rename because it doesn't receive `th`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 04:04:18 +00:00
ko1 b6ecdf5fc8 th->ec: rb_threadptr_reset_raised()
* thread.c (rb_threadptr_reset_raised): rename to `rb_ec_reset_raised`
  and accepts `ec`.

* vm_trace.c: the following functions accept `ec` instead of `th`
  * exec_hooks_body
  * exec_hooks_precheck
  * exec_hooks_unprotected
  * exec_hooks_protected


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07 04:01:13 +00:00