77351 Commits

Author SHA1 Message Date
Takashi Kokubun
4e9c3b4518 RJIT: Eliminate known-result guards for blockarg 2023-04-04 23:42:14 -07:00
Takashi Kokubun
4f77d1cdb8 RJIT: Eliminate known-result branches 2023-04-04 23:30:26 -07:00
Hiroshi SHIBATA
9a5d4cc80b [rubygems/rubygems] Removed unused Gem::Deprecate from Gem::TestCase
https://github.com/rubygems/rubygems/commit/d8a75a5f84
2023-04-05 05:49:26 +00:00
Hiroshi SHIBATA
8e37eb1d15 [rubygems/rubygems] Extract class method used by self.method
https://github.com/rubygems/rubygems/commit/d900453ca2
2023-04-05 05:49:26 +00:00
Hiroshi SHIBATA
7f9a5a7562 [rubygems/rubygems] We don't use process_based_port and self.process_based_port
https://github.com/rubygems/rubygems/commit/f1a20c4c69
2023-04-05 05:49:26 +00:00
Hiroshi SHIBATA
6d0caac425 [rubygems/rubygems] We don't use self.make_command
https://github.com/rubygems/rubygems/commit/241f376c32
2023-04-05 05:49:25 +00:00
Hiroshi SHIBATA
a464951fc7 [rubygems/rubygems] Unify win_platform? to Gem.win_platform?
https://github.com/rubygems/rubygems/commit/b18a4ef076
2023-04-05 05:49:25 +00:00
Hiroshi SHIBATA
cbeea5f3e6 [rubygems/rubygems] Unify java_platform? to Gem.java_platform?
https://github.com/rubygems/rubygems/commit/7f27ab32b8
2023-04-05 05:49:24 +00:00
Hiroshi SHIBATA
bf8afe434f [rubygems/rubygems] Removed self.mingw_windows?, It's not used rubygems
https://github.com/rubygems/rubygems/commit/ba3c985701
2023-04-05 05:49:24 +00:00
lukeg
28d6c6d69b [rubygems/rubygems] add some test suites under the Gem namespace, so as not to collide
To avoid collisions especially in ruby/ruby

