summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-03-19* 2020-03-19 [ci skip]git
2020-03-19.travis.yml: allow arm32-linux to fail卜部昌平
It seems fragile now, seemingly due to environmental issues. Lets allow it to fail for a while. Reported by Jun Agura <jaruga@redhat.com> [ruby-core:97540]
2020-03-18Added link to the ticket [ci skip]Kazuhiro NISHIYAMA
2020-03-18* 2020-03-18 [ci skip]git
2020-03-17Reduce allocations for keyword argument hashesJeremy Evans
Previously, passing a keyword splat to a method always allocated a hash on the caller side, and accepting arbitrary keywords in a method allocated a separate hash on the callee side. Passing explicit keywords to a method that accepted a keyword splat did not allocate a hash on the caller side, but resulted in two hashes allocated on the callee side. This commit makes passing a single keyword splat to a method not allocate a hash on the caller side. Passing multiple keyword splats or a mix of explicit keywords and a keyword splat still generates a hash on the caller side. On the callee side, if arbitrary keywords are not accepted, it does not allocate a hash. If arbitrary keywords are accepted, it will allocate a hash, but this commit uses a callinfo flag to indicate whether the caller already allocated a hash, and if so, the callee can use the passed hash without duplicating it. So this commit should make it so that a maximum of a single hash is allocated during method calls. To set the callinfo flag appropriately, method call argument compilation checks if only a single keyword splat is given. If only one keyword splat is given, the VM_CALL_KW_SPLAT_MUT callinfo flag is not set, since in that case the keyword splat is passed directly and not mutable. If more than one splat is used, a new hash needs to be generated on the caller side, and in that case the callinfo flag is set, indicating the keyword splat is mutable by the callee. In compile_hash, used for both hash and keyword argument compilation, if compiling keyword arguments and only a single keyword splat is used, pass the argument directly. On the caller side, in vm_args.c, the callinfo flag needs to be recognized and handled. Because the keyword splat argument may not be a hash, it needs to be converted to a hash first if not. Then, unless the callinfo flag is set, the hash needs to be duplicated. The temporary copy of the callinfo flag, kw_flag, is updated if a hash was duplicated, to prevent the need to duplicate it again. If we are converting to a hash or duplicating a hash, we need to update the argument array, which can including duplicating the positional splat array if one was passed. CALLER_SETUP_ARG and a couple other places needs to be modified to handle similar issues for other types of calls. This includes fairly comprehensive tests for different ways keywords are handled internally, checking that you get equal results but that keyword splats on the caller side result in distinct objects for keyword rest parameters. Included are benchmarks for keyword argument calls. Brief results when compiled without optimization: def kw(a: 1) a end def kws(**kw) kw end h = {a: 1} kw(a: 1) # about same kw(**h) # 2.37x faster kws(a: 1) # 1.30x faster kws(**h) # 2.19x faster kw(a: 1, **h) # 1.03x slower kw(**h, **h) # about same kws(a: 1, **h) # 1.16x faster kws(**h, **h) # 1.14x faster Notes: Merged: https://github.com/ruby/ruby/pull/2945
2020-03-17Make {**{}} return unfrozen empty hashJeremy Evans
Previously, method call keyword splats and hash keyword splats were compiled exactly the same. This is because parse-wise, they operate on indentical nodes when it comes to compiling the **{}. Fix this by using an ugly hack of temporarily modifying the nd_brace flag in the method call keyword splat case. Inside compile_hash, only optimize the **{} case for hashes where the nd_brace flag has been modified to reflect we are in the method call keyword splat case and it is safe to do so. Since compile_keyword_args is only called in one place, move the keyword_node_p call out of that method to the single caller to avoid duplicating the code. Notes: Merged: https://github.com/ruby/ruby/pull/2945
2020-03-17Get rid of bogus warning by VCNobuyoshi Nakada
``` c:\projects\ruby\mjit_worker.c(1219) : warning C4090: 'function' : different 'const' qualifiers ``` It seems confused by passing "pointer to pointer to const object", not "pointer to const object".
2020-03-17Check if `freeze` option is givenNobuyoshi Nakada
2020-03-17* 2020-03-17 [ci skip]git
2020-03-17support builtin for Kernel#cloneS.H
Notes: Merged: https://github.com/ruby/ruby/pull/2954 Merged-By: nobu <nobu@ruby-lang.org>
2020-03-16`Proc` made by `Hash#to_proc` should be a lambda [Bug #12671]Yusuke Endoh
Like `Symbol#to_proc` (f0b815dc670b61eba1daaa67a8613ac431d32b16)
2020-03-16Fix typos [ci skip]Kazuhiro NISHIYAMA
2020-03-16hash.c: Do not use the fast path (rb_yield_values) for lambda blocksYusuke Endoh
As a semantics, Hash#each yields a 2-element array (pairs of keys and values). So, `{ a: 1 }.each(&->(k, v) { })` should raise an exception due to lambda's arity check. However, the optimization that avoids Array allocation by using rb_yield_values for blocks whose arity is more than 1 (introduced at b9d29603375d17c3d1d609d9662f50beaec61fa1 and some commits), seemed to overlook the lambda case, and wrongly allowed the code above to work. This change experimentally attempts to make it strict; now the code above raises an ArgumentError. This is an incompatible change; if the compatibility issue is bigger than our expectation, it may be reverted (until Ruby 3.0 release). [Bug #12706]
2020-03-16The upstream repository of bundler was changed rubygems/rubygems now.Hiroshi SHIBATA
https://github.com/rubygems/rubygems/pull/3166
2020-03-16Do not make disabled directories at installation [Bug #12392]Nobuyoshi Nakada
2020-03-16Adjusted indents [ci skip]Nobuyoshi Nakada
2020-03-16proc.c: Remove non-sense /* fall through */Yusuke Endoh
2020-03-16* 2020-03-16 [ci skip]git
2020-03-15Add missing write barrier for Hash#transform_values{,!}Alan Wu
21994b7fd686f263544fcac1616ecf3189fb78b3 removed the write barrier that was present in rb_hash_aset(). Re-insert it to not crash during GC. [Bug #16689] Notes: Merged: https://github.com/ruby/ruby/pull/2964
2020-03-15Enclosed version constantNobuyoshi Nakada
2020-03-15Added guard against [Bug #16497]Nobuyoshi Nakada
2020-03-15[ruby/stringio] Bump version to 0.1.1Nobuyoshi Nakada
https://github.com/ruby/stringio/commit/05d75e5e66
2020-03-15[ruby/stringio] StringIO#initialize default to the source string encodingJean Boussier
[Bug #16497] https://github.com/ruby/stringio/commit/4958a5ccab
2020-03-15Avoid doubly showing debug countersTakashi Kokubun
when RubyVM.show_debug_counters is explicitly called. According to the original description in 70fd099220446e39bb80eb0bb32870ce12134619, I think it's not intended to use the exit counter at all, and I'd like to skip it when I need to explicitly call this.
2020-03-15Add debug counter for unload_unitsTakashi Kokubun
changing add_iseq_to_process's debug counter name as well for comparison
2020-03-14Resurrect test_jit_debug.rbTakashi Kokubun
Revert "Temporarily drop test_jit_debug.rb" This reverts commit 5437d7c879585fbdb0c294298eb76cc563e01c69. Skipped some CIs which were failing previously.
2020-03-14Use a human-readable funcname with --jit-debugTakashi Kokubun
for perf output like: Samples: 100K of event 'cycles:ppp', Event count (approx.): 1007750000 Children Self Command Shared Object Symbol + 81.58% 1.47% ruby ruby [.] rb_vm_exec + 81.06% 7.61% ruby ruby [.] vm_exec_core + 80.16% 0.00% ruby ruby [.] vm_sendish (inlined) + 75.03% 0.00% ruby ruby [.] mjit_exec (inlined) + 74.37% 0.00% ruby ruby [.] mjit_exec (inlined) + 73.42% 0.22% ruby _ruby_mjit_p11277u42.so [.] _mjit42_rack_method_override_rb_call + 73.25% 0.10% ruby _ruby_mjit_p11277u41.so [.] _mjit41_sinatra_show_exceptions_rb_call + 73.19% 0.22% ruby _ruby_mjit_p11277u44.so [.] _mjit44_rack_head_rb_call + 73.03% 0.15% ruby _ruby_mjit_p11277u45.so [.] _mjit45_sinatra_base_rb_call + 72.87% 0.26% ruby _ruby_mjit_p11277u49.so [.] _mjit49_rack_logger_rb_call + 70.56% 0.11% ruby _ruby_mjit_p11277u40.so [.] _mjit40_sinatra_base_rb_call + 68.70% 0.11% ruby _ruby_mjit_p11277u39.so [.] _mjit39_sinatra_base_rb_call + 68.39% 0.29% ruby _ruby_mjit_p11277u56.so [.] _mjit56_rack_protection_frame_options_rb_call + 67.89% 0.18% ruby _ruby_mjit_p11277u37.so [.] _mjit37_sinatra_base_rb_block_in_call + 67.04% 0.16% ruby _ruby_mjit_p11277u34.so [.] _mjit34_sinatra_base_rb_synchronize Reverting deb1c7b97d, fixing `sprint_funcname`'s argument in `compact_all_jit_code`. Also updating common.mk.
2020-03-14Revert "Use a human-readable funcname with --jit-debug"Takashi Kokubun
This reverts commit cecebf55c476ae936f3e880477dfb62149143c46. debugging test failure...
2020-03-15* 2020-03-15 [ci skip]git
2020-03-14Use a human-readable funcname with --jit-debugTakashi Kokubun
for perf output like: Samples: 100K of event 'cycles:ppp', Event count (approx.): 1007750000 Children Self Command Shared Object Symbol + 81.58% 1.47% ruby ruby [.] rb_vm_exec + 81.06% 7.61% ruby ruby [.] vm_exec_core + 80.16% 0.00% ruby ruby [.] vm_sendish (inlined) + 75.03% 0.00% ruby ruby [.] mjit_exec (inlined) + 74.37% 0.00% ruby ruby [.] mjit_exec (inlined) + 73.42% 0.22% ruby _ruby_mjit_p11277u42.so [.] _mjit42_rack_method_override_rb_call + 73.25% 0.10% ruby _ruby_mjit_p11277u41.so [.] _mjit41_sinatra_show_exceptions_rb_call + 73.19% 0.22% ruby _ruby_mjit_p11277u44.so [.] _mjit44_rack_head_rb_call + 73.03% 0.15% ruby _ruby_mjit_p11277u45.so [.] _mjit45_sinatra_base_rb_call + 72.87% 0.26% ruby _ruby_mjit_p11277u49.so [.] _mjit49_rack_logger_rb_call + 70.56% 0.11% ruby _ruby_mjit_p11277u40.so [.] _mjit40_sinatra_base_rb_call + 68.70% 0.11% ruby _ruby_mjit_p11277u39.so [.] _mjit39_sinatra_base_rb_call + 68.39% 0.29% ruby _ruby_mjit_p11277u56.so [.] _mjit56_rack_protection_frame_options_rb_call + 67.89% 0.18% ruby _ruby_mjit_p11277u37.so [.] _mjit37_sinatra_base_rb_block_in_call + 67.04% 0.16% ruby _ruby_mjit_p11277u34.so [.] _mjit34_sinatra_base_rb_synchronize
2020-03-14* 2020-03-14 [ci skip]git
2020-03-14Fix bundled gems installation on a fresh cloneDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/2951
2020-03-14Use new `prepare-gems` target when possibleDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/2951
2020-03-13tool/redmine-backporter.rb: fix typoNARUSE, Yui
2020-03-13Update and extract for each gemNobuyoshi Nakada
2020-03-12Avoid referring to an old value of reallocTakashi Kokubun
OpenBSD RubyCI has failed with SEGV since 4bcd5981e80d3e1852c8723741a0069779464128. https://rubyci.org/logs/rubyci.s3.amazonaws.com/openbsd-current/ruby-master/log/20200312T223005Z.fail.html.gz This was because `status->cc_entries` could be stale after `realloc` call for inlined iseqs.
2020-03-12Mark all cc_entries associated to compiled_iseqTakashi Kokubun
2020-03-12Move code to mark jit_unit's cc_entries to mjit.cTakashi Kokubun
2020-03-12Skip test_abort_tls with --jit-wait for nowTakashi Kokubun
Perhaps the server blocks for an unexpectedly long time by waiting for JIT. As it's usually passing, I don't think it's detecting a bug.
2020-03-12Correctly detect whether strict alignment is needed on OpenBSDJeremy Evans
From Stefan Sperling <stsp@apache.org>
2020-03-13* 2020-03-13 [ci skip]git
2020-03-13`update-gems` should wait for `update-bundled_gems`Nobuyoshi Nakada
2020-03-12Add prepare-gems to download and extract bundled gemsNobuyoshi Nakada
2020-03-12Add workaround for test-bundler failureKazuhiro NISHIYAMA
https://github.com/ruby/actions/runs/500526558?check_suite_focus=true#step:16:127 ``` Failures: 1) Bundler.setup when Bundler is bundled doesn't blow up Failure/Error: expect(err).to be_empty expected `"fatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (o...the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git".empty?` to return true, got false Commands: $ /home/runner/work/actions/actions/snapshot-master/ruby \ -I/home/runner/work/actions/actions/snapshot-master/lib:/home/runner/work/actions/actions/snapshot-master/spec/bundler \ -rsupport/hax -rsupport/artifice/fail \ /home/runner/work/actions/actions/snapshot-master/libexec/bundle install --retry 0 Resolving dependencies... Using bundler 2.1.4 Bundle complete! 1 Gemfile dependency, 1 gem now installed. Use `bundle info [gemname]` to see where a bundled gem is installed. fatal: not a git repository (or any of the parent directories): .git fatal: not a git repository (or any of the parent directories): .git fatal: not a git repository (or any of the parent directories): .git # $? => 0 $ /home/runner/work/actions/actions/snapshot-master/ruby \ -I/home/runner/work/actions/actions/snapshot-master/lib:/home/runner/work/actions/actions/snapshot-master/spec/bundler \ -rsupport/hax -rsupport/artifice/fail \ /home/runner/work/actions/actions/snapshot-master/libexec/bundle exec ruby -e \ require\ \'bundler\'\;\ Bundler.setup fatal: not a git repository (or any of the parent directories): .git fatal: not a git repository (or any of the parent directories): .git fatal: not a git repository (or any of the parent directories): .git # $? => 0 # ./spec/bundler/runtime/setup_spec.rb:1056:in `block (3 levels) in <top (required)>' # ./spec/bundler/spec_helper.rb:111:in `block (3 levels) in <top (required)>' # ./spec/bundler/spec_helper.rb:111:in `block (2 levels) in <top (required)>' # ./spec/bundler/spec_helper.rb:78:in `block (2 levels) in <top (required)>' make: *** [yes-test-bundler] Error 1 ```
2020-03-12Pass keyword argument by RB_PASS_KEYWORDSNobuyoshi Nakada
To pass `false` as `freeze:` keyword argument, `kw_splat` argument should be true. Also `rb_keyword_given_p()` should return true here as `false` has been given as a keyword argument.
2020-03-12* 2020-03-12 [ci skip]git
2020-03-12Update some syslog tests to absurb the format change of FreeBSD syslogYusuke Endoh
FreeBSD ``` $ ruby -rsyslog -e 'Syslog.open("rubyspec", Syslog::LOG_PERROR) {|s| s.log(Syslog::LOG_ALERT, "Hello") }' rubyspec 78462 - - Hello ``` Linux ``` $ ruby -rsyslog -e 'Syslog.open("rubyspec", Syslog::LOG_PERROR) {|s| s.log(Syslog::LOG_ALERT, "Hello") }' rubyspec: Hello ``` https://github.com/freebsd/freebsd/commit/591ef7c8076109cff3c41f9bb50da996a34121e9
2020-03-11parse.y: hoisted out new_nil_atNobuyoshi Nakada
new_nil_at: create NEW_NIL node with zero-width location.
2020-03-11parse.y: unified kwrest and no-kwrestNobuyoshi Nakada
2020-03-11Pin and inline cme in JIT-ed method callsTakashi Kokubun
``` $ benchmark-driver benchmark.yml -v --rbenv 'before --jit;after --jit' --repeat-count=12 --output=all before --jit: ruby 2.8.0dev (2020-03-11T07:43:12Z master e89ebdcb87) +JIT [x86_64-linux] after --jit: ruby 2.8.0dev (2020-03-11T07:54:18Z master 143776a0da) +JIT [x86_64-linux] Calculating ------------------------------------- before --jit after --jit Optcarrot Lan_Master.nes 73.86976729561439 77.20184819316513 fps 74.46997176460742 78.43493030231805 77.59686308754307 78.55714131655935 78.53693921126656 79.08984255596820 80.10158944910573 79.17751731838183 80.12254974411167 79.60853122429181 80.28678655204945 79.74674066871896 80.38690681095379 79.90624544440300 80.79223498756919 80.57881084206193 80.82857188422419 80.70677614429169 81.06447745878245 81.03868541295149 81.21620802278490 82.16354660940607 ```