summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-07-08benchmark: convert bm_vm1_*.rb to vm1_*.ymlk0kubun
This YAML transformation is needed to support whileloop time substituion by benchmark_driver.gem later. This commmit changes no benchmark behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-08* 2018-07-09svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-08benchmark/driver.rb: fix wrong multiline regexpk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-08benchmark: introduce benchmark_driver.gemk0kubun
Makefile.in: Clone benchmark-driver repository in benchmark/benchmark-driver `make update-benchmark-driver`, like simplecov. win32/Makefile.sub: Roughly do the same thing. .gitignore: Ignore the cloned repository. common.mk: Trigger `make update-benchmark-driver` to run `make benchmark` and adjust arguments for benchmark_driver.gem. benchmark/require.yml: renamed from benchmark/bm_require.rb, benchmark/prepare_require.rb benchmark/require_thread.yml: renamed from benchmark/bm_require_thread.rb, benchmark/prepare_require_thread.rb benchmark/so_count_words.yml: renamed from benchmark/bm_so_count_words.rb, benchmark/prepare_so_count_words.rb, benchmark/wc.input.base benchmark/so_k_nucleotide.yml: renamed from benchmark/bm_so_k_nucleotide.rb, benchmark/prepare_so_k_nucleotide.rb, benchmark/make_fasta_output.rb benchmark/so_reverse_complement.yml: renamed from benchmark/bm_so_reverse_complement.rb, benchmark/prepare_so_reverse_complement.rb, benchmark/make_fasta_output.rb I'm sorry but I made some duplications between benchmark/require.yml and benchmark/require_thread.yml, and between benchmark/so_k_nucleotide.yml and benchmark/so_reverse_complement.yml. If you're not comfortable with it, please combine these YAMLs to share the same prelude. One YAML file can have multiple benchmark definitions sharing prelude. benchmark/driver.rb: Replace its core feature with benchmark_driver.gem. Some old features are gone for now, but I'll add them again later. [Misc #14902] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-08common.mk: load prelude on `make benchmark`k0kubun
because benchmark/bm_io_nonblock_noex.rb and benchmark/bm_io_nonblock_noex2.rb are using IO#write_nonblock and it's defined in prelude. miniruby can't run the benchmark without prelude. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-08benchmark: drop legacy benchmark driversk0kubun
It seems like they are all benchmark drivers but "benchmark/driver.rb" is the latest and others are no longer used. It's confusing to have multiple drivers (and actually I used benchmark/run.rb since I didn't know I should use benchmark/driver.rb). As I'm going to support only benchmark/driver.rb features in Misc#14902, let me delete them. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-08test/ruby (*no_hidden_garbage): disable GC and skip if multi-threadednormal
Any single object allocation can reduce object count, and object counts are global, so multi-threading leads to unpredictable results. See also similar commits: r60699 and r62608 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-08mjit: get rid of memory leak in pause+resume loopnormal
pthread_atfork is not idempotent and repeatedly calling it causes it to register the same hook repeatedly; leading to unbound memory growth. Ruby already has a (confusing-named) internal API for to call in the forked child process: rb_thread_atfork Call the MJIT child_after_fork hook inside that to prevent unbound growth with the following loop: loop do RubyVM::MJIT.pause RubyVM::MJIT.resume end git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-08tool/git-refresh: skip git fetch and checkoutk0kubun
if the tag is already checked out, to optimize the execution time. I'm going to prepare a task depending on this tool, and I want that to finish fast and output nothing when it's already up-to-date. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-08benchmark/driver.rb: simplify LoadError handlingk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-08common.mk: drop obsoleted `make tbench`k0kubun
benchmark/bmx_* files haven't existed since r37263 and thus it runs nothing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-08test/ruby/test_signal.rb: skip ensure if test is skippednormal
Thanks to Greg for the fix. [ruby-core:87860] [Bug #14867] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-08signal.c: preserve trap(:CHLD, "IGNORE") behavior with SIGCHLDnormal
We need to preserve "IGNORE" behavior from Ruby 2.5 and earlier. We can't rely on SA_NOCLDWAIT any more, since we always need system() and MJIT to work; so we fake that behavior using dedicated reaper (currently in timer-thread). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-07* 2018-07-08svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-07process.c (rb_f_exec): pause MJIT before replacing processnormal
Non-parallel "make test-spec" caused spec/ruby/core/process/wait2_spec.rb failures because mspec uses "exec" in single-process mode, so there's no chance the post-exec state could know about the MJIT child process from its pre-exec state. [ruby-core:87846] [Bug #14867] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-07wait2_spec.rb: skip leak checker for nowk0kubun
This is not working with cppflags="-DMJIT_FORCE_ENABLE" on my machine. ``` $ make test-spec $ /home/k0kubun/src/github.com/ruby/ruby-svn/.ruby-force/miniruby -I/home/k0kubun/src/github.com/ruby/ruby-svn/lib /home/k0kubun/src/github.com/ruby/ruby-svn/tool/runruby.rb --archdir=/home/k0kubun/src/github.com/ruby/ruby-svn/.ruby-force --extout=.ext -- /home/k0kubun/src/github.com/ruby/ruby-svn/spec/mspec/bin/mspec-run -B ../spec/default.mspec ruby 2.6.0dev (2018-07-07 trunk 63874) +JIT [x86_64-linux] [| | ================ 40% | 00:02:03] 0F 0E leaked before wait2 specs: [[31406, #<Process::Status: pid 31406 exit 0>]] 1) An exception occurred during: before :all FAILED Expected [[31406, #<Process::Status: pid 31406 exit 0>]] to be empty /home/k0kubun/src/github.com/ruby/ruby-svn/spec/ruby/core/process/wait2_spec.rb:18:in `block (3 levels) in <top (required)>' /home/k0kubun/src/github.com/ruby/ruby-svn/spec/ruby/core/process/wait2_spec.rb:16:in `block (2 levels) in <top (required)>' /home/k0kubun/src/github.com/ruby/ruby-svn/spec/ruby/core/process/wait2_spec.rb:3:in `<top (required)>' [- | ==================100%================== | 00:00:00] 1F 0E Finished in 103.288794 seconds 3607 files, 28545 examples, 208272 expectations, 1 failure, 0 errors, 0 tagged uncommon.mk:777: recipe for target 'yes-test-spec' failed make: *** [yes-test-spec] Error 1 ``` Let me skip this for now and enable MJIT CI again. Related to Bug#14867 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-07insns.def: stop pushing unnecessary keys for MJITk0kubun
[Bug #14892] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-07_mjit_compile_insn_body: rollback pc correctlyk0kubun
for catch_except_p case Partially solving Bug#14892 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-07* 2018-07-07svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-07test/socket/test_socket.rb (test_timestamp): retry sendnormal
I theorize there can be UDP packet loss even over loopback if the kernel is under memory pressure. Retry sending periodically until recvmsg succeeds. i[ruby-core:87842] [Bug #14898] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-06const_missing on private constantsnobu
* variable.c (rb_const_search): call #const_missing method on private constants, as well as uninitialized constants. [Feature #14328] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-06compile.c: remove unreachable jump onlynobu
* compile.c (iseq_peephole_optimize): remove unreachable jump instruction only. if it is labeled and referred from other instructions, it is reachable and must not be removed. [ruby-core:87830] [Bug #14897] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-06mjit.c: fix waitpid macro return value for win32normal
We started checking return value of waitpid, so it needs to be correct for win32 platforms for MJIT to work. Thanks-to: MSP-Greg (Greg L) <Greg.mpls@gmail.com> [ruby-core:87832] [Bug #14867] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-06Fix a bug of peephole optimizationmame
``` if L1 L0: jump L2 L1: ... L2: ``` was wrongly optimized to: ``` unless L2 L0: L1: ... L2: ``` To make it conservative, this optimization is now disabled when there is any label between `if` and `jump` instructions. Fixes [Bug #14897]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-06thread.c (ruby_ppoll): improve timespec to msec conversionnormal
Round up non-zero <1ms timeouts to 1ms and use INT_MAX instead of infinite (-1) for extremely large timeouts. All of our ppoll/select callers are able to handle spurious wakeups, anyways. This avoids excessive CPU usage and busy waits with short timeouts to rb_wait_for_single_fd. CPU usage with the following script is significantly reduced for systems with "#undef HAVE_PPOLL": require 'io/wait' r, w = IO.pipe Thread.new { loop { r.wait_readable(0.000001) } }.join(5) exit!(0) Low-resolution in poll(2) still sucks, though... Note: I don't see the value in making a similar change to time_timeval of a <1us sleep is attempted because of GVL release and syscall latency. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-06thread.c: our fake ppoll implementation is staticnormal
Rename it to "ruby_ppoll" so it looks more obvious in debuggers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-06Fixup r63864kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-06Prefixed reset_leap_second_infonobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-05revert r62655 for r63763k0kubun
r63655 was tightly coupled to handle_frames and some assumptions seems to have been broken by r63763. To partially resolve Bug#14892, this reverts the optimization for now. I want to make MJIT CI happy first and then I'll probably retry r63655 by partially reverting r63763 for sp changes. The skipped test is not fixed yet. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-05* 2018-07-06svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-05Make a prototypenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-05ruby tool/update-deps --fixnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-05Add missing prototypenaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-05Add missing filenaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-05Re-apply r63848 (Optimize Time.utc)naruse
* Both timegmw and gmtimew ignores leap second if the timezone doesn't have leap seconds on the first call of init_leap_second_info() * Add Bug::Time.reset_leap_second_info for testing git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-05Revert "get rid of a compiler warning of VC"normal
Partially revert r63820. mjit.c seems to have different idea of "pid" type/size than the rest of Ruby on win32. As noted in [ruby-core:87794], this seems to break Greg's build. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-05unrevert r63852 but keep SIGCHLD path disabled for win32normal
Reading win32/win32.c waitpid implementation, maybe waitpid(-1, ...) on that platform will never conflict with mjit use of waitpid. In any case, I've added WAITPID_USE_SIGCHLD macro to vm_core.h so it can be easy for Linux/BSD users to test (hopefully!) win32-compatible code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-04signal.c: packed signalsnobu
* signal.c (signals): pack signal names instead of references. * signal.c (signm2signo): also reject too long signal name. [ruby-core:87767] [Bug #14893] reapply r63841 and r63842, which are unrelated to r63758 but had been wrongly reverted by r63852. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-04* 2018-07-05svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-04Revert r63758 and related commitsnaruse
The change is unstable on Windows. Please re-commit it when it correctly supports Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-04Fallback to Digest::SHA512kazu
`Gem::Package::TarWriter#add_file_signed` expects to fallback to `Digest::SHA512`, and `digest.respond_to? :name` or not. So lib/rubygems/security.rb should use same logic for `Gem::Security::DIGEST_ALGORITHM` and `Gem::Security::DIGEST_NAME`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-04Skip more rubygems tests when openssl is missingkazu
Some tests are already skipped, but some tests are not. So latter should be skipped too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-04Revert "Optimize Time.utc"naruse
This reverts commit r63848. It breaks tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-04Optimize Time.utcnaruse
Time.utc uses timegmw() and it uses leap second information. If the given time is larger than known_leap_seconds_limit, it calls find_time_t, which uses localtime(3) and calls stat(2) in it. This patch avoid it by setting known_leap_seconds_limit to 0 if the timezone doesn't have leapsecond information (if no leap second is found "now", I assume the timezone doesn't have leapsecond information). Before: % time ./miniruby --disable-gem -e'time = Time.now; year = time.year; month = time.month; day = time.day; hour = time.hour; min = time.min; sec = time.sec + time.subsec; i = 0; while i < 100000; ::Time.utc(year, month, day, hour, min, sec); i += 1; end' ./miniruby --disable-gem 0.35s user 0.19s system 99% cpu 0.542 total After: % time ./miniruby --disable-gem -e'time = Time.now; year = time.year; month = time.month; day = time.day; hour = time.hour; min = time.min; sec = time.sec + time.subsec; i = 0; while i < 100000; ::Time.utc(year, month, day, hour, min, sec); i += 1; end' ./miniruby --disable-gem 0.23s user 0.00s system 99% cpu 0.233 total git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-04internal.h (rb_warning_string): use PRINTF_ARGSnormal
Let compilers do a little extra validation for us git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-04thread_pthread.c: pass rb_vm_t to timer_thread_sleepnormal
I love `container_of' for generic data structures, but in this case it's unnecessary and slightly harder-to-read. This will make "Timeout in VM" slightly easier-to-read: https://bugs.ruby-lang.org/issues/14859 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-03vm.c: simplified core#hash_merge_kwdnobu
* vm.c (core_hash_merge_kwd): simplified to merge the second hash into the first hash. * compile.c (compile_array): call core#hash_merge_kwd with 2 hashes always, by passing an new empty hash to at the first iteration. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-03mjit.h: avoid signed pointer comparisons (fix for 32-bit)normal
ptrdiff_t is a signed type, use uintptr_t instead for unsigned comparisons. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-03* 2018-07-04svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-03Fix compile errorkazu
signal.c:69:10: error: variably modified ‘signm’ at file scope char signm[LONGEST_SIGNAME + 1]; ^ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e