aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* fix feature name and removed a duplicate conditionnobu2018-06-281-6/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* check enc_capable.ko12018-06-284-44/+39
| | | | | | | | | | | | | | | | | | | | | | | * encoding.c (rb_enc_capable): make it extern to check enc_capable. enc_index can be set to limited types such as T_STRING, T_REGEX and so on. This function check an object is this kind of types. * include/ruby/encoding.h: ditto. * encoding.c (enc_set_index): check a given object is enc_capable. * include/ruby/encoding.h (PUREFUNC): * marshal.c (encoding_name): check `rb_enc_capable` first. * marshal.c (r_ivar): ditto. If it is not enc_capable, it should be malformed data. * spec/ruby/optional/capi/encoding_spec.rb: remove tests depending on the wrong feature: all objects can set enc_index. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* symbol.c: dsymbol initial encodingnobu2018-06-281-1/+1
| | | | | | | * symbol.c (dsymbol_alloc): set encoding directly. no need to check existing encoding in rb_enc_associate. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix typo of file path [ci skip]a_matsuda2018-06-281-1/+1
| | | | | | | | | Patch by: yuuji.yaginuma <yuuji.yaginuma@gmail.com> https://github.com/ruby/ruby/pull/1900 [Fix GH-1900] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* tests: increase timeouts and speedup some slow testsnormal2018-06-274-7/+7
| | | | | | | | I'm still using the computer from 2005, so enabling MJIT makes some tests take longer. For test_deadlock_by_signal_at_forking I got it down to 135s to 89s by disabling RubyGems. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-06-28svn2018-06-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Added guard condition for old ruby about RubyVM::MJIT.hsbt2018-06-271-1/+1
| | | | | | | | | | Test libraries under the test/lib is used with default gems in their repositories. default gems may support old ruby like Ruby 2.5. When default gems invoke test libraries of Ruby core with old ruby, they raised `uninitialized constant RubyVM::MJIT (NameError)` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use the prefixed macronobu2018-06-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use rb_pid_t instead of pid_tnobu2018-06-271-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update to ruby/spec@98c7d74eregon2018-06-271-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update to ruby/spec@a454137eregon2018-06-27143-146/+328
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update to ruby/spec@41068a6eregon2018-06-273-52/+52
| | | | | | * Only small fixes to specs from CRuby to review the diff more easily. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update to ruby/mspec@7074b56eregon2018-06-276-31/+70
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove assertion for hidden objects.ko12018-06-271-1/+1
| | | | | | | | | * vm_insnhelper.h (PUSH): r63763 increase "PUSH()" op and it reveals that there are hidden objects (at least T_IMEMO/iseq objects) are located on VM stack. Remove this check and I'll revisit it later. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c (waitpid_wait): do not set ECHILD prematurelynormal2018-06-274-8/+20
| | | | | | | | | | | | It is possible to have both MJIT and normal child processes alive, so we cannot set ECHILD based on such a guess. We can still elide waitpid(PID <= 0) calls if we have callers in vm->waiting_pids, however. For specs, ensure Process.waitall does not leak MJIT PIDs to Rubyspace. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* give up insn attr handles_frameshyouhei2018-06-279-82/+132
| | | | | | | | | | | | | | I introduced this mechanism in r62051 to speed things up. Later it was reported that the change causes problems. I searched for workarounds but nothing seemed appropriate. I hereby officially give it up. The idea to move ADD_PC around was a mistake. Fixes [Bug #14809] and [Bug #14834]. Signed-off-by: Urabe, Shyouhei <shyouhei@ruby-lang.org> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: fix braino in fake_grantfdnormal2018-06-271-1/+1
| | | | | | | | [Bug #14871] Is neon down? I missed ruby-core notifications on this. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* s/pid_t/rb_pid_t/normal2018-06-272-2/+2
| | | | | | Some platforms do not have pid_t :x git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "spec: skip Process wait specs on MJIT"normal2018-06-274-116/+104
| | | | | | This reverts r63731 (commit 359dd59db2512d801bb983f98bede4fc598f139a). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "test_process.rb: skip tests for Bug 14867"normal2018-06-271-3/+0
| | | | | | This reverts r63740 (commit 042395a7f7262464265ce70cdffbe1812aa145d3). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hijack SIGCHLD handler for internal usenormal2018-06-279-98/+446
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a global SIGCHLD handler to guard all callers of rb_waitpid. To work safely with multi-threaded programs, we introduce a VM-wide waitpid_lock to be acquired BEFORE fork/vfork spawns the process. This is to be combined with the new ruby_waitpid_locked function used by mjit.c in a non-Ruby thread. Ruby-level SIGCHLD handlers registered with Signal.trap(:CHLD) continues to work as before and there should be no regressions in any existing use cases. Splitting the wait queues for PID > 0 and groups (PID <= 0) ensures we favor PID > 0 callers. The disabling of SIGCHLD in rb_f_system is longer necessary, as we use deferred signal handling and no longer make ANY blocking waitpid syscalls in other threads which could "beat" the waitpid call made by rb_f_system. We prevent SIGCHLD from firing in normal Ruby Threads and only enable it in the timer-thread, to prevent spurious wakeups from in test/-ext-/gvl/test_last_thread.rb with MJIT enabled. I've tried to guard as much of the code for RUBY_SIGCHLD==0 using C "if" statements rather than CPP "#if" so to reduce the likelyhood of portability problems as the compiler will see more code. We also work to suppress false-positives from Process.wait(-1, Process::WNOHANG) to quiets warnings from spec/ruby/core/process/wait2_spec.rb with MJIT enabled. Lastly, we must implement rb_grantpt for ext/pty. We need a MJIT-compatible way of supporting grantpt(3) which may spawn the `pt_chown' binary and call waitpid(2) on it. [ruby-core:87605] [Ruby trunk Bug#14867] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "bootstraptest/runner: speed up assert_finish by avoiding sleep"mame2018-06-271-8/+3
| | | | | | | | | | This reverts commit r63754. Many CI servers still use old ruby as base ruby which does not support read_nonblock. https://rubyci.org/logs/www.rubyist.net/~akr/chkbuild/debian/ruby-trunk/log/20180627T013100Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* refactor move logics out of insns.defshyouhei2018-06-272-12/+13
| | | | | | | This is a pure refactoring. I see no difference in this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* move function declarations from insns.def to internal.hshyouhei2018-06-273-5/+3
| | | | | | | Just avoid being loose. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* bootstraptest/runner: speed up assert_finish by avoiding sleepnormal2018-06-261-3/+8
| | | | | | | We may use IO.select to watch for process exit. This speeds up "make test" by 2 seconds for me. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-06-27svn2018-06-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test: skip 2 major unstable tests with MJITk0kubun2018-06-262-0/+5
| | | | | | | | | for CI with cppflags=-DMJIT_FORCE_ENABLE. Since I have no idea to fix this immediately, let me skip this for now and take a look later. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit_compile.inc.erb: drop unnecessary variablek0kubun2018-06-252-9/+3
| | | | | | It never becomes `dispatched: true` with the current code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_range.rb: add tests to improve coveragewatson19782018-06-251-0/+14
| | | | | | | This patch will improve the result of line coverage from 91.3% to 95.0%. [Fix GH-1899] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* increase body sizenaruse2018-06-251-1/+1
| | | | | | To try to block writing on travis. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c: hide path search error behind verbose()normal2018-06-251-1/+1
| | | | | | | | Before r63744, we let execvp(3) fail instead and it was quiet. The verbosity was causing test_search to fail in test/ruby/test_rubyoptions.rb when PATH is set to /tmp. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* comma at the end of enum is a C99ismshyouhei2018-06-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c: avoid signed pointer comparisons (fix for 32-bit)normal2018-06-251-2/+2
| | | | | | | | ptrdiff_t is a signed type, use uintptr_t instead for unsigned comparisons. This is needed to allow MJIT tests to pass on 32-bit x86 GNU/Linux. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c: set PIC flags on clang for FreeBSD and glibcnormal2018-06-251-1/+3
| | | | | | | | | | | | | This seems required on FreeBSD 11.1 (clang 4.0.0) and Debian stretch (clang 3.8.1) for shared libraries. Note: Not checking __linux__ because there are statically-linked Linux distros (I don't know if they can support MJIT). But glibc doesn't support static linking, so we guard on that. Maybe other platforms will need this, too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c: avoid execvp PATH lookup in vfork-ed childnormal2018-06-251-7/+24
| | | | | | | | | | | execvp(3) is not async-signal-safe and may alter libc internal states (e.g. those used by malloc). However execv(3) is async-signal-safe as of POSIX.1-2008. So perform the PATH lookup in the parent and use execv(3) in the child. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-06-25svn2018-06-241-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* UNIXSocket#recv_io: trigger GC when out of FDsnormal2018-06-241-1/+27
| | | | | | | | | | | | Make this behavior is consistent with our other FD-allocating methods. EMFILE and ENFILE are not documented nor can I trigger them when using UNIXSocket#recv_io. However, ENOMEM is documented, and I've triggered EMSGSIZE on FreeBSD and truncated messages when an EMFILE condition is hit on my system. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c (ruby_fork_ruby): fix race in signal handlingnormal2018-06-241-1/+1
| | | | | | | | | | We must block signals before stopping timer-thread, otherwise signal handing may be delayed until (and if) another signal is received after timer-thread is restarted. [ruby-core:87622] [Bug #14868] [Bug #13916] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_process.rb: skip tests for Bug 14867k0kubun2018-06-241-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c (after_fork_ruby): make it a proper functionnormal2018-06-241-1/+6
| | | | | | | Improves readability to me, and there's no point in using macros for this with decent compilers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/net/http/test_httpresponse.rb: add testcases for net/httpresponsemame2018-06-241-0/+30
| | | | | | | | | This change adds testcases for Response#inspect and #code_type, and improves line coverage of lib/net/http/response.rb (91.8 % to 92.94 %). A patch from @owlworks. https://github.com/ruby/ruby/pull/1898 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/prime.rb: remove unused methodsmame2018-06-241-7/+0
| | | | | | | | | | | | | This change removes TrialDivision#cache, TrialDivision#primes, and TrialDivision#primes_so_far. TrialDivision class is undocumented officially, so this class is used only internally. Yugui san moved prime library from mathn to prime in 2008, and then she might forget to delete these methods. A patch from @shio-phys. https://github.com/ruby/prime/pull/4 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-06-24svn2018-06-241-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/test_prime.rb: add testcases of prime librarymame2018-06-241-0/+81
| | | | | | | This change improves line coverage of prime.rb from 86% to 99%. A patch from @shio-phys. https://github.com/ruby/prime/pull/3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c: disable calling JIT-ed codek0kubun2018-06-234-2/+14
| | | | | | | | | | | when TracePoint is enabled. We're cancelling JIT-ed code execution AFTER each instruction, but there is no guard before the first insn of method. To prevent spoiling performance, I don't want to modify the JIT-ed code to fix this. So this commit replaces `mjit_enabled` check with `mjit_call_p` check. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c (ruby_mimmalloc): add initialize code for USE_GC_MALLOC_OBJ_INFO_DETAILStarui2018-06-231-0/+7
| | | | | | | We often had SEGV in ruby_xfree when USE_GC_MALLOC_OBJ_INFO_DETAILS is 1 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c: unify the variable name with method namek0kubun2018-06-234-23/+23
| | | | | | | | | | | | `RubyVM::MJIT.enabled?`. It's set to be TRUE even before initialization is finished. So it was actually not "mjit initialized predicate". This flag is also used to check whether JIT-ed code should be called or not, but I'm going to split the responsibility to another flag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* spec: skip Process wait specs on MJITk0kubun2018-06-235-104/+117
| | | | | | | until [Bug #14867] is fixed. I want to start running CI with MJIT enabled before fixing the problem. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c: initial cygwin supportk0kubun2018-06-232-3/+4
| | | | | | | | | | | | | | | thread_pthread.c: Drop pthread_attr_setscope usage. It seems that, at least on Linux and macOS, PTHREAD_SCOPE_PROCESS is not supported and thus PTHREAD_SCOPE_SYSTEM should be used by default. Let's just stop calling this until we find some platform that needs `pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)`. [Misc #14854] From: fd0 (Daisuke Fujimura) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [DOC] Add call signature for {Array,Hash}#any?ktsj2018-06-232-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e