https://github.com/rubygems/rubygems/commit/e6b2359975
2023-04-05 14:38:20 +09:00
Takashi Kokubun
e06bebff5e RJIT: Propagate argument types on method calls 2023-04-04 22:13:25 -07:00
Takashi Kokubun
6d8875b5d7 RJIT: Fix mapping offsets in stack_swap 2023-04-04 22:05:45 -07:00
dependabot[bot]
f79912ea78 Bump ruby/setup-ruby from 1.144.2 to 1.146.0
Bumps [ruby/setup-ruby](https://github.com/ruby/setup-ruby) from 1.144.2 to 1.146.0.
- [Release notes](https://github.com/ruby/setup-ruby/releases)
- [Commits](ec02537da5...55283cc231)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-05 12:43:28 +09:00
Étienne Barrié
52ff2ce9da
Use em_delete in key_delete (#504)
* Test existing behavior

Typing Ctrl-D ends editing but typing <Del> does not.

Also renamed a test that is not testing ed_delete_next_char but
key_delete.

* Check if line empty first in em_delete

By distributivity of AND over OR, we can factor out this condition. This
will make the next commit simpler.

* Use em_delete in key_delete

When the editing mode is emacs, use `em_delete` in `key_delete`. We need
to add a condition though to `em_delete`, because it implements both
`delete-char` and `end-of-file`. We only want the `end-of-file` behavior
is the key is really Ctrl-D.

This matches the behavior of the <Del> key with readline, i.e. deleting
the next character if there is one, but not moving the cursor, while not
finishing the editing if there are no characters.
2023-04-05 08:59:12 +09:00
Jeremy Evans
bb927acd3b [ruby/optparse] Document requires needed for Date/DateTime/Time/URI/Shellwords support
Fixes [Bug #19566]

https://github.com/ruby/optparse/commit/fb91d97c10
2023-04-04 23:43:58 +00:00
Peter Zhu
1da2e7fca3
[Feature #19579] Remove !USE_RVARGC code (#7655)
Remove !USE_RVARGC code

[Feature #19579]

The Variable Width Allocation feature was turned on by default in Ruby
3.2. Since then, we haven't received bug reports or backports to the
non-Variable Width Allocation code paths, so we assume that nobody is
using it. We also don't plan on maintaining the non-Variable Width
Allocation code, so we are going to remove it.
2023-04-04 17:30:06 -04:00
Takashi Kokubun
1190ec60cc Use a longer timeout for syntax_suggest
for CI stability
2023-04-04 14:02:04 -07:00
Maxime Chevalier-Boisvert
d26d3575ca
YJIT: add stats for ratio of versions per block (#7653) 2023-04-04 16:41:52 -04:00
Aaron Patterson
8525603c72
Revert "Fix transient heap mode"
This reverts commit 87253d047ce35e7836b6f97edbb4f819879a3b25.

Revert "Implement `Process.warmup`"

This reverts commit ba6ccd871442f55080bffd53e33678c0726787d2.
2023-04-04 12:59:14 -07:00
Takashi Kokubun
e5de0fe108 Remove an unused counter
I ended up not using it.
2023-04-04 11:09:09 -07:00
Takashi Kokubun
116c0f92ef Resurrect yjit-smoke-test before #7651 2023-04-04 11:07:57 -07:00
Takashi Kokubun
b7717fc390
YJIT: Stack temp register allocation (#7651)
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
2023-04-04 10:58:11 -07:00
Aaron Patterson
87253d047c Fix transient heap mode
Make sure the transient heap is in the right mode when we finish warming
the heap.  Also ensure the GC isn't allowed to run while we iterate and
mutate the heap.
2023-04-04 19:49:08 +02:00
Jean Boussier
ba6ccd8714 Implement Process.warmup
[Feature #18885]

For now, the optimizations performed are:

  - Run a major GC
  - Compact the heap
  - Promote all surviving objects to oldgen

Other optimizations may follow.
2023-04-04 19:49:08 +02:00
Peter Zhu
a84c99468f Fix crash in Time on 32-bit systems
[Bug #19575]

struct vtm is packed causing it to have a size that is not aligned on
32-bit systems. When allocating it on the stack, it will have unaligned
addresses which means that the fields won't be marked by the GC when
scanning the stack (since the GC only marks aligned addresses). This can
cause crashes when the fields are heap allocated objects like Bignums.

This commit moves the flags in struct time_object into struct vtm for
space efficiency and removes the need for packing.

This is an example of a crash:

    ruby(rb_print_backtrace+0xd) [0x56848945] ../src/vm_dump.c:785
    ruby(rb_vm_bugreport) ../src/vm_dump.c:1101
    ruby(rb_assert_failure+0x7a) [0x56671857] ../src/error.c:878
    ruby(vm_search_cc+0x0) [0x56666e47] ../src/vm_method.c:1366
    ruby(rb_vm_search_method_slowpath) ../src/vm_insnhelper.c:2090
    ruby(callable_method_entry+0x5) [0x568232d3] ../src/vm_method.c:1406
    ruby(rb_callable_method_entry) ../src/vm_method.c:1413
    ruby(gccct_method_search_slowpath) ../src/vm_eval.c:427
    ruby(gccct_method_search+0x20f) [0x568237ef] ../src/vm_eval.c:476
    ruby(opt_equality_by_mid_slowpath+0x2c) [0x5682388c] ../src/vm_insnhelper.c:2338
    ruby(rb_equal+0x37) [0x566fe577] ../src/object.c:133
    ruby(rb_big_eq+0x34) [0x56876ee4] ../src/bignum.c:5554
    ruby(rb_int_equal+0x14) [0x566f3ed4] ../src/numeric.c:4640
    ruby(rb_int_equal) ../src/numeric.c:4634
    ruby(vm_call0_cfunc_with_frame+0x6d) [0x568303c2] ../src/vm_eval.c:148
    ruby(vm_call0_cfunc) ../src/vm_eval.c:162
    ruby(vm_call0_body) ../src/vm_eval.c:208
    ruby(rb_funcallv_scope+0xd1) [0x56833971] ../src/vm_eval.c:85
    ruby(RB_TEST+0x0) [0x567e8488] ../src/time.c:78
    ruby(eq) ../src/time.c:78
    ruby(small_vtm_sub) ../src/time.c:1523
    ruby(timelocalw+0x23b) [0x567f3e9b] ../src/time.c:1593
    ruby(time_s_alloc+0x0) [0x567f536b] ../src/time.c:3698
    ruby(time_new_timew) ../src/time.c:2694
    ruby(time_s_mktime) ../src/time.c:3698
2023-04-04 11:12:07 -04:00
Hiroshi SHIBATA
06da0d1456 [rubygems/rubygems] util/rubocop -A
https://github.com/rubygems/rubygems/commit/8c9ea5d180
2023-04-04 12:20:43 +00:00
Hiroshi SHIBATA
a881b33818 [rubygems/rubygems] util/rubocop -A --only Performance/RegexpMatch
https://github.com/rubygems/rubygems/commit/52ae4452c2
2023-04-04 12:20:43 +00:00
Hiroshi SHIBATA
a78e0ca968 [rubygems/rubygems] Don't copy and paste methods in helper methods
https://github.com/rubygems/rubygems/commit/b87ac64343
2023-04-04 12:13:13 +00:00
Takashi Kokubun
51b2f4c0f5 RJIT: Fix the argument of shift_stack 2023-04-04 01:17:23 -07:00
Takashi Kokubun
98f0e2c330 RJIT: Fix the argument for defined 2023-04-04 00:41:58 -07:00
Takashi Kokubun
19506650ef RJIT: Add --rjit-verify-ctx option 2023-04-04 00:35:29 -07:00
Takashi Kokubun
2c560b976e RJIT: Fix arguments to SPECIAL_CONST_P 2023-04-04 00:30:57 -07:00
Koichi Sasada
f3acaf312c rb_th_serial(th) allows th == NULL 2023-04-04 15:42:37 +09:00
Hiroshi SHIBATA
822f01b36c [rubygems/rubygems] Disabled to test rustc with msys2 platform.
https://github.com/rubygems/rubygems/actions/runs/4598776839/jobs/8123290246

https://github.com/rubygems/rubygems/commit/5c3b0a112e
2023-04-04 06:08:04 +00:00
Takashi Kokubun
6a4087702b RJIT: Update type information on setlocal 2023-04-03 22:42:21 -07:00
Takashi Kokubun
6ab86e4626 RJIT: Fix arguments for shift_stack 2023-04-03 21:26:40 -07:00
Nobuyoshi Nakada
1d529f382c
PID cache is never cleared where fork is not used 2023-04-04 11:29:57 +09:00
Nobuyoshi Nakada
05b7bbecc6
Suppress -Wdiscarded-qualifiers warning where fchdir is unusable 2023-04-04 11:27:43 +09:00
Koichi Sasada
b2e848193a fix deadlock on Thread#join
because of 9720f5ac894566ade2aabcf9adea0a3235de1353

http://rubyci.s3.amazonaws.com/solaris11-sunc/ruby-master/log/20230403T130011Z.fail.html.gz

```
  1) Failure:
TestThread#test_signal_at_join [/export/home/chkbuild/chkbuild-sunc/tmp/build/20230403T130011Z/ruby/test/ruby/test_thread.rb:1488]:
Exception raised:
<#<fatal:"No live threads left. Deadlock?\n1 threads, 1 sleeps current:0x00891288 main thread:0x00891288\n* #<Thread:0xfef89a18 sleep_forever>\n   rb_thread_t:0x00891288 native:0x00000001 int:0\n   \n">>
Backtrace:
  -:30:in `join'
  -:30:in `block (3 levels) in <main>'
  -:21:in `times'
  -:21:in `block (2 levels) in <main>'.
```

The mechanism:

* Main thread (M) calls `Thread#join`
* M: calls `sleep_forever()`
* M: set `th->status = THREAD_STOPPED_FOREVER`
* M: do `checkints`
* M: handle a trap handler with `th->status = THREAD_RUNNABLE`
* M: thread switch at the end of the trap handler
* Another thread (T) will process `Thread#kill` by M.
* T: `rb_threadptr_join_list_wakeup()` at the end of T tris to wakeup M,
     but M's state is runnable because M is handling trap handler and
     just ignore the waking up and terminate T$a
* T: switch to M.
* M: after the trap handler, reset `th->status = THREAD_STOPPED_FOREVER`
     and check deadlock -> Deadlock because only M is living.

To avoid such situation, add new sleep flags `SLEEP_ALLOW_SPURIOUS`
and `SLEEP_NO_CHECKINTS` to skip any check ints.

BTW this is instentional to leave second `vm_check_ints_blocking()`
without checking `SLEEP_NO_CHECKINTS` because `SLEEP_ALLOW_SPURIOUS`
should be specified with `SLEEP_NO_CHECKINTS` and skipping this
checkints can skip any interrupts.
2023-04-04 07:57:51 +09:00
Takashi Kokubun
38209ffdca
YJIT: Add codegen for Array#<< (#7645) 2023-04-03 14:10:35 -07:00
Takashi Kokubun
ba4ff2552e Avoid failing test_enable on warnings
This fails on RubyCI due to RJIT warnings too often. It should be enough
to test RJIT feature in test_rjit_version. We only want warnings instead
of test failures when there are warnings, at least for this case.
2023-04-03 08:59:05 -07:00
Takashi Kokubun
3cb5e7558d Fix a test_rubyoptions failure 2023-04-03 08:44:16 -07:00
Takashi Kokubun
46e93ef53d RJIT: Propagate self's type information 2023-04-03 00:49:10 -07:00
Takashi Kokubun
ca8102355a RJIT: Upgrade type on jit_guard_known_class 2023-04-03 00:39:29 -07:00
Takashi Kokubun
1d452c2cf8 RJIT: Upgrade type to Fixnum after guard 2023-04-03 00:02:45 -07:00
Takashi Kokubun
0abe9d8b32 RJIT: Upgrade type to String after guard 2023-04-02 23:54:08 -07:00
Takashi Kokubun
f0b69eb14f RJIT: Upgrade type to Array after guard 2023-04-02 23:49:55 -07:00
Takashi Kokubun
d876c008ec RJIT: Limit the number of versions per block 2023-04-02 23:37:15 -07:00
Takashi Kokubun
3bacc3877a RJIT: Find a best matching block version 2023-04-02 23:24:14 -07:00
Takashi Kokubun
eb51248c4c RJIT: Upgrade type to UnknownHeap after guard 2023-04-02 23:11:18 -07:00