71840 Commits

Author SHA1 Message Date
Soutaro Matsumoto
25eb63fa7f
Bundle RBS 2.4.0 (#5894) 2022-05-08 23:04:25 +09:00
git
6fa7d010c8 * 2022-05-08 [ci skip] 2022-05-08 07:23:16 +09:00
Samuel Williams
fd6cef79f5
Use a proper mutex for autoloading features. (#5788)
Object#autoload implements a custom per-thread "mutex" for blocking
threads waiting on autoloading a feature. This causes problems when used
with the fiber scheduler. We swap the implementation to use a Ruby mutex
which is fiber aware.
2022-05-08 10:22:58 +12:00
git
679b6e43c7 * 2022-05-07 [ci skip] 2022-05-07 18:31:35 +09:00
Kazuhiro NISHIYAMA
2a6f79364a
Replace with https://github.com [ci skip] 2022-05-07 18:30:56 +09:00
Kazuhiro NISHIYAMA
67950a4c0a
Fix missing paren [ci skip] 2022-05-06 18:13:22 +09:00
Dominik Bauernfeind
d79e0832a5 [rubygems/rubygems] Fix typo in documentation
https://github.com/rubygems/rubygems/commit/800a973e00
2022-05-06 18:03:00 +09:00
nobuyo
7d6de74abe [rubygems/rubygems] Update man page for require option in bundle add command
https://github.com/rubygems/rubygems/commit/08a0a5b7d1
2022-05-06 18:02:35 +09:00
Alan Wu
cae85c528c Mark RCLASS_INCLUDER
Since 4d8f76286beefbb8f7fba2479f6d0a0b4a47304c, we need to dereference
the includer field on iclasses, so we need to mark it to make sure
it's alive.

Sometimes during compaction we crash because the field is dangling,
though I have a hard time constructing such a situation. See
http://ci.rvm.jp/results/trunk@ruby-iga/3947725
2022-05-05 17:37:07 -04:00
Alan Wu
7448afccb3 Fix potential GC issue while iterating over weak refs
While walking over the list of subclasses for `include` and friends, we
check whether the subclass is a garbage object. After the check, we
allocate objects which might trigger GC and make the subclass garbage,
even though before the allocation the subclass was not garbage. This is
a sort of time-of-check-time-of-use issue.

Fix this by saving the weak reference to a local variable, upgrading it
to a strong reference while we do the allocation. It makes the code look
slightly nicer even if it doesn't fix any runtime issues.
2022-05-05 17:37:07 -04:00
git
4acafdf632 * 2022-05-06 [ci skip] 2022-05-06 05:03:10 +09:00
Burdette Lamar
ae96ef9cfb
File rdoc (#5888)
Treats:
    ::pipe?
    ::symlink?
    ::socket?
    ::blockdev?
    ::chardev?
2022-05-05 15:02:54 -05:00
Burdette Lamar
ac75c710cc
Link from printf methods to format spec doc (#5886) 2022-05-05 09:01:12 -05:00
Akira Matsuda
0b62535219 [ruby/logger] Prefer String#[0, 1] over [0..0]
[0..0] internally creates an extra Array object, and so is slower and much more memory consuming

https://github.com/ruby/logger/commit/20616ad34a
2022-05-05 19:09:49 +09:00
git
4f25971f05 * remove trailing spaces. [ci skip] 2022-05-05 05:05:04 +09:00
Burdette Lamar
197f9e9d42
[DOC] More on format specs (#5877)
* Update doc/format_specifications.rdoc

Co-authored-by: Peter Zhu <peter@peterzhu.ca>
2022-05-04 15:04:36 -05:00
git
8009d8a9ba * 2022-05-05 [ci skip] 2022-05-05 04:49:36 +09:00
Jemma Issroff
d7df8c6964 Unpoison freelist when iterating over it in gc_sweep_page 2022-05-04 12:49:15 -07:00
Jemma Issroff
3a31b80bea Update lldb helper for iseq disassembly to use correct var name 2022-05-04 12:48:49 -07:00
Peter Zhu
bff31b3208 Remove unneeded cast
`start` is of type uintptr_t so it does not need to be casted to VALUE.
2022-05-04 09:24:03 -04:00
David Rodríguez
9d61c4519c [rubygems/rubygems] Also speed up the case when nothing changed
https://github.com/rubygems/rubygems/commit/fa0ac74883
2022-05-04 06:45:16 +09:00
David Rodríguez
42538ad710 [rubygems/rubygems] Fix missing space in spec
https://github.com/rubygems/rubygems/commit/fabc357e70
2022-05-04 06:45:16 +09:00
David Rodríguez
2cf4318645 [rubygems/rubygems] Make looping more concise with select
https://github.com/rubygems/rubygems/commit/c43d5f979a
2022-05-04 06:45:15 +09:00
David Rodríguez
ba4ec45cf1 [rubygems/rubygems] Don't converge specs in frozen mode
https://github.com/rubygems/rubygems/commit/ea09bc4680
2022-05-04 06:45:15 +09:00
Alan Wu
379f5a6e8e Update reference for RCLASS_INCLUDER during compaction
We didn't update the includer field during compaction so it could become
a dangling pointer after compaction. It's only recently that we started
to dereference the field, and we were only comparing the pointer before
then, so the omission only recently started to cause crashes.

By instrumenting object.c:833 with `rp(includer);`, you can see the
includer field become `T_NONE` with the following script:

```ruby
mod = Module.new do
  protected def foo = 1
end

klass = Class.new do
  include Module.new
  def run
    foo
  end
end

klass.include(mod)

GC.verify_compaction_references(double_heap: true, toward: :empty)

klass.new.run
```

I found a crash in a private application that this patch fixes, but
wasn't able to develop a small reproducer. Hence the above demo that
requires instrumentation.
2022-05-03 16:48:46 -04:00
Maxime Chevalier-Boisvert
cf71e5f62a
Add a regression test for opt_plus with unknown type (#5878) 2022-05-03 13:44:43 -04:00
git
4d28553c7d * 2022-05-04 [ci skip] 2022-05-04 02:00:24 +09:00
Nobuyoshi Nakada
529c98ab90
[DOC] mention macros for public headers 2022-05-04 01:23:26 +09:00
Peter Zhu
fe7c02c744 Remove _with_gc functions in darray
darray was used in YJIT which required the functions to not trigger GC.
YJIT has now moved to Rust and does not use darray anymore, so we can
remove the functions that don't trigger GC and only keep the ones that
trigger GC.
2022-05-03 09:07:39 -04:00
Maxime Chevalier-Boisvert
35e111fd3e
Fix bug identified by @noahgibbs. (#5876)
Turned out to be a one-character fix :)
2022-05-02 16:30:05 -04:00
Alan Wu
5f20f4deee YJIT: Reject USE_FLONUM=0 builds at build time
YJIT can't support these builds so it's better to reject with a message
than to crash at runtime.
2022-05-02 14:03:56 -04:00
Alan Wu
b793245dac
[DOC] Some YJIT dependencies are no longer required
The `capstone` crate on crates.io does not need `libcapstone` on the system
because it builds from [source].
`gdbm` is now a separate gem (thanks for extracting it!).

[source]: c31409905a/capstone-sys/build.rs (L143)
2022-05-02 14:00:35 -04:00
Nobuyoshi Nakada
049303eff3
[DOC] Fix links to doc pages 2022-05-03 02:37:52 +09:00
git
503f2292bd * 2022-05-03 [ci skip] 2022-05-03 01:09:47 +09:00
Burdette Lamar
51ac3c9e80 [ruby/getoptlong] Enhanced RDoc for GetoptLong (https://github.com/ruby/getoptlong/pull/4)
Detailed introductory material.

https://github.com/ruby/getoptlong/commit/1544f2fb7b
2022-05-03 01:09:33 +09:00
Koichi ITO
8587bacc25
YJIT: Remove redundant extern crate (#5869)
Follow up https://github.com/ruby/ruby/commit/0514d81

Rust YJIT requires Rust 1.60.0 or later. So, `extern crate` looks unnecessary
because it can use the following Rust 2018 edition feature:
https://doc.rust-lang.org/stable/edition-guide/rust-2018/path-changes.html#no-more-extern-crate

It passes the following tests.

```console
% cd yjit
% cargo test --features asm_comments,disasm
(snip)

test result: ok. 56 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
```
2022-05-02 10:05:01 -04:00
dependabot[bot]
63932ec33e Bump github/codeql-action from 1 to 2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-02 11:22:26 +09:00
Kazuhiro NISHIYAMA
2e901368ea
Fix a typo [ci skip] 2022-05-02 08:58:46 +09:00
git
72c8d4fd3a * 2022-05-02 [ci skip] 2022-05-02 02:27:10 +09:00
Burdette Lamar
fef79dfa25
Repair internal links (#5866)
* Repair internal links

* Minor changes to format spec
2022-05-01 12:26:42 -05:00
Chris Seaton
3a8d60f503
Document best-practices for writing hash methods (#5805)
* Discussion is as per https://bugs.ruby-lang.org/issues/18611.

Co-authored-by: Sam Bostock <sam.bostock@shopify.com>
2022-04-30 12:57:51 +02:00
Alan Wu
5c843a1a6e
YJIT: Enable default rustc lints (warnings) (#5864)
`rustc` performs in depth dead code analysis and issues warning
even for things like unused struct fields and unconstructed enum
variants. This was annoying for us during the port but hopefully
they are less of an issue now.

This patch enables all the unused warnings we disabled and address
all the warnings we previously ignored. Generally, the approach I've
taken is to use `cfg!` instead of using the `cfg` attribute and
to delete code where it makes sense. I've put `#[allow(unused)]`
on things we intentionally keep around for printf style debugging
and on items that are too annoying to keep warning-free in all
build configs.
2022-04-29 18:20:23 -04:00
Burdette Lamar
7c039e423c
[DOC] Format specs (#5857)
This new document would eventually replace the format spec discussion at Kernel#sprintf.
2022-04-29 17:04:05 -05:00
git
d0ff7a5930 * 2022-04-30 [ci skip] 2022-04-30 04:04:07 +09:00
Alan Wu
fead7107ab YJIT: Adopt Clippy suggestions we like
This adopts most suggestions that rust-clippy is confident enough to
auto apply. The manual changes mostly fix manual if-lets and take
opportunities to use the `Default` trait on standard collections.

Co-authored-by: Kevin Newton <kddnewton@gmail.com>
Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
2022-04-29 15:03:45 -04:00
Dmitry Dygalo
f8e4488e5e
YJIT: Do not create CodeBlock.asm_comments if the asm_comments feature is disabled (#5863) 2022-04-29 10:07:48 -04:00
Matthias Viehweger
5741ae379b [rubygems/rubygems] Generalize description to account for different push servers
https://github.com/rubygems/rubygems/commit/cbf13edd3a
2022-04-29 17:19:19 +09:00
Matthias Viehweger
3cf107fde2 [rubygems/rubygems] Clarify description of owner-flags
https://github.com/rubygems/rubygems/commit/28864b1057
2022-04-29 17:19:18 +09:00
Yusuke Endoh
cf45d30fd7 Prevent a "warning: `*' interpreted as argument prefix" 2022-04-29 13:14:47 +09:00
Alan Wu
99281f513c YJIT: Handle spaces in build dir path using find(1) -exec
Previously, we relied on shell word splitting, which leads
to passing the wrong arguments when there are white spaces
in the path.

Avoiding command substitution also makes this script more
likely to work under Solaris 10, where `/bin/sh` is not
POSIX compliant [1]. (Thanks you, `@znz` for fixing the syntax
error in 4210ae2158b545beda908fb29e03d23994f262e3 though!)

The hack from c466f270b891962518763ad299f907beac0ebf62
doesn't actually work so this commit reverts it. The shell
still needs to parse through all of the code, maybe because
make doesn't in fact send newlines to the shell.

By the way, we also use the `-exec` option in the `ext/distclean` task.

[1]: https://docs.oracle.com/cd/E26505_01/html/816-5165/sh-1.html
2022-04-28 19:02:26 -04:00