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

1671 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada c8d94d2797
Now test-bundler nees fake.rb 2022-09-16 14:46:21 +09:00
Nobuyoshi Nakada b6a9e68391
Add noarch-fake.rb target
`yes-fake` depends on it when `arch=noarch` is given, but the rule to
generate it from fake.rb.in is ignored now.
2022-09-15 00:31:35 +09:00
Nobuyoshi Nakada 2e324b645e Manage paths for bundler tests 2022-09-14 11:27:05 +09:00
Nobuyoshi Nakada 035978d7be Pass job-server FDs to bundler tests 2022-09-14 11:27:05 +09:00
Benoit Daloze 14bcf69c9c Deprecate Encoding#replicate
* See [Feature #18949].
2022-09-10 19:02:15 +02:00
Nobuyoshi Nakada c722597103
[MSWin] Get rid of single quotes in sed command lines
GnuWin32 sed strips only double quotes, but not single quotes, and
dies:

```
sed: -e expression #1, char 1: unknown command: `''
```
2022-09-10 20:50:37 +09:00
Nobuyoshi Nakada bcf82b7c26
Process token IDs from id.def without id.h
Fixes id.h error during updating ripper.c by `make after-update`.

While it used to update id.h in the build directory, but was trying to
update ripper.c in the source directory.  In principle, files in the
source directory can or should not depend on files in the build
directory.
2022-09-08 18:22:47 +09:00
Nobuyoshi Nakada 35c493ecf5
Dump cross.rb only when verbose [ci skip] 2022-09-07 14:48:54 +09:00
Nobuyoshi Nakada 1f91dcdab3
Define BOOTSTRAPRUBY from HAVE_BASERUBY 2022-09-07 14:33:25 +09:00
Nobuyoshi Nakada 6a43245e6c
Use BOOTSTRAPRUBY_COMMAND instead of fake.rb directly 2022-09-07 10:08:24 +09:00
Takashi Kokubun 06eb9af8c0
Add mjit-bindgen workflow (#6327) 2022-09-05 01:06:37 -07:00
Takashi Kokubun 3767c6a90d
Ruby MJIT (#6028) 2022-09-04 21:53:46 -07:00
Nobuyoshi Nakada 76664905a5
Ignore fake.rb for snapshot 2022-09-04 23:59:55 +09:00
Nobuyoshi Nakada 45004bba6b
fake.rb needs id.h 2022-09-04 02:07:11 +09:00
Nobuyoshi Nakada 7b11247b4d
Fix potential target type confliction [ci skip] 2022-09-03 21:02:29 +09:00
Nobuyoshi Nakada 7c67d0fd79
Make sources by BASERUBY if available instead of miniruby 2022-09-03 19:25:29 +09:00
Nobuyoshi Nakada 8f13d75a8c
Generate the prelude sources by common-srcs 2022-09-03 19:20:03 +09:00
Nobuyoshi Nakada 6f5305e0d2
Exclude LIBPATHENV wrapper from PREP 2022-09-03 19:20:03 +09:00
Nobuyoshi Nakada d8f81ffdff
builtin.c includes mini_builtin.c when cross-compiling 2022-09-03 19:20:03 +09:00
Nobuyoshi Nakada bc5b9be1ee
Move duplicate dependencies 2022-09-03 15:01:05 +09:00
John Hawthorn 679ef34586 New constant caching insn: opt_getconstant_path
Previously YARV bytecode implemented constant caching by having a pair
of instructions, opt_getinlinecache and opt_setinlinecache, wrapping a
series of getconstant calls (with putobject providing supporting
arguments).

This commit replaces that pattern with a new instruction,
opt_getconstant_path, handling both getting/setting the inline cache and
fetching the constant on a cache miss.

This is implemented by storing the full constant path as a
null-terminated array of IDs inside of the IC structure. idNULL is used
to signal an absolute constant reference.

    $ ./miniruby --dump=insns -e '::Foo::Bar::Baz'
    == disasm: #<ISeq:<main>@-e:1 (1,0)-(1,13)> (catch: FALSE)
    0000 opt_getconstant_path                   <ic:0 ::Foo::Bar::Baz>      (   1)[Li]
    0002 leave

The motivation for this is that we had increasingly found the need to
disassemble the instructions between the opt_getinlinecache and
opt_setinlinecache in order to determine the constant we are fetching,
or otherwise store metadata.

This disassembly was done:
* In opt_setinlinecache, to register the IC against the constant names
  it is using for granular invalidation.
* In rb_iseq_free, to unregister the IC from the invalidation table.
* In YJIT to find the position of a opt_getinlinecache instruction to
  invalidate it when the cache is populated
* In YJIT to register the constant names being used for invalidation.

With this change we no longe need disassemly for these (in fact
rb_iseq_each is now unused), as the list of constant names being
referenced is held in the IC. This should also make it possible to make
more optimizations in the future.

This may also reduce the size of iseqs, as previously each segment
required 32 bytes (on 64-bit platforms) for each constant segment. This
implementation only stores one ID per-segment.

There should be no significant performance change between this and the
previous implementation. Previously opt_getinlinecache was a "leaf"
instruction, but it included a jump (almost always to a separate cache
line). Now opt_getconstant_path is a non-leaf (it may
raise/autoload/call const_missing) but it does not jump. These seem to
even out.
2022-09-01 15:20:49 -07:00
Hiroshi SHIBATA 098a3cfaa7 Fixed typo 2022-08-26 12:15:47 +09:00
Hiroshi SHIBATA bd1b1eeb0e ruby-prof is now optional 2022-08-26 12:15:47 +09:00
Hiroshi SHIBATA 9c2af0a171 added test-syntax-suggest and prepare tasks 2022-08-26 12:15:47 +09:00
Hiroshi SHIBATA 6afb4f0a28
Added help entry for test-bundler-parallel 2022-08-22 12:23:38 +09:00
Takashi Kokubun a60507f616
Rename mjit_compile.c to mjit_compiler.c
I'm planning to introduce mjit_compiler.rb, and I want to make this
consistent with it. Consistency with compile.c doesn't seem important
for MJIT anyway.
2022-08-21 11:33:06 -07:00
Nobuyoshi Nakada f6d4d73abd
Use `rb_fork` to suppress deprecated-declarations warnings 2022-08-21 14:04:52 +09:00
Nobuyoshi Nakada 72adee6e36 Update dependencies 2022-08-17 15:23:01 +09:00
John Hawthorn 0608a9a086
Optimize Marshal dump/load for large (> 31-bit) FIXNUM (#6229)
* Optimize Marshal dump of large fixnum

Marshal's FIXNUM type only supports 31-bit fixnums, so on 64-bit
platforms the 63-bit fixnums need to be represented in Marshal's
BIGNUM.

Previously this was done by converting to a bugnum and serializing the
bignum object.

This commit avoids allocating the intermediate bignum object, instead
outputting the T_FIXNUM directly to a Marshal bignum. This maintains the
same representation as the previous implementation, including not using
LINKs for these large fixnums (an artifact of the previous
implementation always allocating a new BIGNUM).

This commit also avoids unnecessary st_lookups on immediate values,
which we know will not be in that table.

* Fastpath for loading FIXNUM from Marshal bignum

* Run update-deps
2022-08-15 16:14:12 -07:00
Nobuyoshi Nakada cb12d7c71b
Update dependencies 2022-08-14 19:45:55 +09:00
Nobuyoshi Nakada 0c9803b0fd
The "gems" build directory was rename as ".bundle" 2022-08-11 17:45:39 +09:00
Nobuyoshi Nakada 44a0a66559
Move to tool/lib/bundled_gem.rb 2022-08-05 09:44:18 +09:00
Nobuyoshi Nakada 41516b3541
Extract bundled gems by BASERUBY 2022-08-05 09:44:18 +09:00
Nobuyoshi Nakada 6a8f1a9e5c
Copy from bundled gem source for test 2022-08-05 09:44:18 +09:00
Nobuyoshi Nakada 87d8d25796
Use configured GIT 2022-08-05 09:39:47 +09:00
Jean Boussier e3aabe93aa Implement Queue#pop(timeout: sec)
[Feature #18774]

As well as `SizedQueue#pop(timeout: sec)`

If both `non_block=true` and `timeout:` are supplied, ArgumentError
is raised.
2022-08-02 11:04:28 +02:00
Nobuyoshi Nakada e0a7e5e131
Kill bundled gem tests when interrupted 2022-07-24 16:36:33 +09:00
Nobuyoshi Nakada 804b073573 Update common sources including id.h after update 2022-07-21 22:32:33 +09:00
Peter Zhu 1c9acb6bb1 Refactor macros of array.c
Move some macros in array.c to internal/array.h so that other files
can also access these macros.
2022-07-21 09:02:45 -04:00
Jemma Issroff ecff334995 Extract vm_ic_entry API to mimic vm_cc behavior 2022-07-18 12:44:01 -07:00
Nobuyoshi Nakada 64cff78005 `Gem.unpack` extracts gems so able to execute
Creates simple bin stubs to load the extracted executable files.
After only extracted under `gems` directory, the gems are considered
installed but the executable scripts are not found.
Also the second argument is now the parent of the previous second and
third arguments.
2022-07-17 19:57:48 +09:00
Nobuyoshi Nakada 5101671cbc
Disable parallel built in test-bundled-gems 2022-07-16 15:28:05 +09:00
Nobuyoshi Nakada b536ac2cd0
test-bundled-gems.rb needs `+` with GNU make
This script runs `make` internally, and sub-`make`s need the
environment variable for the job server when compiling in parallel.
2022-07-16 11:26:15 +09:00
Takashi Kokubun 6c2cad835a MJIT: Share rb_mjit_unit through mjit_unit.h
mjit_compile.c should be able to access this more easily.
2022-07-14 22:54:20 -07:00
Takashi Kokubun 439d31bc77
MJIT: Merge mjit_worker.c back to mjit.c (#6138)
Since #6006, we no longer avoid executing GC on mjit_worker.c and thus
there's no need to carefully change how we write code whether you're in
mjit.c or mjit_worker.c anymore.
2022-07-14 20:34:46 -07:00
Kevin Backhouse 8c1808151f
Fix some UBSAN false positives (#6115)
* Fix some UBSAN false positives.
* ruby tool/update-deps --fix
2022-07-12 11:48:10 -07:00
Nobuyoshi Nakada ab2a43265c Warn suspicious flag to `Regexp.new`
Now second argument should be `true`, `false`, `nil` or Integer.
This flag is confused with third argument some times.
2022-06-20 19:35:12 +09:00
John Hawthorn 17d260a87f Restore rb_exec_recursive_outer
This was a public method, so we should probably keep it.
2022-06-15 16:07:29 -07:00
Takashi Kokubun 23459e4dbb
Move RubyVM::MJIT to builtin Ruby
just less C code to maintain
2022-06-15 10:52:37 -07:00
Takashi Kokubun 1162523bae
Remove MJIT worker thread (#6006)
[Misc #18830]
2022-06-15 09:40:54 -07:00