Commit graph

74217 commits

Author SHA1 Message Date
eileencodes
0ab0229c11 Fix frozen object inspect
In the rails/rails CI build for Ruby master we found that some tests
were failing due to inspect on a frozen object being incorrect.

An object's instance variable count was incorrect when frozen causing
the object's inspect to not splat out the object.

This fixes the issue and adds a test for inspecting frozen objects.

Co-Authored-By: Jemma Issroff <jemmaissroff@gmail.com>
Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
2022-09-30 13:57:59 -07:00
David Rodríguez
a44040c9e4 [rubygems/rubygems] Add notes to make sure we don't forget to backport changes to Bundler
1ac5b14c78

Co-authored-by: André Arko <andre@arko.net>
2022-10-01 05:46:41 +09:00
David Rodríguez
f04d249e83 [rubygems/rubygems] Fix matching of eabihf platforms
a03d30cd58
2022-10-01 05:46:40 +09:00
David Rodríguez
8252ea2140 [rubygems/rubygems] Fix matching of linux platforms with eabi modifiers
89362c18ef

Co-authored-by: Mike Dalessio <mike.dalessio@gmail.com>
2022-10-01 05:46:40 +09:00
David Rodríguez
4d58ee3de0 [rubygems/rubygems] Refactor platform matching on Linux
I think this highlights better how musl is special.

