Commit graph

77079 commits

Author SHA1 Message Date
Takashi Kokubun
33edcc1120
YJIT: Protect strings from GC on String#<< (#7466)
Fix https://github.com/Shopify/yjit/issues/310

[Bug #19483]

Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
Co-authored-by: Jimmy Miller <jimmy.miller@shopify.com>
2023-03-07 16:10:07 -05:00
Martin Emde
85a1738ab3 [rubygems/rubygems] Add TarReader::Entry#seek to seek within the tar file entry
TarReader#each previously implemented a partial version of seek.
This code moved to Entry#seek for use from TarReader#each.

Entry#close now returns nil instead of true, like IO#close.

Closing an Entry now seeks to the end of the Entry, seeking past
any remaining zero byte tar file padding and moving the io to the
correcty position to read the next file in the archive.

Uses seek for Entry#rewind and #pos=, fixing the tar->gzip->tar nested
rewind that would break previous to this change.

Add Entry.open that behaves more like File.open.

f5149565d5
2023-03-07 20:21:43 +00:00
Jimmy Miller
719a7726d1
YJIT: Handle special case of splat and rest lining up (#7422)
If you have a method that takes rest arguments and a splat call that
happens to line up perfectly with that rest, you can just dupe the
array rather than move anything around. We still have to dupe, because
people could have a custom to_a method or something like that which
means it is hard to guarantee we have exclusive access to that array.

Example:

```ruby
def foo(a, b, *rest)
end

foo(1, 2, *[3, 4])
```
2023-03-07 12:29:59 -05:00
Takashi Kokubun
a6de8b0d2d
YJIT: Bump SEND_MAX_DEPTH to 10 (#7452) 2023-03-07 10:21:22 -05:00
Peter Zhu
c78138abd3 Add function rb_data_free
This commit adds a function rb_data_free used by obj_free and
rb_objspace_call_finalizer to free T_DATA objects. This change also
means that RUBY_TYPED_FREE_IMMEDIATELY objects can be freed immediately
in rb_objspace_call_finalizer rather than being created into a zombie.
2023-03-07 08:28:03 -05:00
Samuel Giddins
638f68b2fe [rubygems/rubygems] Avoid calling String#dup in Gem::Version#marshal_dump
Might potentially save a second every time RubyGems.org creates a specs index

d6e4d50f8d
2023-03-07 11:48:41 +00:00
Josef Šimánek
dc33d32f12
Use proper memoized var name for Gem.state_home. 2023-03-07 16:52:28 +09:00
David Rodríguez
93f0749a64 [rubygems/rubygems] Fix gemspec file filter
Explicitly match directory separator to not match files in repo root
accidentally.

b936805ea9

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2023-03-07 16:51:36 +09:00
David Rodríguez
72591eb73f [rubygems/rubygems] Better suggestion when bundler/setup fails due to missing gems
If the original `BUNDLE_GEMFILE` is different from the default, then the
suggestion wouldn't work as is.

Before:

```
$ util/rubocop
Could not find rubocop-1.30.1 in locally installed gems
Run `bundle install` to install missing gems.

$  rubygems git:(better-cmd-suggestion) ✗ bundle install
Could not locate Gemfile
```

After:

```
$ util/rubocop
Could not find rubocop-1.30.1 in locally installed gems
Run `bundle install --gemfile /path/to/rubygems/bundler/tool/bundler/lint_gems.rb` to install missing gems.

$ bundle install --gemfile /path/to/rubygems/bundler/tool/bundler/lint_gems.rb
Fetching gem metadata from https://rubygems.org/.........
Using ast 2.4.2
Using bundler 2.4.7
Using parser 3.1.2.0
Using rainbow 3.1.1
Using parallel 1.22.1
Using regexp_parser 2.5.0
Using rubocop-ast 1.18.0
Using rexml 3.2.5
Using ruby-progressbar 1.11.0
Using unicode-display_width 2.1.0
Fetching rubocop 1.30.1
Installing rubocop 1.30.1
Using rubocop-performance 1.14.2
Bundle complete! 2 Gemfile dependencies, 12 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

$ util/rubocop
Inspecting 345 files
.........................................................................................................................................................................................................................................................................................................................................................

345 files inspected, no offenses detected
```

bf1320d805
2023-03-07 16:51:36 +09:00
David Rodríguez
5d790264ea [rubygems/rubygems] Remove hardcoded master branch references
Let RubyGems use the default branch defined by each repo.

54bd3e9ebd
2023-03-07 16:51:35 +09:00
David Rodríguez
bd0f2c7958 [rubygems/rubygems] Let git source use default cloned repo branch
d8af770379
2023-03-07 16:51:34 +09:00
Takashi Kokubun
589c2b1fb2 Regenerate RJIT bindgen 2023-03-06 23:44:01 -08:00
Takashi Kokubun
23ec248e48 s/mjit/rjit/ 2023-03-06 23:44:01 -08:00
Takashi Kokubun
2e875549a9 s/MJIT/RJIT/ 2023-03-06 23:44:01 -08:00
Takashi Kokubun
eaccdc1941 Rename MJIT filenames to RJIT 2023-03-06 23:44:01 -08:00
Takashi Kokubun
854546fcc4 MJIT is no longer slower on Rails 2023-03-06 23:24:05 -08:00
Samuel Williams
2c4b2053ca
Correctly clean up keeping_mutexes before resuming any other threads. (#7460)
It's possible (but very rare) to have a race condition between setting
`mutex->fiber = NULL` and `thread_mutex_remove(th, mutex)` which results
in the following bug:

```
[BUG] invalid keeping_mutexes: Attempt to unlock a mutex which is not locked
```

Fixes <https://bugs.ruby-lang.org/issues/19480>.
2023-03-07 20:23:00 +13:00
Takashi Kokubun
011c08b643 Remove obsoleted mjit_sp_inc.inc.erb 2023-03-06 23:05:50 -08:00
git
fd4a397e88 Update bundled gems list at 2023-03-07 2023-03-07 07:01:48 +00:00
Takashi Kokubun
b2130d5f5d Remove obsoleted tool/mjit_tabs.rb 2023-03-06 22:53:38 -08:00
Takashi Kokubun
072fc7671a Remove obsoleted tool/mjit_archflag.sh 2023-03-06 22:43:32 -08:00
Samuel Williams
7abe47b85a
Improve robustness of io_wait implementation. (#7456)
- Restore correct handling of `duration`.
- Don't delete from `@readable` or `@writable` unless it was added.
- A little more documentation.
2023-03-07 19:38:58 +13:00
Takashi Kokubun
66c4dc1592 Remove MJIT-specific benchmarks 2023-03-06 22:36:57 -08:00
Takashi Kokubun
2702d615f5 Remove obsoleted mjit_config.h 2023-03-06 22:31:43 -08:00
Takashi Kokubun
290e26c729 Remove obsoleted MJIT_HEADER macro 2023-03-06 22:29:35 -08:00
Takashi Kokubun
7fb36a0054 Remove obsoleted MJIT_STATIC macro 2023-03-06 22:29:35 -08:00
Takashi Kokubun
f68580890f Stop building mjit_build_dir.so 2023-03-06 22:14:44 -08:00
Takashi Kokubun
50a709fb9e Resurrect symbols used by ObjectSpace 2023-03-06 21:59:23 -08:00
Takashi Kokubun
233ddfac54 Stop exporting symbols for MJIT 2023-03-06 21:59:23 -08:00
Takashi Kokubun
31f4b2d86b
Drop obsoleted MJIT header (#7458)
RJIT doesn't need this.
2023-03-06 21:41:48 -08:00
Takashi Kokubun
09b4236f17 Add a Slack notification for MJIT CI 2023-03-06 21:19:19 -08:00
git
c077df9b28 Update default gems list at 56ebeba436 [ci skip] 2023-03-07 02:48:16 +00:00
Stan Lo
56ebeba436 [ruby/irb] Bump version to 1.6.3
(https://github.com/ruby/irb/pull/537)

110e4a3219
2023-03-07 02:47:15 +00:00
Hiroshi SHIBATA
030f39822a [ruby/net-http] Re-apply
d22ca54904 after
testing

7ac7401a9c
2023-03-07 01:35:20 +00:00
Takashi Kokubun
6df8a53055 Fix YJIT stats for RUBY_DEBUG builds 2023-03-06 13:37:01 -08:00
Takashi Kokubun
b116b2bcf6 Fix a compilation warning on Mac
../mjit_c.rb:493:17: warning: implicit conversion loses integer precision: 'ID' (aka 'unsigned long') to 'unsigned int' [-Wshorten-64-to-32]
return UINT2NUM(vm_ci_mid((CALL_INFO)NUM2PTR(_ci_addr)));
       ~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-03-06 13:20:54 -08:00
Peter Zhu
a1758fbd7f Crash when malloc during GC
This feature was introduced in commit 2ccf6e5, but I realized that
using rb_warn is a bad idea because it allocates objects, which causes
a different crash ("object allocation during garbage collection phase").
We should just hard crash here instead.
2023-03-06 09:09:03 -05:00
Nobuyoshi Nakada
755c379d87 [ruby/net-http] Exclude git related files
2767df580d
2023-03-06 13:26:36 +00:00
Nobuyoshi Nakada
c8c3431b0a [ruby/net-http] Read in binary mode to get rid of invalid byte sequence
38de3d17a7
2023-03-06 13:26:34 +00:00
Nobuyoshi Nakada
fd0a5659ca [ruby/net-http] Test building packages
Also revert commit d22ca54904 "Replaced
non-ascii charactor. It fails version detection at `net-http.gemspec`."

fbeb247d93
2023-03-06 13:26:34 +00:00
Jean Boussier
704dd25812 TestThreadInstrumentation: emit the EXIT event sooner
```
  1) Failure:
TestThreadInstrumentation#test_thread_instrumentation [/tmp/ruby/src/trunk-repeat20-asserts/test/-ext-/thread/test_instrumentation_api.rb:33]:
Call counters[4]: [3, 4, 4, 4, 0].
Expected 0 to be > 0.
```

We fire the EXIT hook after the call to `thread_sched_to_dead` which
mean another thread might be running before the `EXIT` hook have been
executed.
2023-03-06 13:10:42 +01:00
Takashi Kokubun
22d944c8b7 Avoid crashing at a random ISEQ access
[Feature #19420]
2023-03-05 23:28:59 -08:00
Takashi Kokubun
d6814fa24f Fix a BytePtr check of test 2023-03-05 23:28:59 -08:00
Takashi Kokubun
d51b4d4c3e Add Mod 10 to test r/m64, imm32 2023-03-05 23:28:59 -08:00
Takashi Kokubun
7573854c9f Add Mod 10 to cmp r/m64, imm8 2023-03-05 23:28:59 -08:00
Takashi Kokubun
a1ad5a2165 Omit test_version for Cirrus for now 2023-03-05 23:28:59 -08:00
Takashi Kokubun
d6fde0e6db Change default call threshold to 30 2023-03-05 23:28:59 -08:00
Takashi Kokubun
1c267d0723 Workaround USE_MJIT warnings 2023-03-05 23:28:59 -08:00
Takashi Kokubun
823309debc Remove unused variables 2023-03-05 23:28:59 -08:00
Takashi Kokubun
ef7f56c734 Resurrect CI for MJIT 2023-03-05 23:28:59 -08:00