Age | Commit message (Collapse) | Author |
|
|
|
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]
|
|
|
|
|
|
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
|
|
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
|
|
```
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".
|
|
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/2954
Merged-By: nobu <nobu@ruby-lang.org>
|
|
Like `Symbol#to_proc` (f0b815dc670b61eba1daaa67a8613ac431d32b16)
|
|
|
|
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]
|
|
https://github.com/rubygems/rubygems/pull/3166
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
https://github.com/ruby/stringio/commit/05d75e5e66
|
|
[Bug #16497]
https://github.com/ruby/stringio/commit/4958a5ccab
|
|
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.
|
|
changing add_iseq_to_process's debug counter name as well for comparison
|
|
Revert "Temporarily drop test_jit_debug.rb"
This reverts commit 5437d7c879585fbdb0c294298eb76cc563e01c69.
Skipped some CIs which were failing previously.
|
|
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.
|
|
This reverts commit cecebf55c476ae936f3e880477dfb62149143c46.
debugging test failure...
|
|
|
|
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
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/2951
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/2951
|
|
|
|
|
|
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.
|
|
|
|
|
|
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.
|
|
From Stefan Sperling <stsp@apache.org>
|
|
|
|
|
|
|
|
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
```
|
|
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.
|
|
|
|
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
|
|
new_nil_at: create NEW_NIL node with zero-width location.
|
|
|
|
```
$ 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
```
|