Commit graph

77079 commits

Author SHA1 Message Date
Nobuyoshi Nakada
1aa2555044
Fix the macro for condition 2023-03-20 17:28:24 +09:00
Jean Boussier
1db8951d3a Cache Process.pid
[Feature #19443]

It's not uncommon for database client and similar network libraries
to protect themselves from Process.fork by regularly checking Process.pid

Until recently most libc would cache `getpid()` so this was a cheap
check to make.

However as of glibc version 2.25 the PID cache is removed and calls to
`getpid()` always invoke the actual system call which significantly degrades
the performance of existing applications.

The reason glibc removed the cache is that some libraries were bypassing
`fork(2)` by issuing system calls themselves, causing stale cache issues.

That isn't a concern for Ruby as bypassing MRI's primitive for forking
would render the VM unusable, so we can safely cache the PID.
2023-03-20 08:21:23 +00:00
Takashi Kokubun
70ea58bd5b RJIT: Break up RJIT send_iseq_complex exit reasons 2023-03-19 23:58:14 -07:00
Takashi Kokubun
59b86da82c RJIT: Implement ifunc invokeblock 2023-03-19 23:32:07 -07:00
Takashi Kokubun
47f7ec1c9f RJIT: Support invokeblock arity mismatches 2023-03-19 23:14:13 -07:00
Takashi Kokubun
e3dc25acae RJIT: Fix ISeq invokeblock 2023-03-19 21:52:25 -07:00
Takashi Kokubun
7aeb9e20b9 RJIT: Disable ISeq invokeblock for now
since basictest is broken
2023-03-19 21:20:28 -07:00
Takashi Kokubun
7f696b8859 Remove a warning in bootstraptest/runner.rb
../bootstraptest/runner.rb:121: warning: assigned but unused variable - e
2023-03-19 21:02:21 -07:00
Takashi Kokubun
2d8ecfcc9a RJIT: Implement invokeblock with ISeq 2023-03-19 20:56:37 -07:00
Nobuyoshi Nakada
80890e681a
Disable -w on bundler and bundled gems tests 2023-03-20 12:49:58 +09:00
Takashi Kokubun
4f350dbfdd RJIT: Remove an unneeded variable 2023-03-19 20:27:57 -07:00
Nobuyoshi Nakada
c6466691be
Enable -w option at test 2023-03-20 11:36:46 +09:00
Soutaro Matsumoto
615f42fd61
Add explanation to rbs_skip_tests (#7525) 2023-03-20 10:39:17 +09:00
Takashi Kokubun
2f29044de4 RJIT: Optimize Kernel#block_given? 2023-03-19 14:15:45 -07:00
Takashi Kokubun
83ad1cac81 RJIT: Optimize Kernel#respond_to? 2023-03-19 14:04:58 -07:00
Takashi Kokubun
95c4ced39e RJIT: Optimize Array#empty? 2023-03-19 13:41:04 -07:00
Takashi Kokubun
cd5a8d0160 RJIT: Optimize String#+@ 2023-03-19 13:36:26 -07:00
Takashi Kokubun
2121282753 RJIT: Optimize String#<< 2023-03-19 13:25:41 -07:00
Nobuyoshi Nakada
bcd0aa896f
Fix -Wclobbered warning from gcc 12
A variable modified in `EXEC_TAG` block should be `volatile`.

```
ractor.c: In function 'ractor_try_yield':
ractor.c:1251:97: warning: argument 'obj' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
 1251 | ractor_try_yield(rb_execution_context_t *ec, rb_ractor_t *cr, struct rb_ractor_queue *ts, VALUE obj, VALUE move, bool exc, bool is_will)
      |                                                                                           ~~~~~~^~~
```
2023-03-19 21:57:22 +09:00
Nobuyoshi Nakada
e7342e76df
[Bug #19485] [DOC] Mention tabs in indentation of heredoc identifier
Co-Authored-By: sawa (Tsuyoshi Sawada) <sawadatsuyoshi@gmail.com>
2023-03-19 18:10:55 +09:00
Takashi Kokubun
9654a28cc5 RJIT: Drop duplicated obj_is_kind_of 2023-03-19 00:06:03 -07:00
Takashi Kokubun
c4e2718763 RJIT: Workaround USE_RVARGC=0 CI 2023-03-18 23:42:58 -07:00
Takashi Kokubun
32e0c97dfa RJIT: Optimize String#bytesize 2023-03-18 23:35:42 -07:00
Takashi Kokubun
106cca5111 RJIT: Optimize String#empty? 2023-03-18 23:24:57 -07:00
Takashi Kokubun
ca9355e173 RJIT: Optimize Kernel#instance_of? 2023-03-18 23:13:25 -07:00
Takashi Kokubun
824cf88969 RJIT: Optimize Kernel#is_a? 2023-03-18 22:59:46 -07:00
Takashi Kokubun
cc9330f8c0 RJIT: Reorder opt_case_dispatch branches 2023-03-18 22:32:27 -07:00
Takashi Kokubun
d07d1c7162 RJIT: Upgrade Ubuntu on CI
to upgrade libcapstone on CI
2023-03-18 22:03:45 -07:00
Takashi Kokubun
71bcab4519 RJIT: Implement setclassvariable 2023-03-18 21:49:46 -07:00
Takashi Kokubun
8510f33cc1 RJIT: Implement intern 2023-03-18 21:42:20 -07:00
Takashi Kokubun
4a8de3fa88 RJIT: Fix toregexp 2023-03-18 21:39:24 -07:00
Takashi Kokubun
9c2792c3d3 RJIT: Implement toregexp 2023-03-18 21:37:49 -07:00
Takashi Kokubun
d189f8d870 RJIT: Prefix rjit_options with rb_ 2023-03-18 21:28:55 -07:00
Takashi Kokubun
4e440d6990 RJIT: Install libcapstone-dev on CI
for test_assembler.rb to work
2023-03-18 21:26:09 -07:00
Takashi Kokubun
2eefd71e0f RJIT: Implement newrange 2023-03-18 21:24:31 -07:00
Takashi Kokubun
81e19b7d99 RJIT: Implement getglobal 2023-03-18 21:20:58 -07:00
Takashi Kokubun
9f8e914943 RJIT: Implement checkkeyword 2023-03-18 21:15:22 -07:00
Nobuyoshi Nakada
67dd52d59c
[Bug #19539] Match heredoc identifier from end of line
Not to ignore leading spaces in indented heredoc identifier.
2023-03-19 01:35:21 +09:00
tomoya ishida
e8e7ff1333 [ruby/reline] Fix: line longer than terminal width breaks rendering
(https://github.com/ruby/reline/pull/516)

ae5f9b87ab
2023-03-18 14:37:10 +00:00
Peter Zhu
cb22d78354 Fix frozen status loss when moving objects
[Bug #19536]

When objects are moved between size pools, their frozen status is lost
in the shape. This will cause the frozen check to be bypassed when there
is an inline cache. For example, the following script should raise a
FrozenError, but doesn't on Ruby 3.2 and master.

    class A
      def add_ivars
        @a = @b = @c = @d = 1
      end

      def set_a
        @a = 10
      end
    end

    a = A.new
    a.add_ivars
    a.freeze

    b = A.new
    b.add_ivars
    b.set_a # Set the inline cache in set_a

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

    a.set_a
2023-03-18 09:07:05 -04:00
Takashi Kokubun
dc28ccbb6d RJIT: Implement getspecial insn 2023-03-18 00:00:18 -07:00
Takashi Kokubun
93e05aaa74 RJIT: Implement putspecialobject insn 2023-03-17 23:46:56 -07:00
Josef Haider
2c8f2871a8
Fix handling of 6-byte codepoints in left_adjust_char_head in CESU-8 encoding 2023-03-18 15:43:54 +09:00
Takashi Kokubun
45a17013aa RJIT: Implement throw insn 2023-03-17 23:27:16 -07:00
Takashi Kokubun
39cd74d2a0 RJIT: Use RJIT_STATS on --enable-rjit=dev
RUBY_DEBUG is too slow.
2023-03-17 23:17:26 -07:00
Takashi Kokubun
644c998525 RJIT: Support --rjit-stats on release build as well 2023-03-17 22:31:41 -07:00
Alan Wu
b9f411b3a8 YJIT: Simplify using the BITS associated constant
All the integer types have it.
2023-03-17 17:32:06 -04:00
Maxime Chevalier-Boisvert
6ba07df490
YJIT: make type info more specific in gen_fixnum_cmp and gen_opt_mod (#7555) 2023-03-17 16:16:34 -04:00
Alan Wu
7fc796f92a
YJIT: Delete --yjit-global-constant-state (#7559)
It was useful for evaluating 6068da8937
but I think we should remove it now to make the logic around
invalidation more straight forward.
2023-03-17 16:16:17 -04:00
Alan Wu
2a26a5e677 YJIT: Add and use Branch::assert_layout()
This assert would've caught a bug I wrote while developing
ruby/ruby#7443 so I figured it would be good to commit it
as it could be helpful in the future.
2023-03-17 16:15:58 -04:00