Граф коммитов

1798 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada 34f484d233
fake.rb should depend on revision.h [ci skip] 2023-04-15 12:44:08 +09:00
Alan Wu 847813ab13
[DOC] common.mk deals with various `make` varieties 2023-04-13 11:02:09 -04:00
Jean Boussier ac123f167a Emit a performance warning when a class reached max variations
[Feature #19538]

This new `peformance` warning category is disabled by default.
It needs to be specifically enabled via `-W:performance` or `Warning[:performance] = true`
2023-04-13 16:36:17 +02:00
Aaron Patterson a9bfb64153 Expose rb_sym_to_proc via RJIT
This is needed for getblockparamproxy
2023-04-07 09:49:15 -07:00
Matt Valentine-House 2a34bcaa10 Update VPATH for socket, & dependencies
The socket extensions rubysocket.h pulls in the "private" include/gc.h,
which now depends on vm_core.h. vm_core.h pulls in id.h

when tool/update-deps generates the dependencies for the makefiles, it
generates the line for id.h to be based on VPATH, which is configured in
the extconf.rb for each of the extensions. By default VPATH does not
include the actual source directory of the current Ruby so the
dependency fails to resolve and linking fails.

We need to append the topdir and top_srcdir to VPATH to have the
dependancy picked up correctly (and I believe we need both of these to
cope with in-tree and out-of-tree builds).

I copied this from the approach taken in
https://github.com/ruby/ruby/blob/master/ext/objspace/extconf.rb#L3
2023-04-06 11:07:16 +01:00
Takashi Kokubun 1587494b0b
YJIT: Add codegen for Integer methods (#7665)
* YJIT: Add codegen for Integer methods

* YJIT: Update dependencies

* YJIT: Fix Integer#[] for argc=2
2023-04-05 13:19:31 -07:00
Aaron Patterson 8525603c72
Revert "Fix transient heap mode"
This reverts commit 87253d047c.

Revert "Implement `Process.warmup`"

This reverts commit ba6ccd8714.
2023-04-04 12:59:14 -07: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
Matt Valentine-House 5897a6f686 Update Makefile dependencies 2023-03-17 19:20:40 +00:00
Matt Valentine-House 4ae9c34a4e Move RB_VM_SAVE_MACHINE_CONTEXT to internal/thread.h 2023-03-15 21:26:26 +00:00
Takashi Kokubun e10218862a Add btest-bruby target
btest can't be used for testing RJIT because RJIT doesn't work on
miniruby. However, btest-ruby is not necessarily useful for testing RJIT
because both the runner could crash as well as the target.

TBH I'm not sure why we want to use RUNRUBY instead of BOOTSTRAPRUBY on
btest-ruby. However, to achieve what I want to do while keeping the
current behavior, I'm just introducing a new target.
2023-03-12 23:56:21 -07:00
Takashi Kokubun e28f83703a RJIT: Update dependencies 2023-03-12 20:49:44 -07:00
Peter Zhu f98a7fd28d Move WeakMap and WeakKeyMap code to weakmap.c
These classes don't belong in gc.c as they're not actually part of the
GC. This commit refactors the code by moving all the code into a
weakmap.c file.
2023-03-10 09:32:10 -05: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 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 011c08b643 Remove obsoleted mjit_sp_inc.inc.erb 2023-03-06 23:05:50 -08:00
Takashi Kokubun 2702d615f5 Remove obsoleted mjit_config.h 2023-03-06 22:31:43 -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 a085df268d Update dependencies 2023-03-05 23:28:59 -08:00
Koichi Sasada a4421bd73c Rewrite Ractor synchronization mechanism
This patch rewrites Ractor synchronization mechanism, send/receive
and take/yield.

* API
  * Ractor::Selector is introduced for lightweight waiting
    for many ractors.
* Data structure
  * remove `struct rb_ractor_waiting_list` and use
    `struct rb_ractor_queue takers_queue` to manage takers.
  * remove `rb_ractor_t::yield_atexit` and use
    `rb_ractor_t::sync::will_basket::type` to check the will.
  * add `rb_ractor_basket::p.take` to represent a taking ractor.
* Synchronization protocol
  * For the Ractor local GC, `take` can not make a copy object
    directly so ask to generate the copy from the yielding ractor.
  * The following steps shows what `r1.take` does on `r0`.
    * step1: (r0) register `r0` into `r1`'s takers.
    * step2: (r0) check `r1`'s status and wakeup r0 if `r1` is waiting
             for yielding a value.
    * step3: (r0) sleep until `r1` wakes up `r0`.
  * The following steps shows what `Ractor.yield(v)` on `r1`.
    * step1: (r1) check first takers of `r1` and if there is (`r0`),
             make a copy object of `v` and pass it to `r0` and
             wakes up `r0`.
    * step2: (r1) if there is no taker ractors, sleep until
             another ractor try to take.
2023-03-02 14:31:54 +09:00
Matt Valentine-House 5e4b80177e Update the depend files 2023-02-28 09:09:00 -08:00
Matt Valentine-House f38c6552f9 Remove intern/gc.h from Make deps 2023-02-27 10:11:56 -08:00
Peter Zhu 3e09822407 Fix incorrect line numbers in GC hook
If the previous instruction is not a leaf instruction, then the PC was
incremented before the instruction was ran (meaning the currently
executing instruction is actually the previous instruction), so we
should not increment the PC otherwise we will calculate the source
line for the next instruction.

This bug can be reproduced in the following script:

```
require "objspace"

ObjectSpace.trace_object_allocations_start
a =

  1.0 / 0.0
p [ObjectSpace.allocation_sourceline(a), ObjectSpace.allocation_sourcefile(a)]
```

Which outputs: [4, "test.rb"]

This is incorrect because the object was allocated on line 10 and not
line 4. The behaviour is correct when we use a leaf instruction (e.g.
if we replaced `1.0 / 0.0` with `"hello"`), then the output is:
[10, "test.rb"].

[Bug #19456]
2023-02-24 14:10:09 -05:00
Kaíque Kandy Koga aff41a3669 Add information about runirb in make help 2023-02-24 19:44:36 +09:00
Nobuyoshi Nakada d025ff29c4
Clone bundled gem sources only if GIT is available 2023-02-22 10:23:06 +09:00
Nobuyoshi Nakada 289080e4d8 Clone and create dummy gemspec in sequential build 2023-02-22 02:07:59 +09:00
Jean Boussier 7413079dae Encapsulate RCLASS_ATTACHED_OBJECT
Right now the attached object is stored as an instance variable
and all the call sites that either get or set it have to know how it's
stored.

It's preferable to hide this implementation detail behind accessors
so that it is easier to change how it's stored.
2023-02-15 15:24:22 +01:00
Nobuyoshi Nakada 38ecf08ba1
[DOC] Fix the help messages for clean 2023-02-10 14:46:52 +09:00
Matt Valentine-House 72aba64fff Merge gc.h and internal/gc.h
[Feature #19425]
2023-02-09 10:32:29 -05:00
Nobuyoshi Nakada 899ea35035
Extract include/ruby/internal/attr/packed_struct.h
Split `PACKED_STRUCT` and `PACKED_STRUCT_UNALIGNED` macros into the
macros bellow:
* `RBIMPL_ATTR_PACKED_STRUCT_BEGIN`
* `RBIMPL_ATTR_PACKED_STRUCT_END`
* `RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_BEGIN`
* `RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_END`
2023-02-08 12:34:13 +09:00
Takashi Kokubun 5694515460
Document BUNDLED_GEMS in make test 2023-01-31 15:02:44 -08:00
Alan Wu 7d4395cb69 YJIT: Fix shared/static library symbol leaks
Rust 1.58.0 unfortunately doesn't provide facilities to control symbol
visibility/presence, but we care about controlling the list of
symbols exported from libruby-static.a and libruby.so.

This commit uses `ld -r` to make a single object out of rustc's
staticlib output, libyjit.a. This moves libyjit.a out of MAINLIBS and adds
libyjit.o into COMMONOBJS, which obviates the code for merging libyjit.a
into libruby-static.a. The odd appearance of libyjit.a in SOLIBS is also
gone.

To filter out symbols we do not want to export on ELF platforms, we use
objcopy after the partial link. On darwin, we supply a symbol list to
the linker which takes care of hiding unprefixed symbols.

[Bug #19255]

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2023-01-27 12:28:09 -05:00
Hiroshi SHIBATA 6608d47bed Enable code-coverage result for test-syntax-suggest 2023-01-26 13:52:20 +09:00
Nobuyoshi Nakada 17f5631c6e [Bug #19340] Fix bundle gems with test revision
Build temporary gem package from cloned repository if test revision is
set.
2023-01-26 12:50:39 +09:00
Hiroshi SHIBATA 5e1e5af2e7
Support simplecov-0.22.0.
simplecov-0.22.0 no longer support pre-0.18 result format. result data needs
  `lines` key for coverage data.
2023-01-25 16:47:05 +09:00
Hiroshi SHIBATA 4981206b49
update-coverage needs to build ruby and all C-ext libraries 2023-01-23 15:14:02 +09:00
Nobuyoshi Nakada 569fbf229b
Run `after-update` in the same main make process [ci skip] 2023-01-20 00:21:53 +09:00
Hiroshi SHIBATA d275adde78 Pin simplecov-0.20.0 2023-01-18 20:19:08 +09:00
Hiroshi SHIBATA 18d8333c30 Switch to use gem version of simplecov, not git clone 2023-01-18 20:19:08 +09:00
Takashi Kokubun 5fc97f34c6 benchmark_driver v0.16.3
Some chruby-related features and bug fixes.
2023-01-17 22:26:45 -08:00
Hiroshi SHIBATA 01e28afd0a
test-syntax-suggest is now part of make check 2023-01-17 16:56:57 +09:00
Hiroshi SHIBATA aad1563c1a
Added make exam to help message 2023-01-17 16:50:19 +09:00
Hiroshi SHIBATA da7818e682
Added test-syntax-suggest to help message 2023-01-17 16:48:44 +09:00
Hiroshi SHIBATA ff3c1d9e13
SimpleCov is hosted under simplecov-ruby org now 2023-01-17 14:31:36 +09:00
Alan Wu 14fe7a081a YJIT: Use ThinLTO for Rust parts in release mode
This reduces the code size of libyjit.a by a lot. On darwin it went from
23 MiB to 12 MiB for me. I chose ThinLTO over fat LTO for the relatively
fast build time; in case we need to debug release-build-only problems
it won't be painful.
2023-01-16 17:32:15 -05:00
Nobuyoshi Nakada 088132fb33 Do not depend on `REVISION_H`
Disable for now, since this seems causing infinite rebuilding.
2023-01-15 17:21:59 +09:00
Nobuyoshi Nakada 1ddeb7473d
Move the dependency of makefiles on revision header [ci skip]
Since `REVISION_H` is defined in common.mk which is appended or
included after Makefile.in, it was undefined yet at the point of the
dependency.
2023-01-14 20:30:19 +09:00
Hiroshi SHIBATA fe11bee507
Suppressing installation messages with test-bundler
Ignoring the following messages:

    ```
    (snip)
            -e 'load "spec/bundler/support/bundle.rb"' -- install --gemfile=tool/bundler/dev_gems.rb
    Using rake 13.0.6
    Using bundler 2.5.0.dev
    Using diff-lcs 1.5.0
    Using parallel 1.22.1
    Using parallel_tests 2.32.0
    Using power_assert 2.0.2
    Using rb_sys 0.9.52
    Using rspec-support 3.12.0
    Using rspec-core 3.12.0
    Using rspec-expectations 3.12.0
    Using rspec-mocks 3.12.1
    Using test-unit 3.5.5
    Using uri 0.12.0
    Using webrick 1.7.0
    Bundle complete! 11 Gemfile dependencies, 14 gems now installed.
    Gems in the groups 'lint' and 'doc' were not installed.
    Use `bundle info [gemname]` to see where a bundled gem is installed.
    ```
2023-01-12 10:46:54 +09:00
Hiroshi SHIBATA b311c35bdb Suppressing pending messages with RSpec 2023-01-11 20:00:21 +09:00