4075771697
2022-10-01 05:46:39 +09:00
Jemma Issroff
850cfb021e Only assert ractor_shareable is consistent on ivar_set for T_OBJECT
Before d594a5a8bd, we were only
asserting that the value on an ivar_get was ractor_sharable if the
object was a T_OBJECT and also ractor shareable. We should still
be doing this check only if the object is a T_OBJECT and ractor
shareable
2022-09-30 12:41:12 -07:00
tompng
641310ce37 [ruby/irb] Fix ripper_lex_without_warning duplicated heredoc token
45b539af39
2022-10-01 04:17:15 +09:00
Jimmy Miller
31461c7e0e
A bunch of clippy auto fixes for yjit (#6476) 2022-09-30 11:14:55 -04:00
Victor Shepelev
ad651925e3
Add Data class implementation: Simple immutable value object 2022-09-30 18:23:19 +09:00
Nobuyoshi Nakada
e294e6f417
Split with_warning_string_from for the last named parameter 2022-09-30 17:29:23 +09:00
Yusuke Endoh
962f9932af [rubygems/rubygems] Prevent a "warning: assigned but unused variable - data"
ec3fd55d40
2022-09-30 15:50:46 +09:00
Nobuyoshi Nakada
ab31d2e69f
Add --zone option to VCS
Which controls the timezone offset for `RUBY_RELEASE_DATE`.
2022-09-30 10:39:43 +09:00
Nobuyoshi Nakada
5a5644dadc
Introduce VCS::Null for fallback 2022-09-30 10:39:42 +09:00
Nobuyoshi Nakada
f70ba9cf80
Check for the availability of the command when detecting 2022-09-30 10:39:42 +09:00
Nobuyoshi Nakada
58b3a535cc
Pull up VCS.short_revision from VCS::SVN 2022-09-30 09:21:02 +09:00
Benoit Daloze
aa490f9442 Reduce diff to proc.c @ b0b9f7201a
* So it's easy to review https://github.com/ruby/ruby/pull/6242 +
  https://github.com/ruby/ruby/pull/6467 and there are less changes
  overall.
2022-09-29 15:48:35 +02:00
Benoit Daloze
c6319026ca Extend tests for a zsuper method of which the method it resolved to has been removed 2022-09-29 15:48:35 +02:00
Benoit Daloze
6b7d32a5e5 Resolve zsuper method during lookup but preserve owner separately
* See https://bugs.ruby-lang.org/issues/18729#note-34
* See [Bug #18729]
2022-09-29 15:48:35 +02:00
Benoit Daloze
aa53d69aa2 Add specs for {Method,UnboundMethod}#owner of a zsuper method 2022-09-29 15:48:35 +02:00
Benoit Daloze
94cea3e4d0 Fix {Method,UnboundMethod}#super_method for zsuper methods
* We need to resolve the zsuper method first, and then look the super
  method of that.
2022-09-29 15:48:35 +02:00
Matt Valentine-House
892f350a7d [Bug #19029] Don't start GC during compaction
RARRAY_PTR when called with a transient array detransients the array
before returning its pointer which allocates in the heap.

Because RARRAY_PTR was being used during compaction (when re-embedding
arrays that have moved between size pools) this introduces the
possibility that we can hit a malloc threshold, triggering GC, while in
the middle of compaction.

We should avoid this by using safer functions to get hold of the
pointer. Since we know that the array is not embedded here, we can use
ARY_HEAP_PTR and ARY_EMBED_PTR directly
2022-09-29 09:22:14 -04:00
git
4ced7bfb23 Update bundled gems list at 866cfb248e [ci skip] 2022-09-29 12:05:31 +00:00
Shugo Maeda
866cfb248e
Update bundled_gems 2022-09-29 21:03:57 +09:00
Jenny Shen
28840d74c2 [rubygems/rubygems] Refine error message to check the push URL instead of just the host
46990f3292
2022-09-29 17:56:36 +09:00
Jenny Shen
0522e31d57 [rubygems/rubygems] Refactor tests to use Net::HTTPResponse instances for fetcher.data[:path]
4d91cacb1f

Co-authored-by: Jacques Chester <jacques.chester@shopify.com>
2022-09-29 17:56:36 +09:00
Jenny Shen
17b783ad9e [rubygems/rubygems] Surface entire redirect uri in permanent redirections
da7837630b
2022-09-29 17:56:35 +09:00
Jenny Shen
1cbf0fd863 [rubygems/rubygems] Add error message when api response is a permanent redirect
ccca30c77a

Co-authored-by: Nick Schwaderer <nick.schwaderer@shopify.com>
2022-09-29 17:56:34 +09:00
Hiroshi SHIBATA
9948b8bfec
Skip unpack_sockaddr_in with http at Solaris platform
20220929T050003Z.fail.html.gz
2022-09-29 15:47:08 +09:00
Nobuyoshi Nakada
cb16dcb184 [ruby/date] The shrunk words to be copied is limited
Th buffer size is small enough and no need to allocate dynamically.

f62bf0a01d
2022-09-29 14:56:39 +09:00
Nobuyoshi Nakada
942066713b
bootstraptest/runner: run in parallel if in parallel build 2022-09-29 14:09:25 +09:00
Nobuyoshi Nakada
5a8aaedaff [ruby/date] Narrow ALLOCV region for shrunk words
f51b038074
2022-09-29 14:06:36 +09:00
git
2f7a530f59 Update bundled gems list at 8c4e52fbe8 [ci skip] 2022-09-29 01:28:41 +00:00
Hiroshi SHIBATA
8c4e52fbe8
Update bundled_gems 2022-09-29 10:27:29 +09:00
Samuel Williams
e7ddb6b182
Update NEWS.md with updated coverage interfaces. 2022-09-29 09:44:14 +13:00
Samuel Williams
bd2fbd3588
Add Coverage.supported? to detect what modes are supported. 2022-09-29 09:44:14 +13:00
Samuel Williams
9dd902b831
Add eval: true/false flag to Coverage.setup. 2022-09-29 09:44:14 +13:00
David Rodríguez
ac56e5c1ab [rubygems/rubygems] Put bundler gemspec stub at the right place
So that it's found when needed, rather than dynamically modifying
loaded stubs and thus messing with RubyGems internals.

cd3e7cb9e5
2022-09-29 03:41:53 +09:00
David Rodríguez
668e78f01b [rubygems/rubygems] Only activate bundler when needed
Loading Bundler beforehand was actually replacing ENV with a backup of
the pre-Bundler environment through `Bundler::EnvironmentPreserver`. I
think that was making a bug in `ENV.replace` not bite our tests, because
Bundler includes proper patches to workaround that issue. So this commit
also includes these patches in RubyGems tests.

8e079149b9
2022-09-29 03:41:52 +09:00
David Rodríguez
20eff52087 [rubygems/rubygems] Test a pure RubyGems method
`Gem::Specification#load_paths` is actually a Bundler thing.

d20b4d1950
2022-09-29 03:41:52 +09:00
David Rodríguez
00a040dda3 [rubygems/rubygems] Little refactor to keep things consistent
3934deb4e4
2022-09-29 03:41:51 +09:00
David Rodríguez
874a2bf17c [rubygems/rubygems] Remove unnecessary ensure
6c0c02c533
2022-09-29 03:41:51 +09:00
David Rodríguez
c7232a2a0a [rubygems/rubygems] Require bundler consistently
The `$LOAD_PATH` should be properly setup so that the local version is
used.

03c0ab4082
2022-09-29 03:41:50 +09:00
David Rodríguez
b9c426eaea [rubygems/rubygems] Remove unnecessary constant
4bd77488ad
2022-09-29 03:41:50 +09:00
David Rodríguez
1e5597532a [rubygems/rubygems] Cleaup unnecessary code
2e05dadbc5
2022-09-29 03:41:49 +09:00
David Rodríguez
5222a89ab6 [rubygems/rubygems] Unskip stuff that now works on JRuby
d86a5ae2eb
2022-09-29 03:41:49 +09:00
Benoit Daloze
31cf1bb525 Update to ruby/spec@1d9d5c6 2022-09-28 18:37:17 +02:00
Benoit Daloze
5a1ab740fc Update to ruby/mspec@b60306d 2022-09-28 18:37:16 +02:00
Aaron Patterson
3e7c42a239
Shapes wrappers shouldn't mark the shape
We don't allocate shapes out of the GC anymore, so we shouldn't mark
those pointers.
2022-09-28 09:24:35 -07:00
git
414f1066b1 * expand tabs. [ci skip]
Tabs were expanded because the file did not have any tab indentation in unedited lines.
Please update your editor config, and use misc/expand_tabs.rb in the pre-commit hook.
2022-09-29 00:27:12 +09:00
Jemma Issroff
d594a5a8bd
This commit implements the Object Shapes technique in CRuby.
Object Shapes is used for accessing instance variables and representing the
"frozenness" of objects.  Object instances have a "shape" and the shape
represents some attributes of the object (currently which instance variables are
set and the "frozenness").  Shapes form a tree data structure, and when a new
instance variable is set on an object, that object "transitions" to a new shape
in the shape tree.  Each shape has an ID that is used for caching. The shape
structure is independent of class, so objects of different types can have the
same shape.

For example:

```ruby
class Foo
  def initialize
    # Starts with shape id 0
    @a = 1 # transitions to shape id 1
    @b = 1 # transitions to shape id 2
  end
end

class Bar
  def initialize
    # Starts with shape id 0
    @a = 1 # transitions to shape id 1
    @b = 1 # transitions to shape id 2
  end
end

foo = Foo.new # `foo` has shape id 2
bar = Bar.new # `bar` has shape id 2
```

Both `foo` and `bar` instances have the same shape because they both set
instance variables of the same name in the same order.

This technique can help to improve inline cache hits as well as generate more
efficient machine code in JIT compilers.

This commit also adds some methods for debugging shapes on objects.  See
`RubyVM::Shape` for more details.

For more context on Object Shapes, see [Feature: #18776]

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
Co-Authored-By: Eileen M. Uchitelle <eileencodes@gmail.com>
Co-Authored-By: John Hawthorn <john@hawthorn.email>
2022-09-28 08:26:21 -07:00