Commit graph

77079 commits

Author SHA1 Message Date
Takashi Kokubun
3938b79ef9 Revert an unneeded diff in 262254dc7d 2023-03-09 09:15:21 -08:00
Koichi Sasada
262254dc7d rename defined_ivar to definedivar
because non-opt instructions should contain `_` char.
2023-03-10 00:37:11 +09:00
Takashi Kokubun
22d8e95ffe
YJIT: Optimize cmp REG, 0 into test REG, REG (#7471) 2023-03-09 10:19:59 -05:00
Hiroshi SHIBATA
3926ad578c [rubygems/rubygems] Drop to support Psych 3.0 bundled at Ruby 2.5
a6650c2c96
2023-03-09 13:37:06 +00:00
Samuel Williams
44a0711eab
Remove special handling of SIGCHLD. (#7482) 2023-03-09 21:48:50 +13:00
KJ Tsanaktsidis
7bd7aee02e Fix interpreter crash caused by RUBY_INTERNAL_EVENT_NEWOBJ + Ractors
When a Ractor is created whilst a tracepoint for
RUBY_INTERNAL_EVENT_NEWOBJ is active, the interpreter crashes. This is
because during the early setup of the Ractor, the stdio objects are
created, which allocates Ruby objects, which fires the tracepoint.
However, the tracepoint machinery tries to dereference the control frame
(ec->cfp->pc), which isn't set up yet and so crashes with a null pointer
dereference.

Fix this by not firing GC tracepoints if cfp isn't yet set up.
2023-03-09 09:46:14 +01:00
Takashi Kokubun
1a0d3ec4b9 RJIT: Make functions in rjit_c.c static
They don't need to be global.
2023-03-08 23:38:02 -08:00
Takashi Kokubun
4be224eaf5 RJIT: Reorganize rjit.c
Reordering functions for readability, adding stats whenever possible.
2023-03-08 23:31:06 -08:00
Takashi Kokubun
f5909ac6d9 RJIT: Stop allowing leaked globals rjit_* 2023-03-08 23:24:38 -08:00
Takashi Kokubun
a0918a4a80 RJIT: Get rid of verbose logging 2023-03-08 23:12:51 -08:00
Takashi Kokubun
7d7b67a472 RJIT: Clean up the declaration mess 2023-03-08 23:07:30 -08:00
Nobuyoshi Nakada
cf08a85b85 [rubygems/rubygems] Ensure that TempIO is closed
dc7b9db514
2023-03-09 06:19:56 +00:00
Nobuyoshi Nakada
96d1acfdf6
[Bug #19161] Check for TLS usability
On all platforms using GCC, even other than darwin.
2023-03-09 13:54:50 +09:00
lukeg
2ecdefab7d Make sure TestDefaultGems#test_validate_gemspec runs even when Dir.pwd != srcdir
For instance, when running tests in build directory like:

$ make test-all TESTOPTS="../ruby/test"
2023-03-09 13:18:07 +09:00
Samuel Williams
1658e7d966
Remove SIGCHLD waidpid. (#7476)
* Remove `waitpid_lock` and related code.

* Remove un-necessary test.

* Remove `rb_thread_sleep_interruptible` dead code.
2023-03-09 16:05:47 +13:00
Hiroshi SHIBATA
ea8b5e7359 [rubygems/rubygems] rubocop -a lib/rubygems/specification.rb
85d60e9886
2023-03-08 23:23:45 +00:00
Hiroshi SHIBATA
cb3f1f6de8 [rubygems/rubygems] Detect extension files under full_required_paths
When we use this methods with local gemspec, we don't handle
  build status of extension correctly. So We need to find extension
  files in require_paths.

  Example with ruby/erb repository:

  ```
  $ bundle exec irb
  Ignoring erb-4.0.2 because its extensions are not built. Try: gem pristine erb --version 4.0.2
  >>
  ```

f90e43cf3f
2023-03-08 23:23:45 +00:00
Takashi Kokubun
309dd50a01 Fix node search in bindgen
This is to fix a weird bindgen behavior on Matt's branch:
https://github.com/ruby/ruby/pull/7393
2023-03-08 13:13:23 -08:00
Takashi Kokubun
cc54e1cf48 Fix ruby_testoptions on RubyCI
20230308T185004Z.fail.html.gz
2023-03-08 12:00:14 -08:00
Burdette Lamar
2f19c5b7e0 [ruby/net-http] Enhanced RDoc for Net::HTTP
(https://github.com/ruby/net-http/pull/130)

698e18cfc1
2023-03-08 19:47:49 +00:00
Ole Friis Østergaard
4667a3a665 Add defined_ivar as YJIT instruction as well
This works much like the existing `defined` implementation,
but calls out to rb_ivar_defined instead of the more general
rb_vm_defined.

Other difference to the existing `defined` implementation is
that this new instruction has to take the same operands as
the CRuby `defined_ivar` instruction.
2023-03-08 09:34:31 -08:00
Ole Friis Østergaard
1a3f8e1c9f Add defined_ivar instruction
This is a variation of the `defined` instruction, for use when we
are checking for an instance variable. Splitting this out as a
separate instruction lets us skip some checks, and it also allows
us to use an instance variable cache, letting shape analysis
speed up the operation further.
2023-03-08 09:34:31 -08:00
Nobuyoshi Nakada
dc1e6573f2
Fix commit miss 2023-03-09 00:49:11 +09:00
Nobuyoshi Nakada
611a64250a
Disable color mode of test-syntax-suggest when on dumb terminal
The compliation-mode of Emacs sets TERM to "dumb" and does not support
coloring.
2023-03-08 22:57:06 +09:00
Peter Zhu
e1bd45624c Fix crash when allocating classes with newobj hook
We need to zero out the whole slot when running the newobj hook for a
newly allocated class because the slot could be filled with garbage,
which would cause a crash if a GC runs inside of the newobj hook.

For example, the following script crashes:

```
require "objspace"

GC.stress = true

ObjectSpace.trace_object_allocations {
  100.times do
    Class.new
  end
}
```

[Bug #19482]
2023-03-08 08:47:18 -05:00
Nobuyoshi Nakada
bead4bce3b Constify local static variables in yyparse 2023-03-08 20:07:46 +09:00
Hiroshi SHIBATA
1163204021 code style 2023-03-08 17:48:43 +09:00
Hiroshi SHIBATA
59905883c4 BundledGem.dummy_spec needs to checkout revision after cloning repository.
The current BundledGem.dummy_spec always called from master branch.
  It caused to CI faiulres like
  20230305T001003Z.fail.html.gz
2023-03-08 17:48:43 +09:00
Hiroshi SHIBATA
0c9733ea86 Added missing dependency for rubygems 2023-03-08 17:48:43 +09:00
Hiroshi SHIBATA
a7cee4da97 Added debug info to gemspec version check 2023-03-08 17:48:43 +09:00
Hiroshi SHIBATA
c25738762a Check bundled_gems version and gemspec version strictly 2023-03-08 17:48:43 +09:00
Takashi Kokubun
9ad19069f9 Remove obsoleted functions in rjit.c 2023-03-07 23:59:50 -08:00
Takashi Kokubun
4bf037bebd Update documentation about RJIT 2023-03-07 23:31:39 -08:00
Takashi Kokubun
e93e780f3d Remove MJIT's builtin function compiler 2023-03-07 23:16:24 -08:00
Takashi Kokubun
b67f07fa2c Get rid of MJIT's special fork 2023-03-07 23:08:57 -08:00
Takashi Kokubun
43de2365a5 Fix a typo 2023-03-07 23:06:01 -08:00
Takashi Kokubun
9df1f58e01 Link libcapstone no matter what cargo does
libcapstone used to break when it's linked from C and Rust at the same
time, but it doesn't seem to happen anymore. Maybe it's related to
recent symbol hygiene changes. Thank you if that's the case.

This commit allows you to make both --enable-rjit=dev and
--enable-yjit=dev work in the same binary.
2023-03-07 22:58:11 -08:00
Takashi Kokubun
6d91df08b5
Allow enabling YJIT and RJIT independently (#7474)
We used to require MJIT is supported when YJIT is supported. However,
now that RJIT dropped some platforms that YJIT supports, it no longer
makes sense. We should be able to enable only YJIT, and vice versa.
2023-03-07 22:43:37 -08:00
Takashi Kokubun
0bf4cd8e1c Actually stop supporting those options 2023-03-07 21:21:19 -08:00
Takashi Kokubun
1d39d2d334 Update options available in RJIT 2023-03-07 21:19:04 -08:00
Nobuyoshi Nakada
00d6772e40
Adjust styles [ci skip] 2023-03-08 14:02:46 +09:00
Nobuyoshi Nakada
677c3228d0 Check loading built-in binaries 2023-03-08 13:59:21 +09:00
Nobuyoshi Nakada
5889cbd7de Constify function tables 2023-03-08 13:59:21 +09:00
dependabot[bot]
39511b8b23 Bump ruby/action-slack from 3.0.0 to 3.1.0
Bumps [ruby/action-slack](https://github.com/ruby/action-slack) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/ruby/action-slack/releases)
- [Commits](b6882ea6ef...36bda26f63)

---
updated-dependencies:
- dependency-name: ruby/action-slack
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-08 12:35:29 +09:00
Sampat Badhe
ae2dbdf11e
[DOC] Fix broken link Data#deconstruct_keys 2023-03-08 12:26:26 +09:00
Takashi Kokubun
ec05ba7ca3 Give more time to MinGW to run make test
10 minutes were not enough.
7622532445
2023-03-07 17:51:38 -08:00
Takashi Kokubun
3e731cd945 YJIT: Add comments to peek and x86_merge 2023-03-07 14:59:37 -08:00
Takashi Kokubun
7f557d02c3 YJIT: Merge lea and mov on x86_64 when possible 2023-03-07 14:59:37 -08:00
Julie Haehn
c5296d9396 [rubygems/rubygems] Respect --no-install option for git: sources
Currently, the --no-install option to `bundle package` is totally
ignored for git sources. This can have very strange effects if you have:

- a git-sourced gem,
- with native extensions,
- whose extconf.rb script depends on another gem,
- which is installed from Rubygems in the gemfile.

In that circumstance, `bundle package --no-install --all` will download
the Rubygems dependencies to `vendor/cache` but NOT install them. It
will also check out the git gems to `vendor/cache` (good), and attempt
to build their native extensions (bad!).

The native extension build will fail because the extconf.rb script crashes,
since the dependency it needs is missing.

I implemented a fix for this in `source/git.rb`, since this is analogous
to what's happening in `source/rubygems.rb`. I do admit though the whole
thing is a little strange though - an "install" method that.... proceeds
to look at a global flag to not install anything.

Add test to confirm cache respects the --no-install flag

5a77d1c397

Co-authored-by: KJ Tsanaktsidis <kj@kjtsanaktsidis.id.au>
2023-03-07 22:36:36 +00:00
Jimmy Miller
56df6d5f9d
YJIT: Handle splat+rest for args pass greater than required (#7468)
For example:

```ruby
def my_func(x, y, *rest)
    p [x, y, rest]
end

my_func(1, 2, 3, *[4, 5])
```
2023-03-07 17:03:43 -05:00