| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Ensure it returns `nil` instead of segmentation faulting
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/568)
In https://github.com/ruby/irb/commit/3ee79e89adb8e21b63d796e53bcc86281685076d,
`encoding_aliases.rb` was introduced to return the correct encoding object for
`ujis` and `euc` encodings.
However, the return value of `@@legacy_encoding_alias_map[@encoding_name]`
is always overridden by a second look up with `Encoding.find(@encoding_name)`.
So the logic didn't work as expected.
This commit fixes the problem.
|
|
|
|
| |
This reverts commit e7cdce83e8c8797c481ccb54c260c0db1e1afa7c.
|
|
|
|
| |
https://github.com/ruby/pp/commit/09dae96129
|
|
|
|
| |
https://github.com/ruby/pp/commit/f7bde31ca9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, bmethod arguments are copied from the VM stack to the
C stack in vm_call_bmethod, then copied from the C stack to the VM
stack later in invoke_iseq_block_from_c. This is inefficient.
This adds vm_call_iseq_bmethod and vm_call_noniseq_bmethod.
vm_call_iseq_bmethod is an optimized method that skips stack
copies (though there is one copy to remove the receiver from
the stack), and avoids calling vm_call_bmethod_body,
rb_vm_invoke_bmethod, invoke_block_from_c_proc,
invoke_iseq_block_from_c, and vm_yield_setup_args.
Th vm_call_iseq_bmethod argument handling is similar to the
way normal iseq methods are called, and allows for similar
performance optimizations when using splats or keywords.
However, even in the no argument case it's still significantly
faster.
A benchmark is added for bmethod calling. In my environment,
it improves bmethod calling performance by 38-59% for simple
bmethod calls, and up to 180% for bmethod calls passing
literal keywords on both sides.
```
./miniruby-iseq-bmethod: 18159792.6 i/s
./miniruby-m: 13174419.1 i/s - 1.38x slower
bmethod_simple_1
./miniruby-iseq-bmethod: 15890745.4 i/s
./miniruby-m: 10008972.7 i/s - 1.59x slower
bmethod_simple_0_splat
./miniruby-iseq-bmethod: 13142804.3 i/s
./miniruby-m: 11168595.2 i/s - 1.18x slower
bmethod_simple_1_splat
./miniruby-iseq-bmethod: 12375791.0 i/s
./miniruby-m: 8491140.1 i/s - 1.46x slower
bmethod_no_splat
./miniruby-iseq-bmethod: 10151258.8 i/s
./miniruby-m: 8716664.1 i/s - 1.16x slower
bmethod_0_splat
./miniruby-iseq-bmethod: 8138802.5 i/s
./miniruby-m: 7515600.2 i/s - 1.08x slower
bmethod_1_splat
./miniruby-iseq-bmethod: 8028372.7 i/s
./miniruby-m: 5947658.6 i/s - 1.35x slower
bmethod_10_splat
./miniruby-iseq-bmethod: 6953514.1 i/s
./miniruby-m: 4840132.9 i/s - 1.44x slower
bmethod_100_splat
./miniruby-iseq-bmethod: 5287288.4 i/s
./miniruby-m: 2243218.4 i/s - 2.36x slower
bmethod_kw
./miniruby-iseq-bmethod: 8931358.2 i/s
./miniruby-m: 3185818.6 i/s - 2.80x slower
bmethod_no_kw
./miniruby-iseq-bmethod: 12281287.4 i/s
./miniruby-m: 10041727.9 i/s - 1.22x slower
bmethod_kw_splat
./miniruby-iseq-bmethod: 5618956.8 i/s
./miniruby-m: 3657549.5 i/s - 1.54x slower
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SystemStackError
Originally, when 2e7bceb34ea858649e1f975a934ce1894d1f06a6 fixed cfuncs to no
longer use the VM stack for large array splats, it was thought to have fully
fixed Bug #4040, since the issue was fixed for methods defined in Ruby (iseqs)
back in Ruby 2.2.
After additional research, I determined that same issue affects almost all
types of method calls, not just iseq and cfunc calls. There were two main
types of remaining issues, important cases (where large array splat should
work) and pedantic cases (where large array splat raised SystemStackError
instead of ArgumentError).
Important cases:
```ruby
define_method(:a){|*a|}
a(*1380888.times)
def b(*a); end
send(:b, *1380888.times)
:b.to_proc.call(self, *1380888.times)
def d; yield(*1380888.times) end
d(&method(:b))
def self.method_missing(*a); end
not_a_method(*1380888.times)
```
Pedantic cases:
```ruby
def a; end
a(*1380888.times)
def b(_); end
b(*1380888.times)
def c(_=nil); end
c(*1380888.times)
c = Class.new do
attr_accessor :a
alias b a=
end.new
c.a(*1380888.times)
c.b(*1380888.times)
c = Struct.new(:a) do
alias b a=
end.new
c.a(*1380888.times)
c.b(*1380888.times)
```
This patch fixes all usage of CALLER_SETUP_ARG with splatting a large
number of arguments, and required similar fixes to use a temporary
hidden array in three other cases where the VM would use the VM stack
for handling a large number of arguments. However, it is possible
there may be additional cases where splatting a large number
of arguments still causes a SystemStackError.
This has a measurable performance impact, as it requires additional
checks for a large number of arguments in many additional cases.
This change is fairly invasive, as there were many different VM
functions that needed to be modified to support this. To avoid
too much API change, I modified struct rb_calling_info to add a
heap_argv member for storing the array, so I would not have to
thread it through many functions. This struct is always stack
allocated, which helps ensure sure GC doesn't collect it early.
Because of how invasive the changes are, and how rarely large
arrays are actually splatted in Ruby code, the existing test/spec
suites are not great at testing for correct behavior. To try to
find and fix all issues, I tested this in CI with
VM_ARGC_STACK_MAX to -1, ensuring that a temporary array is used
for all array splat method calls. This was very helpful in
finding breaking cases, especially ones involving flagged keyword
hashes.
Fixes [Bug #4040]
Co-authored-by: Jimmy Miller <jimmy.miller@shopify.com>
|
| |
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/566)
https://github.com/ruby/irb/commit/df32e024be
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.72 to 0.9.74.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.72...v0.9.74)
---
updated-dependencies:
- dependency-name: rb-sys
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
|
|
|
|
|
|
|
| |
Previously, named memberless Structs were allowed, but anonymous
memberless Structs were not.
Fixes [Bug #19416]
|
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/564)
The current method-redefining approach brings little benefit, makes it
harder to understand the code, and causes warnings like:
> warning: method redefined; discarding old execute
This patch simplifies it while displaying more helpful message when rdoc
couldn't be loaded.
|
|
|
|
|
|
|
|
|
| |
<Class/Module>`
(https://github.com/ruby/irb/pull/562)
Instead of always printing methods inherited from Class or Module, IRB by
default should filter them out unless `<Class/Module>` is specified to be
either of those.
|
|
|
|
|
|
| |
comments
Fixes [Bug #19455]
|
|
|
|
|
|
|
|
|
|
| |
This check was introduced to match an assertion in the C YJIT when this
was originally introduced. I don't believe it's necessary for
correctness of the generated code.
Co-authored-by: Adam Hess <HParker@github.com>
Co-authored-by: Daniel Colson <danieljamescolson@gmail.com>
Co-authored-by: Luan Vieira <luanzeba@github.com>
|
|
|
|
|
|
|
|
| |
error when invalid yaml was provided"
This reverts commit https://github.com/rubygems/rubygems/commit/cfcfde04c783.
https://github.com/rubygems/rubygems/commit/ac21ae7083
|
| |
|
|
|
|
|
|
| |
dump_with_rubygems_yaml
https://github.com/rubygems/rubygems/commit/0393f24119
|
|
|
|
|
|
| |
invalid yaml was provided
https://github.com/rubygems/rubygems/commit/cfcfde04c7
|
|
|
|
|
|
| |
saveing configuration
https://github.com/rubygems/rubygems/commit/46438e61cd
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/9175b8cf2a
|
|
|
|
|
|
| |
Bundler::YAMLSerializer.load
https://github.com/rubygems/rubygems/commit/080880ac23
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/d842e2092f
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/e7d31405ea
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/1ed5fc018e
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/925f7f6717
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following code produces two NameErrors respectively
and they are independent, but the second one can show
`private constant` message because of first NameError.
```ruby
class C
class PrivateClass; end
private_constant :PrivateClass
end
begin
eval('class C::PrivateClass; end')
rescue => e
p e
end
begin
Object.const_get 'Foo'
rescue => e
p e
end
#<NameError: private constant C::PrivateClass referenced>
#<NameError: private constant C::Foo referenced>
#=> should be #<NameError: uninitialized constant Foo>
```
It fails the test-all tests with
`make test-all TESTS='ruby/class ruby/parse --seed=58891 -v`.
The reason is clear miss from https://github.com/ruby/ruby/commit/7387c08373a
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* Refactor Regexp#match cache implementation
Improved variable and function names
Fixed [Bug 19537] (Maybe fixed in https://github.com/ruby/ruby/pull/7694)
* Add a comment of the glossary for "match cache"
* Skip to reset match cache when no cache point on null check
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.71 to 0.9.72.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.71...v0.9.72)
---
updated-dependencies:
- dependency-name: rb-sys
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ruby/test_default_gems.rb can define empty `DidYouMean` module
because of the following line (second require) in the
`lib/did_you_mean/did_you_mean.gemspec`:
```ruby
begin
require_relative "lib/did_you_mean/version"
rescue LoadError # Fallback to load version file in ruby core repository
require_relative "version"
end
```
It defines only `::DidYouMean::VERSION`.
However, in the `test/ruby/test_patten_matching.rb` assumes that
if `defined?(DidYouMean)` is true, then there is a method `DidYouMean.formatter=`
and this assumption fails all tests in `test/ruby/test_patten_matching.rb` if
there is only a `::DidYouMean::VERSION`.
To reproduce the failures, we need to repeat the following command:
`make test-all TESTS='-v ruby/test_default_gems.rb ruby/pattern_matching'`
(because the ruby/test_default_gems.rb should be run before the ruby/pattern_matching`)
This patch introduces more strict gurds.
|
|
|
|
|
|
| |
[Feature #19561]
It's useful to be able to remove references from weak maps.
|
|
|
|
|
|
|
| |
remove dialog_proc
(https://github.com/ruby/reline/pull/532)
https://github.com/ruby/reline/commit/43283b2f37
|
| |
|
|
|
|
|
|
|
| |
[Feature #19538]
This new `peformance` warning category is disabled by default.
It needs to be specifically enabled via `-W:performance` or `Warning[:performance] = true`
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/33caea928e
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/4eaac27107
|
|
|
|
|
| |
Include the failed clock argument in the error message from
`Process.clock_gettime` and `Process.clock_getres`.
|
| |
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/bf5e82fd14
|
|
|
|
| |
Co-authored-by: Jenny Shen <jenny.shen@shopify.com>
|
|
|
|
|
|
| |
Update tests
Fix wording of message
|
|
|
|
|
|
| |
wait_for_otp
Co-authored-by: Betty Li <makewithbetty@gmail.com>
|
| |
|
|
|
|
| |
Co-authored-by: Jacques Chester <jacques.chester@shopify.com>
|
|
|
|
|
|
|
|
| |
class a wrapper around Net::HTTPResponse - Builds a Net::HTTPResponse upon initialization - to_s returns a string representation of the response to send - Adds a Socket Responder class to send responses given a socket
https://github.com/rubygems/rubygems/commit/7513c220b6
Co-authored-by: Jacques Chester <jacques.chester@shopify.com>
|
|
|
|
|
|
| |
RubyGems.org to render the response
https://github.com/rubygems/rubygems/commit/22b329eb60
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/c494112063
|
|
|
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/d42ddbb73c
Co-authored-by: Ashley Ellis Pierce <anellis12@gmail.com>
Co-authored-by: Jacques Chester <jacques.chester@shopify.com>
|